Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement --no-fast, --chroot, and caching/invalidation for golang tests #6935

Closed
stuhood opened this issue Dec 14, 2018 · 1 comment
Closed
Assignees
Labels

Comments

@stuhood
Copy link
Member

stuhood commented Dec 14, 2018

Currently, test running for golang is not transitive, and this means that https://www.pantsbuild.org/orgs.html#continuous-integration will not actually result in all targets below your roots being tested.

In a local environment, it would be sufficient to implement and use --no-fast, --chroot, and v1 Task invalidation: then each run would skip testing portions of the graph that had not changed since the previous run.

In a distributed environment, it is also necessary to actually write to the v1 Task cache (likely by setting Task.cache_target_dirs = True), so that parallel runners can reuse one-another's work.


--no-fast and --chroot would be identical to their descriptions in the junit and pytest runners.

@jsirois
Copy link
Contributor

jsirois commented Dec 14, 2018

Noting that another tack is to make minimize aware of target types that don't minimize properly and having it add in the closure of the calculated minimal cover for those target types.

cosmicexplorer added a commit that referenced this issue Jan 25, 2019
…ely (#7145)

### Problem

Resolves #6935.

### Solution

- Extract some logic around chrooting from `JUnitRun` into `PartitionedTestRunnerTaskMixin`.
- Make `GoTest` mix in `PartitionedTestRunnerTaskMixin` and implement all of the `@abstractmethod`s (everything worked first try, which makes me very suspicious as well as grateful).
- Add an integration test for `go test`ing dependent targets.

### Result

`./pants test.go` now has some funky features like `--chroot` or `--no-fast`, and tests dependent targets by default instead of requiring this to be done manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants