Repository navigation
fix(ci): close three blind spots in the e2e test selectors - #4658
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: cozystack/cozystack/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe E2E selectors now discover Chainsaw suites from manifests and numbered step files at any depth. The E2E selector also escalates loose files under ChangesE2E selector coverage
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The selectors broaden coverage for nested and step-only suites and escalate loose backup changes while leaving Markdown inert. No merge-blocking issue is established; merge after normal checks pass. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0853a14 to
9e777b3
Compare
With no chainsaw-test.* in a directory, Chainsaw v0.2.15 builds a Test from files named like 01-install.yaml. Such a directory runs whenever the whole tree is handed to chainsaw, but neither selector listed it, so no escalation carried it and no edit to it could select it. Both scripts now derive the suite list from the file names Chainsaw itself accepts. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
A file beside the per-app backup directories rather than inside one belongs to no single walkthrough, but it matched neither backup rule and fell to examples/ in the inert list, so an edit to it selected nothing and both lanes skipped Chainsaw. It is now treated as shared by all of them and escalates the same way examples/backups/_lib/ does. README.md there stays inert through the *.md rule. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
9e777b3 to
370f784
Compare
Chainsaw walks every subdirectory of the path it is handed, and the runner hands it each top-level directory under hack/e2e-chainsaw/, so a test in <dir>/<sub>/ runs as part of <dir>. Both selectors read only one level down, so a directory whose tests all sit deeper was never listed: no selection named it, the full-suite list left it out too, and only a run with no selection at all executed it. Both scripts now take the top-level directory of a test file found in that directory or anywhere below it. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
The test-chainsaw comment said Chainsaw discovers every chainsaw-test.yaml. It also loads chainsaw-test.yml, builds a test from numbered step files, and walks subdirectories. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
370f784 to
0bd4c2b
Compare
Chainsaw builds step files only from directory entries that are not directories, so a directory named like 01-x.yaml makes nothing a suite. Both selectors listed it as one, and select-install demanded a mapping for it. A symlink still counts, as it does for Chainsaw. A directory named chainsaw-test.yaml keeps its suite listed: Chainsaw reads that name whatever its type and fails loudly on a directory, and an unlisted suite would hide that failure. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
0bd4c2b to
5fde704
Compare
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM. Careful fix, and I checked the central claim against the real tree instead of taking it on trust.
I ran the suite enumeration under hack/e2e-chainsaw/ on both the old and the new pattern. Both produce the same 23 suites, so "today's suite list stays the same" holds. The two parked suites (backup/ and kubernetes-proxmox/, both chainsaw-test.yaml.disabled) stay out as they should: the $-anchored \.ya?ml in the sed drops .disabled, and kubernetes-proxmox/tenant.yaml doesn't bring the suite back because it has no leading-number step shape. _lib/ has no numbered yaml, so it never shows up as a spurious suite.
Three things I confirmed, since these are the usual ways a selector regresses without anyone noticing:
- The
\( ! -type d -o -name chainsaw-test.yaml -o -name chainsaw-test.yml \)predicate is a broad OR. It emits almost everything and leaves the real filtering to the sed, so it is not an inverted filter that silently matches nothing. The bias is toward over-selecting, which is the safe direction for a test selector. - Ordering holds. The
*.md/docs/drop runs before thecaseblock, soexamples/backups/README.mdstays inert, andexamples/backups/*/*takes nested per-app paths before the new looseexamples/backups/*arm, so the escalation doesn't swallow per-app selection. hack/select-install.shmirrors the same discovery. Thecd "$1"is scoped to the command-substitution subshell, and|| return 1keeps a failedfinddistinct from an empty result.
Tests pass locally (the new step-file, nested, and loose-backup cases in both bats files), and CI is green on the head.
Non-blocking, and you flagged all three in the PR body yourself:
full_suite_list()inhack/select-e2e_test.bats:32repeats the selector's ownfind/sed, so a bug in that shared pattern would slip through every full-suite assertion. Contained, since the step-file and nested cases assert against literal lists. [NIT]- The selector runs a touch wider than Chainsaw: a broken
chainsaw-test.y*mlsymlink or a Test-less suite still lists its directory. That errs toward running more. [NIT] - A few test comments still describe the old behaviour rather than the rule. [NIT]
What this PR does
The e2e selectors miss Chainsaw suites that have no
chainsaw-test.yamlor.ymldirectly in their directory. Chainsaw v0.2.15 also runs a directory that holds only numbered step files such as01-install.yaml, and its discovery walks every subdirectory of the path the runner hands it. A suite in either layout ran only when nothing was selected. No narrowed selection named it, the full-suite list left it out, andselect-install.sh --validatenever asked for its mapping. Nowhack/select-e2e.shandhack/select-install.shlist a top-level directory as a suite when Chainsaw would load a test from it or from anywhere below it. No suite in the current tree uses either layout, so today's suite list stays the same.A file placed directly in
examples/backups/(a sharedcommon.sh, for example) selected nothing, because it fell through to the inertexamples/rule. It now escalates to the full suite, same asexamples/backups/_lib/.README.mdthere stays inert through the*.mdrule.The
test-chainsawcomment inpackages/core/testing/Makefilesaid Chainsaw discovers everychainsaw-test.yaml, which was too narrow. I fixed it, and the matching sentences indocs/agents/e2e-testing.mdtoo.Every behaviour change has a bats test that fails against the scripts on main.
Known gaps I left for a follow-up, none of them a wrong answer today:
full_suite_listhelper inhack/select-e2e_test.batsrepeats the selector'sfind/sed, so a bug in that shared pattern would pass every full-suite assertion. The step-file and nested tests compare against literal lists, which covers the new layouts.chainsaw-test.y*mlsymlink, or one with no Test in it, still lists its suite. That errs toward running more.Closes #4630
Screenshots
Downstream repositories
Release note
Summary by CodeRabbit
examples/backups/trigger full-suite selection.