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

pants: use __defaults__ to propogate unit,integration,benchmarks tags on tests #5853

Merged
merged 3 commits into from
Dec 30, 2022

Conversation

cognifloyd
Copy link
Member

Background

This is another part of introducing pants, as discussed in various TSC meetings.

Related PRs can be found in:

Overview of this PR

This adjusts the BUILD metadata for all of our python_tests targets so that they are tagged with unit, integration, or benchmarks. We can add other tags when/if we find something that will be generally useful.

Once we are able to run tests via pants, pants can use this to select a subset of tests to run. For example:

./pants --tag=benchmarks test

Check out the docs for more powerful examples of how to use tags on the command line.

Relevant pants docs

@cognifloyd cognifloyd added this to the pants milestone Dec 21, 2022
@cognifloyd cognifloyd self-assigned this Dec 21, 2022
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines. Requires some effort to review. label Dec 21, 2022
@cognifloyd cognifloyd enabled auto-merge (squash) December 21, 2022 06:03
@cognifloyd cognifloyd changed the title pants: use __defaults__ to propogate unit,integration,benchmarks tags on tests pants: use __defaults__ to propogate unit,integration,benchmarks tags on tests Dec 21, 2022
Copy link

@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.

FYI there's a gotcha that if you have any python_test targets rather than python_tests, they won't have the tags. That's probably unlikely you'll have that happen, but could. You can avoid the risk by using the key (python_test, python_tests)

@cognifloyd
Copy link
Member Author

FYI there's a gotcha that if you have any python_test targets rather than python_tests, they won't have the tags. That's probably unlikely you'll have that happen, but could. You can avoid the risk by using the key (python_test, python_tests)

Ah yes. Thanks for the pointer. Resolved.

@cognifloyd cognifloyd force-pushed the pants-tags branch 3 times, most recently from 0755808 to 5d976d0 Compare December 29, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pantsbuild size/L PR that changes 100-499 lines. Requires some effort to review. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants