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

Add nox to run test and environment #516

Merged
merged 10 commits into from Dec 15, 2021
Merged

Conversation

Spacetown
Copy link
Member

@Spacetown Spacetown commented Sep 22, 2021

As suggested in #514 this PR replaces the makefile to run the quality test with nox.
Nox is configured with a noxfile.py where the tests are described. The needed modules for the test are installed in a test specific virtual environment. Because of this the requirement.txt files are removed, the user only need to install nox.

Also the mechanism if only a gcc instead of gcc-x is available (e.g. for GitHub actions running on Windows) is changed. Instead of copying the executable an additional environment variable CC_REFERENCE is introduced which is used in test_gcovr.py if it is defined.

The building of the wheel is also moved from the pipeline to the noxfile.py and the pipeline now uses nox for running setup.py.

The noxfile.py also contains a list of black conform files. This files are checked with different options to abort if there are formatting errors. If a file is formated with black it should be added to the list. After all files are black conform the call should be changed.

@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #516 (df6e35e) into master (b127d4e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #516   +/-   ##
=======================================
  Coverage   96.15%   96.15%           
=======================================
  Files          21       21           
  Lines        2837     2837           
  Branches      527      527           
=======================================
  Hits         2728     2728           
  Misses         48       48           
  Partials       61       61           
Flag Coverage Δ
ubuntu-18.04 95.66% <100.00%> (ø)
windows-2019 95.91% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gcovr/gcov.py 81.59% <100.00%> (ø)
gcovr/tests/test_gcovr.py 98.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b127d4e...df6e35e. Read the comment docs.

@Spacetown Spacetown force-pushed the add_nox branch 2 times, most recently from dcc9bef to d09397e Compare December 2, 2021 19:56
@Spacetown Spacetown added QA related to testing, build infrastructure, etc Type: Enhancement Internal change Internal change not visible to user labels Dec 8, 2021
Copy link
Member

@latk latk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement – doing string manipulation in Make was getting totally out of hand. But it's interesting how different Nox' push-style notifications are from Make's pull-style dependencies.

Anyway, I have lots of comments. Including some errors, particularly about the TEST_OPTS variable that has been removed (good!) but not completely.

At some point, the administration tasks like adding copyright headers or the release-check could also be Noxified/Pythonized like this.

.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved
doc/requirements.txt Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
Copy link
Member

@latk latk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now in a state that can be merged. But as always, various comments :)

.github/workflows/test.yml Outdated Show resolved Hide resolved
CONTRIBUTING.rst Outdated Show resolved Hide resolved
admin/Dockerfile.qa Outdated Show resolved Hide resolved
doc/README.txt Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
noxfile.py Outdated Show resolved Hide resolved
Co-authored-by: Lukas Atkinson <opensource@LukasAtkinson.de>
@Spacetown Spacetown merged commit 6a79a04 into gcovr:master Dec 15, 2021
@Spacetown Spacetown deleted the add_nox branch December 15, 2021 20:45
Spacetown added a commit to Spacetown/gcovr that referenced this pull request Mar 8, 2023
Fix test of documentation: There was a old call of make with the message "make: Nothing to be done for 'doc'." because the makefile was removed with gcovr#516.
Spacetown added a commit that referenced this pull request Mar 8, 2023
- Use ENTRYPOINT instead of CMD in Dockerfile to be able to use arguments for nox.
  - Remove the internal environment variables NOX_POSARGS and NOX_OPTIONS. This are superfluous  with ENTRYPOINT.
- Rename the sessions to build and run the container
  - docker_qa_build* -> docker_build*
  - docker_qa_run* -> docker_run*
  - Add sessions docker and docker_compiler
- Docker: Run lint and tests in separate steps
- Check building of wheel and bundle of app in all environments.
- Fix test of documentation: There was a old call of make with the message "make: Nothing to be done for 'doc'." because the makefile was removed with #516.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal change Internal change not visible to user needs review QA related to testing, build infrastructure, etc Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants