test: achieve 100% test coverage#580
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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_changestest covering the “update existing config” branch (ensuringfile_contents().update()is used instead ofcreate_file()). - Added a
get_repos_iteratortest covering the “team has zero repositories” early-exit path (sys.exit(1)). - Added a
get_int_env_vartest covering the non-integerValueErrorbranch, 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
jmeridth
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_varwith a non-integer value (env.py lines 78-79, ValueError branch)get_repos_iteratorwith a team that has zero repositories (evergreen.py lines 379-380, early exit branch)commit_changeswith an existing config file (evergreen.py line 433, update-vs-create branch)Tradeoffs: I added a
# pylint: disable=too-many-linestotest_evergreen.py(now 1017 lines) rather than splitting the file, matching the existing convention intest_env.py.Testing
I ran
make testand confirmed all 176 tests pass with 100% coverage across all 5 source modules. I ranmake lintand confirmed a clean 10.00/10 pylint score with no flake8, isort, mypy, or black issues.Readiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing