Skip to content

Omit project_euler/ from coverage reports #10469

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

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ addopts = [
]

[tool.coverage.report]
omit = [".env/*"]
omit = [
".env/*",
"project_euler/*",
"scripts/*"
Copy link
Member

Choose a reason for hiding this comment

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

Let's leave scripts in. I dislike not testing things.

Suggested change
"scripts/*"

I think the coverage report is way too long and users need to scroll across hundreds of lines (that no one reads) to find their failing pytests.

Would it be possible to put coverage in a separate GitHub Actions step so its output is not tagged directly on the end of pytest output?

Copy link
Contributor Author

@tianyizheng02 tianyizheng02 Oct 14, 2023

Choose a reason for hiding this comment

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

We could break up pytest into two separate workflows, one for tests and one for coverage.

Current:

- name: Run tests
        # TODO: #8818 Re-enable quantum tests
        run: pytest
            --ignore=quantum/q_fourier_transform.py
            --ignore=project_euler/
            --ignore=scripts/validate_solutions.py
            --cov-report=term-missing:skip-covered
            --cov=. .

Proposed:

- name: Run tests
        # TODO: #8818 Re-enable quantum tests
        run: pytest
            --ignore=quantum/q_fourier_transform.py
            --ignore=project_euler/
            --ignore=scripts/validate_solutions.py
- name: Check test coverage
        run: pytest
            --cov-report=term-missing:skip-covered
            --cov=.

If this looks good to you, I can make this change in a separate PR.

]
sort = "Cover"

[tool.codespell]
Expand Down