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

Introduce coverage settings and failure threshold #63

Merged
merged 5 commits into from
Sep 27, 2023

Conversation

maxschulz-COL
Copy link
Contributor

@maxschulz-COL maxschulz-COL commented Sep 26, 2023

Description

  • move coverage settings to package pyproject.toml (they weren't doing anything before)
  • slight adjustments and introduction of minimum coverage
  • set minimum coverage to 82%

Note

  • Took out tests from coverage, as I personally find it more misleading than helpful, it dilutes the true coverage (83% without tests vs 97% with tests)
    However, it was interesting to see that some tests seem to not be executed (when running coverage on test files as well), this needs further investigation (created a ticket)

Screenshot

Checklist

  • I have not referenced individuals, products or companies in any commits, directly or indirectly
  • I have not added data or restricted code in any commits, directly or indirectly
  • I have updated the docstring of any public function/class/model changed
  • I have added the PR number to the change description in the changelog fragment, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1)) (if applicable)
  • I have added tests to cover my changes (if applicable)

Types of changes

  • Docs/refactoring (non-breaking change which improves codebase)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

@petar-qb
Copy link
Contributor

How do you mean that "Taking out tests from coverage" dilutes the true coverage?

Running hatch run cov with the following vizro/vizro-core/pyproject.toml configuration:

[tool.coverage.paths]
source = ["src/vizro"] 
tests = ["tests"]

[tool.coverage.run]
branch = true
parallel = true
source_pkgs = ["vizro", "tests"]

gives me same results:

  • the same number of tests are executed - 487,
  • coverage is the same - 83%

as when I run hatch run cov with the following vizro/vizro-core/pyproject.toml configuration:

[tool.coverage.paths]
source = ["src/vizro"] 

[tool.coverage.run]
branch = true
parallel = true
source_pkgs = ["vizro"]

@huong-li-nguyen huong-li-nguyen self-requested a review September 26, 2023 10:47
@maxschulz-COL
Copy link
Contributor Author

How do you mean that "Taking out tests from coverage" dilutes the true coverage?

First there was a small typo in my code, which is now fixed, but now you can see the difference if you take out the path and also the source_pkgs specification. Then it runs the coverage on tests as well, and you get 97%

@maxschulz-COL maxschulz-COL changed the title Introduce coverage settings and failure number Introduce coverage settings and failure threshold Sep 26, 2023
Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

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

Looks good!

@maxschulz-COL maxschulz-COL merged commit 770df7e into main Sep 27, 2023
18 checks passed
@maxschulz-COL maxschulz-COL deleted the tests/introduce_coverage branch September 27, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants