Skip to content

Conversation

@owenlittlejohns
Copy link
Member

@owenlittlejohns owenlittlejohns commented Nov 25, 2025

Description

Similar to this PR for earthdata-varinfo, this work implements a coverage threshold for the pytest unit test suite. For the test execution to succeed, the unit test coverage of the code in the earthdata_hashdiff directory must exceed 95%. It is currently at 98.64%.

Jira Issue ID

N/A - overdue IP sprint work.

Local Test Steps

  • Pull this branch.
  • Create a local Python environment.
  • Install dependencies: pip install -r requirements.txt -r dev-requirements.txt -r tests/test_requirements.txt
  • Run the tests using the updated pytest command: pytest --junitxml=tests/reports/earthdata-hashdiff_junit.xml --cov earthdata_hashdiff --cov-report html:tests/coverage --cov-report term --cov-fail-under=95 - you should see a logged message of meeting the required test coverage.
  • Delete a couple test files. Then re-run the tests. When you have deleted enough test files, you will get below 95% code coverage, and see a logged message saying the coverage percentage is not reached.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • CHANGELOG updated with the changes for this PR
  • Package's __about__.py file changed if a new version should be published.

Copy link
Member

@flamingbear flamingbear left a comment

Choose a reason for hiding this comment

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

These are great changes.

@owenlittlejohns owenlittlejohns merged commit ad2096c into main Dec 3, 2025
5 checks passed
@owenlittlejohns owenlittlejohns deleted the IP254-pytest-cov-threshold branch December 3, 2025 22:45
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