-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add (or document) a way to skip integration tests during local development #543
Comments
Also, @jaraco, because I don't think I've said it yet: thanks for adding the integration tests. 😉 |
I’ve been thinking the same thing. I’ve seen a pattern where slow tests are marked as slow and only run on demand. I should point out that although the test take more than a minute on first run, because they reuse tox environments, they run faster on subsequent runs, as fast as 20 sec in my environment. Still, that’s 10x slower than runs without integration tests so probably worth making them opt-in. |
For a short term workaround, try |
(to pytest, so |
You could implement a command-line option per these docs and enable it in CI with a PYTEST_ADDOPTS environment variable. |
Can I take a stab at this? I ran
Perhaps adding instructions on skipping a test can be added at Contributing docs , something along the lines of how Getting started in pip does it? I used
|
Given how widely used tox and pytest are in Python, do we really need to document their well-documented feature-set for contributors? Can we instead just link to their documentation? With respect to skipping the integration tests, I wonder if we can instead use pytest's parallelism so the tests aren't run serially to improve the test performance. I'm wary to split out separate environments because that can lead to confusion for contributors (the tests passed locally but failed in CI because of these other things I didn't know I needed to run). Further, if our CI is the only thing running integration tests that will only make CI times longer as we add to them and don't experience their full pain ourselves. I'd rather feel that pain so as to not rely too heavily on integration tests than allow our CI runs to take 30 minutes or more eventually |
I think adding a sentence like this would be sufficient:
FWIW, I've been making this easier by setting these environment variables:
Which will skip integration tests if I just run https://docs.pytest.org/en/latest/customize.html#adding-default-options Side note: the contributing docs don't mention
|
Specifically tagging the
Is this something done by twine in general, or specifically in your development env
I also observed that we are using pretend to create test stubs. Is that worth a mention too? |
Are you game to submit a PR that includes your proposed language? We can workshop it there. 😉
Just in my dev env, via direnv.
I think this would be better suited for a style guide (which doesn't exist). But I'd merge a brief mention of it. |
Skipping via I'm going to close this for now; happy to revisit in the future, if needed. |
Currently, if I just run
pytest
ortox -e py38
, it runs all the tests, includingtest_integration.py
, with a total runtime of nearly a minute. It'd be nice to get faster feedback.I know pytest has lots of facilities for selecting/excluding tests, but I don't know which one(s) makes sense here. I'm guessing there's plenty of prior art for this sort of thing.
Off the top of my head, maybe they could be skipped by default, unless there's an environment variable set?
The text was updated successfully, but these errors were encountered: