steep-eve-20716
08/05/2024, 6:19 PMpython_source
?
# The most intuitive, but doesn't work
pants test source.py
# These don't work
pants dependents --transitive --filter-target-type=python_tests source.py
pants filedeps --transitive --filter-target-type=python_tests source.py
# This seems to work, but isn't clean
pants dependents source.py | grep _test.py | xargs pants test
happy-kitchen-89482
08/05/2024, 10:01 PMpants dependents
doesn’t run tests, it lists dependents, so that is behaving as expected. pants test source.py
doesn’t do anything because source.py
isn’t a test, although I can see how that would be intuitive.happy-kitchen-89482
08/05/2024, 10:02 PMpants dependents --transitive --filter-target-type=python_tests source.py | xargs pants test
happy-kitchen-89482
08/05/2024, 10:02 PMhappy-kitchen-89482
08/05/2024, 10:02 PMpants --changed-since=main --changed-dependents=transitive test
for running all tests that cover changed files, but nothing to cover a specific named filehappy-kitchen-89482
08/05/2024, 10:02 PMsteep-eve-20716
08/05/2024, 10:30 PMpants dependents --transitive --filter-target-type=python_tests source.py
to run tests. But it doesn't list any targets:
# This works as expected:
$ pants dependents --transitive source.py
other_source.py:sources
source_test.py:tests
# Filtering by target-type works with `list`:
$ pants list : --filter-target-type=python_test
source_test.py:tests
# Doesn't print anything for filtered dependents:
$ pants dependents --transitive --filter-target-type=python_tests source.py
$
happy-kitchen-89482
08/05/2024, 11:38 PM--filter
applies to the input targets, not the output targets…happy-kitchen-89482
08/05/2024, 11:38 PM--filter
on to the second invocationhappy-kitchen-89482
08/05/2024, 11:38 PMxargs pants test
onesteep-eve-20716
08/05/2024, 11:45 PMOh right, becauseI suppose this makes sense, just a bit unintuitive 👍applies to the input targets, not the output targets--filter
happy-kitchen-89482
08/05/2024, 11:53 PMhappy-kitchen-89482
08/05/2024, 11:54 PM--output-filter
to those goalshundreds-carpet-28072
08/06/2024, 11:36 AM—output-filter
happy-kitchen-89482
08/06/2024, 7:06 PM