Skip to content
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

Describe pytest execution in developer documentation #939

Closed
renefritze opened this issue Jun 3, 2020 · 10 comments
Closed

Describe pytest execution in developer documentation #939

renefritze opened this issue Jun 3, 2020 · 10 comments
Assignees
Labels
infrastructure Buildsystem, packages and CI
Milestone

Comments

@renefritze
Copy link
Member

Currently we rely, via the Makefile, to run python setup.py pytest. This is deprecated by setuptools. It installs dependencies with easy_install as opposed to pip.
Parallel to that we have the CI test scripts which all run pytest (under xvfb-run or mpirun at times) directly in the end. These take care to setup the env previous to running pytest. That means installing requirements/extras and ensuring pyMOR's extensions are build. Ideally we'd want a replacement for python setup.py pytest that does all that, but relies on metadata in pyproject.toml.
AFAICT there's currently no PEP for this, nor a project that fits completely.

Some references:

My current goto replacement would probably be using pip-run .[ci,optional] -- py.test --pyargs pymortests -c .ci/installed_pytest.ini. This still needs to have pip-run already installed ofc, but should take of most of the rest. It would also build a new wheel for pymor on each invocation (pip-run does not support editable installs), which is not ideal at all.

Seperate from this is the question of removing the full-test Makefile target. It (only) installs pytest plugins that are not included in our CI setup dependencies and then runs pytest. Neither @sdrave nor I use it or remember why it's there. How about you @pmli?

Ref. #910

@renefritze renefritze added this to the future milestone Jun 3, 2020
@renefritze renefritze self-assigned this Jun 3, 2020
@renefritze renefritze added the infrastructure Buildsystem, packages and CI label Jun 3, 2020
@pmli
Copy link
Member

pmli commented Jun 3, 2020

I think I used full-test a couple of times. Mostly, I run specific tests directly using pytest.

@renefritze
Copy link
Member Author

I think I used full-test a couple of times. Mostly, I run specific tests directly using pytest.

I'll take that as no opposition to remove it then 😉

@pmli
Copy link
Member

pmli commented Jun 3, 2020

I just used it when I wanted to compute the code coverage locally. If we could keep that functionality, that would be nice, but I'm also fine with just using pytest directly.

@renefritze
Copy link
Member Author

I just used it when I wanted to compute the code coverage locally. If we could keep that functionality, that would be nice, but I'm also fine with just using pytest directly.

We could simply move the --cov option to the default args in setup.cfg that are always added

@sdrave
Copy link
Member

sdrave commented Jun 8, 2020

We could simply move the --cov option to the default args in setup.cfg that are always added

This is not an option for me. First of all, I do not want to get a coverage report whenever I run py.test. It messes up the console output and takes time to compute. Also,

py.test --cov operators.py

will, for some reason run the entire test suite (as opposed to py.est operators.py --cov), and adding the option to setup.cfg has the same effect. Also, simply adding --cov does not seem like much of a burden.

Regarding a different options: How about simply removing the make targets, and document in README.md how to run the tests?

@renefritze
Copy link
Member Author

--cov takes an argument @sdrave

@renefritze
Copy link
Member Author

renefritze commented Jun 8, 2020

We could simply move the --cov option to the default args in setup.cfg that are always added

This is not an option for me. First of all, I do not want to get a coverage report whenever I run py.test. It messes up the console output and takes time to compute. Also,

py.test --cov operators.py

will, for some reason run the entire test suite (as opposed to py.est operators.py --cov), and adding the option to setup.cfg has the same effect. Also, simply adding --cov does not seem like much of a burden.

Regarding a different options: How about simply removing the make targets, and document in README.md how to run the tests?

I never use make test anyway, so removing that would be fine with. But removing docker_test ist not an option for me.

Also: lets just discuss this in the next meeting?

@sdrave
Copy link
Member

sdrave commented Jun 8, 2020

--cov takes an argument @sdrave

Good to know ...

I never use make test anyway, so removing that would be fine with. But removing docker_test ist not an option for me.

I think there is not reason to remove docker_test.

@renefritze
Copy link
Member Author

Dev meeting: Decided to remove make test, change readme to use pytest after building ext.

@renefritze renefritze changed the title How to run our tests Describe pytest execution in developer documentation Aug 18, 2021
@renefritze
Copy link
Member Author

The remaining work in this issue is actually to describe pytest execution in the non-containerized environment in the dev docs. This should include most common options/setups like running a single file, filtering with -k, etc.

@renefritze renefritze modified the milestones: future, 2021.1 Aug 18, 2021
@renefritze renefritze removed their assignment Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Buildsystem, packages and CI
Projects
None yet
Development

No branches or pull requests

3 participants