https://pantsbuild.org/ logo
#general
Title
# general
d

dry-match-62274

01/08/2020, 8:43 AM
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

hundreds-father-404

01/08/2020, 3:16 PM
Instead, try ./pants test :: —tags=-integration-test
b

brash-airport-5260

01/09/2020, 1:21 AM
@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

hundreds-father-404

01/09/2020, 1:23 AM
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

dry-match-62274

01/10/2020, 1:11 AM
@hundreds-father-404 Thanks!
h

hundreds-father-404

01/10/2020, 3:39 AM
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
5 Views