Hi, Happy new year guys. I have a question about p...
# general
d
Hi, Happy new year guys. I have a question about pant’s
tag
. for example we have below test definition with tags :
target1(…,tag=integration-test), target2(…,tag=unit-test-team1), target3(…,tag=unit-test-team2), …
Then for simple we created an aggregation target:
targetAll(dependencies=[target1,target2,target3,…])
we thought we can filter out ‘integration-test’ from all tests by using
./pants test targetAll --tags=-integration-test
However, target1 is still executed, so we thought the filter on
tag
will not work with the sub targets. do you have any recommendations about how
tag
should be used in this situation?
h
Instead, try ./pants test :: —tags=-integration-test
b
@hundreds-father-404 we are using https://www.pantsbuild.org/orgs.html#continuous-integration. so… do you mean it’s difficult to use both of tags and this script…?
h
Generally, a “catch all” target is an anti-pattern. Targets should generally map one-per-directory Instead of running
./pants test my-catch-all
, it’s better to run
./pants test ::
, which will run against all targets
🙂 1
d
@hundreds-father-404 Thanks!
h
You’re welcome! Also a preview of the future of pants: this week I’ve been doing some work to allow us to have file system specifications, so that you could run
./pants test tests/util/foo.py
rather than having to specify a target :)
❤️ 1