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
Unified testing framework #212
Conversation
This comment has been minimized.
This comment has been minimized.
bc74c14
to
c7cc84b
Compare
|
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 think we can drop mypy
from the container, it's non-runtime type checking. But our tests should still be run inside the container.
Though we don't use pytest
or any other test packages in the future, so we may want to bust out mypy
into a separate dependency set.
fc79560
to
df1764e
Compare
a73e447
to
085c2eb
Compare
This comment has been minimized.
This comment has been minimized.
085c2eb
to
506670b
Compare
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.
Tox has its use case, but I feel it's a little redundant at best and at worst may be doing something we don't expect. We can already manage environments in our workflows and our container.
pytest
is the go to for testing frameworks. It has wrappers for mypy, linting, flake8 etc. Which would allow us to close off #49
It is rather daft that the python setup.py test
is now deprecated, but the python community have been re-inventing the packaging wheel for as long as I can remember.
Ok, so I've put my code where my mouth is! 🙂
|
This comment has been minimized.
This comment has been minimized.
@techman83 your changes look good to me. Should we look into pylint and flake8? |
Yes, but I think a separate PR. I enabled pylint and got a whole suite of warnings I didn't want to deal with on a PR for unifying our testing. |
Problem
See #210, installing mypy in the Dockerfile caused problems related to dependencies-of-dependencies that were installed at the system level and then not available on a fresh image with only the user install copied over.
Motivation
In the Discord discussion of the first iteration of this pull request, we agreed that it would be nice to have one simple command that developers could run to test everything, and to re-use that same command in our GitHub workflows. It looked like the
test_suite
option insetup.py
, supporting thepython setup.py test
command, might be a step in that direction.Enter pytest-dev/pytest#5534. They're deprecating
python setup.py test
.In the Discord discussion of the second iteration of this pull request,
tox
was ruled out as a solution because we already use Docker to manage our virtual environments and would prefer to run our tests in the same environment where the actual code runs. So nowpytest
is winning.Changes
test
workflow is created to run all testsFor me, this is how to run tests, though if you use a distro that doesn't try to mix Python 2 and 3 like Ubuntu does, drop the
-3
:This provides a single uniform access point for all testing, which will work the same for developers and for CI/CD.