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
Move V2 test runner integration test into proper location of backend/python
folder
#7847
Conversation
@@ -3,7 +3,7 @@ | |||
|
|||
python_tests( | |||
name='inject_init', | |||
sources=['test_inject_init.py'], |
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.
My read on this affordance is that it supports legacy targets and the hope is for the irregularity to go away:
pants/src/python/pants/build_graph/target.py
Lines 115 to 120 in ba0132d
# The source argument is automatically promoted to the sources argument, and rules should # always use the sources argument; don't error if people used source in their BUILD file. # There doesn't appear to be an easy way to error if a Target subclass explicitly takes # `source` as a named kwarg; it would be nice to error rather than silently swallow the value, # if there were such a way. ignore_params.add('source') - source attribute is automatically promoted to sources source attribute is automatically promoted to sources #5908
- Undocumented feature: https://www.pantsbuild.org/build_dictionary.html
My read could definitely be wrong though - @illicitonion seems like the expert here on intent.
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.
I'm largely indifferent to source
vs sources
; both work, there are guard-rails in place to stop you from using both, and I have no intention of trying to get rid of either...
@@ -3,7 +3,7 @@ | |||
|
|||
python_tests( | |||
name='inject_init', | |||
sources=['test_inject_init.py'], |
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.
I'm largely indifferent to source
vs sources
; both work, there are guard-rails in place to stop you from using both, and I have no intention of trying to get rid of either...
backend/python
folderbackend/python
folder
test_test_integration.py
was really an integration test for the V2 Pytest runner, not for the generic V2 test runner. For example, these tests would not make sense in the context of running Java tests. Related code should live near each other to make things more discoverable.Also, this changes the
BUILD
forpants_test/rules
to create an entry for each test file and to properly include each test's dependencies, which were quite out of date. Having a target per test file makes it easier to keep dependencies up to date and makes it easier to run a specific test suite.This is prework for #7846.