For test (or python testing more specifically), ho...
# general
w
For test (or python testing more specifically), how transitive is this statement? https://www.pantsbuild.org/2.21/docs/python/goals/test
This also gives you fine-grained invalidation. If you run
pants test ::
, and then you only change one file, then only tests that depended on that changed file will need to rerun.
As in, if I change
foo
and
bar
,
baz
, and
thud
rely on foo - I expect each of those targets tests to re-run. But what if
foo
is in a package, and the generated
pex_binary
is depended on by 5 other subprojects in a monorepo - would the tests for those subproejcts also kick off?
I can test out several cases, but trying to determine the philosophy of the
test
goal for python
d
Hello ,I was going to put my question and I have seen yours.... I am not an expert I am just evaluating to pants to use it in my company but for the knowledge I have pants, will only run tests that need to be run, and other parts needed to be rerun to able to run those tests, That is setting the proper dependencies and running just pants tests :: will run only the tests needed, the other ones will get the previos cached output.
w
Yeah, just wondering specifically about the "only run tests that need to be run".
pytest
seems to check for transitive dependencies, but I wasn't sure if it tests them or not offhandedly. As in
pants --transitive test foo
vs
pants test foo
- whether the transitive is redundant on test targets
Even weirder, with a batch_size of 32:
Run Pytest for batch of foo_tests and 60 other files
Shouldn't 32 be the cap?
d
I figured out what has happened ... @wide-midnight-78598 I was doing a little example , as small al posible, I cannot share any company code... you know. and it was working... I couldn't understand it.. So I started dig deeper in my PoC and... Just before I abandoned the PoC two months ago I started implementing a hello world plugin... I added the directory and the BUILD file just
Copy code
# pants-plugins/BUILD:

pants_requirements(name="pants")
this requirement seems to be incompatible with fastapi.. because I didn't regenerate the lock file until now, I didn't see it and I had completely forgotten the plugin.. removing pants_requirements make everything works again.. But there is still there the issue.. is not affecting me now.. but is still there.
👍 1