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 codecov and coverage threshold, hoist test requirements to setup.py #348

Merged
merged 7 commits into from
Mar 26, 2021

Conversation

bollwyvl
Copy link
Collaborator

@bollwyvl bollwyvl commented Mar 25, 2021

motivated by #346 (comment)

  • adds docs/requirements.txt to MANIFEST.in
  • reads the requirements file during build for [test]
  • adds a [coverage] with codecov and pytest-cov
  • adds a coverage threshold (set to the current value) to fail in CI
  • uploads to codecov at the end of a CI run (only the first fail will upload, however, due to fail-fast (which is fine))
    • the reports get (more) useful once merged to HEAD,

    • and it can be configured for badges, posting a report to PRs, etc.

  • cache wheels and node_modules
    • appears to knock off ~30s

@bollwyvl
Copy link
Collaborator Author

Here's a build that shows the coverage threshold having teeth:
https://github.com/pydata/pydata-sphinx-theme/pull/348/checks?check_run_id=2193936885

@bollwyvl
Copy link
Collaborator Author

No further changes planned, can happily be squashed.

run: pytest --cov pydata_sphinx_theme --cov-report term-missing:skip-covered --cov-fail-under ${{ env.COVERAGE_THRESHOLD }}

- name: Upload coverage
if: ${{ always() }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this if statement, assuming that always is always true?

@choldgraf
Copy link
Collaborator

This looks great! One quick question

@bollwyvl
Copy link
Collaborator Author

bollwyvl commented Mar 26, 2021 via email

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@jorisvandenbossche jorisvandenbossche merged commit d56e601 into pydata:master Mar 26, 2021
@jorisvandenbossche
Copy link
Member

@bollwyvl bollwyvl mentioned this pull request Mar 26, 2021
2 tasks
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.

None yet

3 participants