Skip to content

test: achieve 100% test coverage#580

Merged
jmeridth merged 2 commits into
mainfrom
zkoppert/100-percent-coverage
Jun 16, 2026
Merged

test: achieve 100% test coverage#580
jmeridth merged 2 commits into
mainfrom
zkoppert/100-percent-coverage

Conversation

@zkoppert

Copy link
Copy Markdown
Collaborator

Proposed Changes

Webhook-style CI failures and Dependabot ecosystem additions were the only paths left uncovered - 5 lines across two modules kept coverage at 98.93%. I added three targeted tests to close the gap:

  • get_int_env_var with a non-integer value (env.py lines 78-79, ValueError branch)
  • get_repos_iterator with a team that has zero repositories (evergreen.py lines 379-380, early exit branch)
  • commit_changes with an existing config file (evergreen.py line 433, update-vs-create branch)
Metric Before After
Total coverage 98.93% 100%
Uncovered lines 5 0
Test count 155 passed 176 passed

Tradeoffs: I added a # pylint: disable=too-many-lines to test_evergreen.py (now 1017 lines) rather than splitting the file, matching the existing convention in test_env.py.

Testing

I ran make test and confirmed all 176 tests pass with 100% coverage across all 5 source modules. I ran make lint and confirmed a clean 10.00/10 pylint score with no flake8, isort, mypy, or black issues.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing

I added three tests to cover the remaining uncovered lines:

- get_int_env_var with a non-integer value (env.py lines 78-79)
- get_repos_iterator with a team that has zero repos (evergreen.py lines 379-380)
- commit_changes with an existing config file (evergreen.py line 433)

Coverage moves from 98.93% to 100%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Zack Koppert <zkoppert@github.com>
Signed-off-by: Zack Koppert <zkoppert@github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds targeted unit tests to cover previously uncovered branches in environment parsing and repository iteration/commit logic, with the goal of reaching 100% test coverage for the action’s core modules.

Changes:

  • Added a commit_changes test covering the “update existing config” branch (ensuring file_contents().update() is used instead of create_file()).
  • Added a get_repos_iterator test covering the “team has zero repositories” early-exit path (sys.exit(1)).
  • Added a get_int_env_var test covering the non-integer ValueError branch, and updated the test module import/docstring accordingly.
Show a summary per file
File Description
test_evergreen.py Adds two new tests for previously uncovered commit_changes and get_repos_iterator branches; adds a module-level pylint directive for file length.
test_env_get_bool.py Expands coverage to include get_int_env_var’s non-integer branch and updates imports/docstring to match.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

@zkoppert zkoppert marked this pull request as ready for review June 16, 2026 14:35
@zkoppert zkoppert requested a review from jmeridth as a code owner June 16, 2026 14:35
@jmeridth jmeridth merged commit 598e2be into main Jun 16, 2026
35 checks passed
@jmeridth jmeridth deleted the zkoppert/100-percent-coverage branch June 16, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants