Skip to content

Configure CI to fail on skip of optional deps? #26890

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

Open
TomAugspurger opened this issue Jun 16, 2019 · 4 comments
Open

Configure CI to fail on skip of optional deps? #26890

TomAugspurger opened this issue Jun 16, 2019 · 4 comments
Labels
CI Continuous Integration Needs Discussion Requires discussion from core team before further action Testing pandas testing functions or related to the test suite

Comments

@TomAugspurger
Copy link
Contributor

We have a recurring problem where tests are skipped without us realizing. See the discussion on #26852 and elsewhere.

Can we think of a way to make this more robust? Perhaps by adding an additional command line option to our pytest calls

pytest pandas --no-skip-xclip

Then we would update our calls to pytest.importorskip to use a pandas' wrapper that checks the config options. By default, it'll still skip, but if the --no-skip-{dep} flag is passed we would fail.

This would complicate the actual pytest call in the CI scripts, though it's already quite complicated.

@TomAugspurger TomAugspurger added Testing pandas testing functions or related to the test suite CI Continuous Integration labels Jun 16, 2019
@datapythonista
Copy link
Member

My preference would be to have the I/O modules and their tests in a separate directory and be able to test them explicitly when needed (e.g. pytest pandas/ io/parquet io/excel). Proposed in #26804

My second preferred option would be mark tests and call them explicitly too, so we don't have the skips either (e.g. `pytest -m "parquet and excel").

What you propose seems reasonable, and less verbose, but I think more difficult to learn, understand, and to have clear what's being tested IMO. I'm ok with it, but to me sounds more like a temporary solution, better than what we have, but we'll still have similar problems I think.

@TomAugspurger
Copy link
Contributor Author

Would your option 2 (adding marks & calling pytest -m "parquet and excel) work out of the box? I would think they would still be importorskipped if the dep isn't present.

@datapythonista
Copy link
Member

If we just add the mark you're right, but I think we can remove the skip if we have the mark, and use -m "not excel" if we want to skip. It's surely more verbose, but I'd say it's worth, and we'd never have a problem that something is not tested without knowing.

@simonjayhawkins
Copy link
Member

If we just add the mark you're right, but I think we can remove the skip if we have the mark, and use -m "not excel" if we want to skip. It's surely more verbose, but I'd say it's worth, and we'd never have a problem that something is not tested without knowing.

testing locally would also need to use the -m flag if optional dependencies aren't installed. so could probably do with another flag to indicate it is a CI test run and fail instead of skip.

@mroeschke mroeschke added the Needs Discussion Requires discussion from core team before further action label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Needs Discussion Requires discussion from core team before further action Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

4 participants