Summary
Add a CLI call-count contract to the check-mode tests for .github/actions/upload-codescene-coverage.
The current test verifies the stub output for one invocation of:
check --verbose --coverage-files coverage.xml
It does not fail if the action invokes the CLI more than once.
Required change
Use cmd_mox.verify(), or an equivalent strict mock verification, to assert that the expected CodeScene CLI command executes exactly once.
Rationale
A duplicate coverage check can alter runtime, duplicate diagnostics, or cause unexpected side effects. The current stdout assertion cannot detect this regression.
Affected area
.github/actions/upload-codescene-coverage/tests/test_check_mode.py
Acceptance criteria
- The successful check-mode test asserts exactly one CLI invocation.
- The assertion verifies the expected arguments, including
--verbose and --coverage-files coverage.xml.
- A deliberate duplicate invocation causes the test to fail.
References
Summary
Add a CLI call-count contract to the check-mode tests for
.github/actions/upload-codescene-coverage.The current test verifies the stub output for one invocation of:
It does not fail if the action invokes the CLI more than once.
Required change
Use
cmd_mox.verify(), or an equivalent strict mock verification, to assert that the expected CodeScene CLI command executes exactly once.Rationale
A duplicate coverage check can alter runtime, duplicate diagnostics, or cause unexpected side effects. The current stdout assertion cannot detect this regression.
Affected area
.github/actions/upload-codescene-coverage/tests/test_check_mode.pyAcceptance criteria
--verboseand--coverage-files coverage.xml.References