Skip to content

Commit 0c5fd3d

Browse files
author
ABW
committed
fix CI classification of changes - change in sources of unit tests must trigger rebuild
1 parent f4d2748 commit 0c5fd3d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,19 +393,22 @@ The CI automatically optimizes pipeline execution based on what files changed. T
393393
| Changed Files | Build Jobs | Test Jobs | Notes |
394394
|--------------|------------|-----------|-------|
395395
| `doc/**`, `*.md` only | Skipped | Skipped | Docs-only changes |
396-
| `tests/**` only | Skipped | Run | Uses cached binaries via `quick_test_setup` |
396+
| `tests/python/**`, `tests/integration/**` only | Skipped | Run | Uses cached binaries via `quick_test_setup` |
397+
| `tests/unit/**` (any) | Run | Run | C++ sources compiled into `chain_test` — treated as source change |
397398
| `libraries/**`, `programs/**` | Run | Run | Source code changes |
398399
| `scripts/**`, `.gitlab-ci.yaml` | Run | Run | CI/scripts changes |
399400

400401
**How test-only optimization works:**
401402
1. `detect_changes` job analyzes what files changed
402-
2. If only `tests/**` changed (no source code):
403+
2. If only non-compiled test files changed (e.g., `tests/python/**`, `tests/integration/**`) and no source code:
403404
- Queries registry API to verify cached binaries exist
404405
- If cache exists: sets `TESTS_ONLY=true`, skips builds
405406
- If no cache: runs full build (self-healing fallback)
406407
3. `quick_test_setup` fetches cached binaries when `TESTS_ONLY=true`
407408
4. Test jobs run using the cached binaries
408409

410+
Note: changes under `tests/unit/**` are deliberately classified as source changes because those `.cpp` files are compiled into the `chain_test` binary — skipping the build would run tests against a stale binary.
411+
409412
**Override variables:**
410413
- `FORCE_FULL_PIPELINE=true` - Run all jobs regardless of changes
411414
- `QUICK_TEST=true` - Skip builds, use cached binaries (manual mode)

scripts/ci-helpers/skip_rules.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ variables:
8282
if echo "$CHANGED_FILES" | grep -qE "$SOURCE_PATTERN"; then
8383
SOURCE_CHANGED="true"
8484
fi
85+
# tests/unit/ contains C++ sources compiled into the chain_test binary,
86+
# so changes there require rebuilding even though they live under tests/.
87+
# Kept here rather than in source-patterns.sh because downstream consumers
88+
# of that file (hived image lookup, clive) do not care about chain_test.
89+
if echo "$CHANGED_FILES" | grep -qE '^tests/unit/'; then
90+
SOURCE_CHANGED="true"
91+
fi
8592
8693
# Check if tests changed
8794
TESTS_CHANGED="false"

0 commit comments

Comments
 (0)