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

[internal] add mark and fixture for lockfile generation, take #2 #15271

Merged
merged 11 commits into from
May 9, 2022

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Apr 27, 2022

Add a jvm_lockfile pytest fixture and related custom mark pytest.mark.jvm_lockfile for defining lockfiles for use in tests. This allows avoiding having to replicate lockfile content in code using TestCoursierWrapper, which can become unwiedly once a resolve in complicated enough.

Lockfiles are generated by running ./pants internal-generate-test-lockfile-fixtures :: which collects all tests marked with pytest.mark.jvm_lockfile, resolves their requirements, and writes out the resulting lockfiles. A custom Pants goal is used so that the plugin code gets access to the Pants source tree and targets. (An earlier iteration of this PR tried to use a RuleRunner in a script under build-support/bin, but RuleRunner is used for testing in an isolated directory and has no access to the Pants repository sources.)

@tdyas tdyas added the category:internal CI, fixes for not-yet-released features, etc. label Apr 27, 2022
@tdyas tdyas force-pushed the jvm_test_lockfiles_put_back branch from e491729 to 6be345d Compare April 27, 2022 14:15
@tdyas
Copy link
Contributor Author

tdyas commented Apr 27, 2022

This doesn't actually work. The release process still cannot find pants.testutil even after I supposedly disabled the internal backend that added the test fixture resolution goal. I'm stumped.

@tdyas tdyas force-pushed the jvm_test_lockfiles_put_back branch from c2bd3c1 to 38a75f2 Compare May 5, 2022 19:28
Tom Dyas added 7 commits May 7, 2022 01:08
…on (pantsbuild#15190)" (pantsbuild#15267)"

This reverts commit 21f8a51.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]
[ci skip-rust]
[ci skip-rust]
[ci skip-rust]

[ci skip-build-wheels]
@tdyas tdyas force-pushed the jvm_test_lockfiles_put_back branch 6 times, most recently from e653deb to ff0e020 Compare May 8, 2022 00:13
[ci skip-rust]
@tdyas tdyas force-pushed the jvm_test_lockfiles_put_back branch from 40af86c to adbe3ca Compare May 9, 2022 04:13
@tdyas tdyas changed the title Revert "Revert "[internal] add mark and fixture for lockfile generation (#15190)" (#15267)" [internal] add mark and fixture for lockfile generation, take #2 May 9, 2022
@tdyas tdyas marked this pull request as ready for review May 9, 2022 05:56
@tdyas tdyas requested review from stuhood and Eric-Arellano May 9, 2022 05:56
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool!

@tdyas tdyas merged commit a95d9ce into pantsbuild:main May 9, 2022
@tdyas tdyas deleted the jvm_test_lockfiles_put_back branch May 9, 2022 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants