Skip to content

test: improve ci.py coverage to fix CI fail-under threshold#193

Merged
ichoosetoaccept merged 1 commit intomainfrom
02-19-test-improve-ci-coverage
Feb 24, 2026
Merged

test: improve ci.py coverage to fix CI fail-under threshold#193
ichoosetoaccept merged 1 commit intomainfrom
02-19-test-improve-ci-coverage

Conversation

@ichoosetoaccept
Copy link
Member

@ichoosetoaccept ichoosetoaccept commented Feb 19, 2026

Description

Adds 70 lines of new test coverage for tools/ci.py to bring the CI module above the fail-under threshold. Covers error paths, edge cases in log parsing, and the run_id vs pr_number detection branches.

Changes

  • tests/test_ci.py — new test cases for CI diagnosis edge cases (empty logs, missing steps, malformed output, run ID lookup)

Checklist

Related Issues

Fixes CI coverage regression from #192 (diagnose_ci tool addition).

Copy link
Member Author

ichoosetoaccept commented Feb 19, 2026

@greptile-apps
Copy link

greptile-apps bot commented Feb 19, 2026

Greptile Summary

Added comprehensive test coverage for ci.py to meet the 90% fail-under threshold. The new tests cover:

  • Multi-job failure scenarios where errors are correctly split between different jobs
  • Alternative parameter usage (cwd instead of repo)
  • Edge cases in _extract_error_lines: long log truncation (>2000 lines) and separator insertion between error groups

All tests follow existing patterns, use appropriate mocks, and verify the expected behavior without introducing logical issues.

Confidence Score: 5/5

  • Safe to merge - test-only changes that improve coverage without affecting production code
  • This PR only adds test cases to improve coverage for existing functionality. The tests are well-structured, follow existing patterns, use appropriate mocking, and properly verify the behavior they're testing. No production code changes means zero risk to the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
tests/test_ci.py Added 4 tests to improve coverage: multi-job failure splitting, cwd parameter usage, long log truncation, and error separator insertion

Last reviewed commit: aca4375

Copy link
Member Author

ichoosetoaccept commented Feb 24, 2026

Merge activity

  • Feb 24, 4:39 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 24, 4:39 PM UTC: @ichoosetoaccept merged this pull request with Graphite.

@ichoosetoaccept ichoosetoaccept merged commit 7243b50 into main Feb 24, 2026
12 checks passed
@ichoosetoaccept ichoosetoaccept deleted the 02-19-test-improve-ci-coverage branch February 24, 2026 16:39
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.

1 participant