gentle-flower-25372
04/03/2024, 12:26 PMpytest -m "not integration"
gentle-flower-25372
04/03/2024, 12:27 PM[pytest]
args = ["-m", "not integration"]
narrow-vegetable-37489
04/03/2024, 12:27 PM--
will get passed to Pytest, so you should be able to do pants test :: -- -m "not integration"
gentle-flower-25372
04/03/2024, 12:29 PMpants --changed-since=origin/main
so I'd like the ability to do it on a config basis so that specific modules in our monorepo can exclude the integration tests from running in CI.wide-midnight-78598
04/03/2024, 12:31 PMwide-midnight-78598
04/03/2024, 12:31 PMgentle-flower-25372
04/03/2024, 12:32 PM@pytest.mark.integration
🙂
It's a mixed bag, but I can restructure the tests (I think) and then exclude entire files.wide-midnight-78598
04/03/2024, 12:33 PMwide-midnight-78598
04/03/2024, 12:33 PMwide-midnight-78598
04/03/2024, 12:33 PMIt's a mixed bag, but I can restructure the tests (I think) and then exclude entire filesMaybe there's a world of mixing target filtering and passthrough args as Jonas suggested
wide-midnight-78598
04/03/2024, 12:34 PMAh, okay, didn't see this - but wouldn't this be about passing through the pytest control?@pytest.mark.integration
narrow-vegetable-37489
04/03/2024, 12:35 PMtags
. So either you can tag all targets you want to exclude with something specifically, or do it for a whole tree using __defaults__
. Then you can run your Pants commands with --tag="-your_tag"
to exclude all those targets. Do note that it exclude it from lint
, check
etc. as well.gentle-flower-25372
04/03/2024, 12:35 PM-
)?narrow-vegetable-37489
04/03/2024, 12:36 PMgentle-flower-25372
04/03/2024, 12:36 PMgentle-flower-25372
04/03/2024, 12:37 PMwide-midnight-78598
04/03/2024, 12:37 PMwide-midnight-78598
04/03/2024, 12:38 PMgentle-flower-25372
04/03/2024, 12:40 PMgentle-flower-25372
04/03/2024, 12:40 PM