-
Notifications
You must be signed in to change notification settings - Fork 392
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
Reorganize the tests into unit/functional/integration/external #1155
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1155 +/- ##
==========================================
+ Coverage 93.12% 95.08% +1.96%
==========================================
Files 29 29
Lines 4419 4418 -1
==========================================
+ Hits 4115 4201 +86
+ Misses 304 217 -87
... and 10 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
d070bb6
to
6a7015c
Compare
54ea28e
to
ff68ecd
Compare
In order to keep the package size under control when tests are included
ff68ecd
to
3fcc046
Compare
Sorry, had a long week, I have a few notes, let me get to my PC later today and I'll write them out |
No worries at all! Take your time! This can as well be later on this week or next week-end. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review. Overall 👍 just 2 things to addressed in this PR:
- Where to put the
black
, etc. dependencies.test-integration
ortest-external
. Having them intest_functional
might be a bit complicated for packaging - Using other methods to
pytest.skip
pyproject.toml
Outdated
"autopep8", | ||
"black", | ||
"isort", | ||
"flake8", | ||
# jupytext --execute | ||
"ipykernel", | ||
# Pre-commit tests | ||
"gitpython", | ||
"pre-commit", | ||
# Interaction with other contents managers | ||
# jupyter-fs==0.4.0 is async, which is not supported by Jupytext ATM | ||
"jupyter-fs<0.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer thse in an integration test, mostly because these are optional dependencies, and they primarily test how jupytext
interacts with other tools. Indeed the tests are better classified as functional tests, and I see many projects do so, so it is more of a subjective classification.
Why I would prefer this as integration
is because w.r.t. packaging, unit and functional tests are good to include as a whole, while integration tests are a bit hit-and-miss (mostly because most projects use mocking for these, and the package versions can differ drastically with the one tested upstream).
We could also move these to test-external
as the optional-dependency
(those that are optional) and keep the unit
/integration
/functional` categorization like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the guidance! Actually I have moved all the tests that involve a non-core dependency to tests/external
.
All the tests in unit
, functional
and integration
pass, with very little dependencies. I think all these tests should always pass.
I have also included the tests in the package (but I was not sure whether tests/external
should be included too?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About packaging, yes it is better to be safe and include everything. Also, sdist
only picks up on git sources (non-git sources are added as artifacts), and the only other one in the list is demo
which is good to include as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the tests 👍 to the organization. Just a comment, probably you are aware of the practice of mirroring the source files with the test files, but that is only meaningful in unit-tests, which you seem to be following, so 👍. Also, a coding practice tip, it is good to split the codecov flags into unit-test and the rest.
There is one confusing part, why areall of the tests as python packages? Pytest should automatically resolve them from the test_*
naming scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @LecrisUT !
Can you point me to an exemple re the differentiated coverage ?
Re the inits in tests, indeed I am planning to remove them in this PR. Right now I need them because they import from utils.py but I do plan to use fixtures instead of list_notebooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just quick links from my projects:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for sharing! I'll try this asap.
unit and functional (and even integration) tests run with very little dependencies
1f55467
to
bf6b3e4
Compare
8db6cae
to
3b82bdf
Compare
@@ -0,0 +1,50 @@ | |||
name: test-categories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be added to .github/workflows/ci.yaml
.
Also, remind me to make a PR to re-organize these CI files.
About the conda test failure, it seems you need to add a browser in the relevant |
7867bae
to
23fdd2d
Compare
Thanks @LecrisUT for guiding me into this! I am very glad with the outcome. I've set up the coverage flags: Also the coverage seems to go up (but I would like to see codecov commenting on this PR too!)
Thanks, they are all yours! |
This is very much a work in progress for now.
I'll try to classify all the different tests.
Will close #1136.