Is there a way to only run tests with a certain dependency? #19941
|
I am using Pants with Python and would like to only run tests with and without a certain dependency. This particular dependency provides some native library integrations and is a bit peculiar with resources used, so we want to run it separately in our CI process. One job will run all tests with this dependency and another job will run all tests without this dependency. Is there a way to do this? I tried using Any help appreciated! |
Replies: 1 comment 1 reply
|
I think you were pretty close, as there is no advanced search/filtering built into Pants. Perhaps something like: $ pants dependents --transitive <some dependency> | sort > tgts-depending-on-some-dep.specs
$ pants list :: | sort > all.specs
$ comm -1 -3 some-deps.specs all.specs > tgts-not-depending-on-some-dep.specsThen you can use the two $ pants --spec-files=tgts-not-depending-on-some-dep.specs test
# etc.. |
I think you were pretty close, as there is no advanced search/filtering built into Pants. Perhaps something like:
Then you can use the two
tgts-..specsfiles as needed with subsequent runs: