Skip to content

test: Add single-parser test optimization to CI#1148

Open
nathan-stender wants to merge 3 commits intomainfrom
ci-single-parser-tests
Open

test: Add single-parser test optimization to CI#1148
nathan-stender wants to merge 3 commits intomainfrom
ci-single-parser-tests

Conversation

@nathan-stender
Copy link
Collaborator

Summary

  • Detects when PR changes are isolated to a single parser directory
  • Runs only that parser's tests instead of the full test suite
  • Provides 10-30x speedup for ~30% of PRs (single-parser changes)

Changes

  • Added detect-changes job using dorny/paths-filter to analyze file changes
  • Modified test jobs to conditionally run either single-parser or all tests
  • Conservative approach: falls back to full test suite when:
    • Changes touch multiple parsers
    • Changes are in shared utilities or core code
    • Changes are outside parser directories

Test plan

  • CI passes with these workflow changes
  • Verify single-parser detection works correctly
  • Confirm fallback to full tests for multi-parser or shared code changes

Impact

Based on analysis:

  • ~30% of PRs modify only a single parser
  • Single parser tests run in 4-41 seconds vs 5-10 minutes for full suite
  • Expected CI time reduction of 10-30x for qualifying PRs

🤖 Generated with Claude Code

Detect when changes are isolated to a single parser directory and run
only that parser's tests, reducing CI time by 10-30x for ~30% of PRs.
Falls back to running all tests when changes affect multiple parsers
or shared code.

Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
@nathan-stender nathan-stender requested review from a team and slopez-b as code owners March 14, 2026 21:05
- Include test files in parser detection (tests/parsers/**)
- Add SUPPORTED_INSTRUMENT_SOFTWARE.adoc to non-parser filter
- Update detection logic to handle both src and test parser files
- Exclude utils from parser detection in src directory

This ensures the workflow correctly detects single-parser changes
even when test data files are modified alongside parser code.

Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
@nathan-stender nathan-stender changed the title feat: Add single-parser test optimization to CI chore: Add single-parser test optimization to CI Mar 15, 2026
@nathan-stender nathan-stender changed the title chore: Add single-parser test optimization to CI tests: Add single-parser test optimization to CI Mar 15, 2026
- Remove SUPPORTED_INSTRUMENT_SOFTWARE.adoc from non-parser filter
  (it's an output of parser changes, not an input that affects parsers)
- Add test_table_contents validation to single-parser test runs
  to ensure the instrument table is updated when needed

This correctly treats the instrument table as a consequence of parser
changes rather than a trigger for running all tests. Single-parser
test runs now also validate that the table is up-to-date.

Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
@nathan-stender nathan-stender changed the title tests: Add single-parser test optimization to CI test: Add single-parser test optimization to CI Mar 15, 2026
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