-
-
Notifications
You must be signed in to change notification settings - Fork 769
Use python imports to identify fixtures (part 5/6) #5705
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3be304b
to
f80363a
Compare
5cbe724
to
eccb780
Compare
rush-skills
approved these changes
Aug 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
cognifloyd
commented
Aug 12, 2022
fba1c80
to
8283904
Compare
This lets pants detect the dependency
This allows pants to know which test uses this fixture.
Let pants know that these runners are in use for these tests
Let pants know where to get these conf files. Note that these conf files are not the same as the files in the repo root: //conf/st2.tests*.conf
1fb7909
to
bc952a5
Compare
arm4b
approved these changes
Aug 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
maintenance
pantsbuild
refactor
size/L
PR that changes 100-499 lines. Requires some effort to review.
tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
I'm working towards introducing
pants
. Eventually I would like to use pants to run tests to take advantage of the fine-grained per-file caching of results that accounts for dependencies by python files (pants infers the deps by reading the python files).In order to use the fine-grained caching, Pants needs to know which tests rely on which fixtures. We could add extra metadata to tie the tests to the fixtures, but that would be an additional maintenance burden that will become out-of-date. We can also include all fixtures for all tests, but then we don't benefit from the fine-grained per-file caching. However, pants can already infer dependencies based on python imports, so that is what this PR (and several follow-up PRs) takes advantage of.
Overview
This PR does the following:
__init__.py
.fixture.py
file in each fixture that uses the fixturesloader utils (where helpful) to identify itself withPATH
andNAME
vars.PATH
and/orNAME
vars from that fixture.Follow-up PRs will address other fixture packs and other sets of fixtures. I will submit those PRs after this one is merged.
Statistics
Changes Summary:
fixture.py
(each has 13 lines of ©️/license header):18+16*5=+98 lines
__init__.py
when that made more sense for a directory of fixtures-24 +24
lines changed in test files to use the new fixture vars.