Skip to content

fix(ci): close e2e suite selection gaps in select-e2e and select-install - #4634

Merged
Aleksei Sviridkin (lexfrei) merged 5 commits into
mainfrom
fix/select-e2e-escalation
Oct 1, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 5 commits into
mainfrom
fix/select-e2e-escalation

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

The e2e test selector picked the wrong Chainsaw suites for some diffs. In one case it lost an escalation, in another it ran the full suite where a subset was enough, and in two more it missed a suite or ran nothing. The fixes are in hack/select-e2e.sh, with the .yml part also in hack/select-install.sh.

  • A changed file in a directory under hack/e2e-chainsaw/ that holds no suite escalated only when it was the whole diff. Next to any path that selected a suite, the escalation was dropped with nothing on stderr. The directory name is now checked against the suite list right where the path is classified, like the hack/e2e-apps/ rule already did. The empty-selection backstop can't be reached anymore. I kept it as a guard, and the doc says its line has no test.
  • A seaweedfs change ran the full suite, because cozystack.seaweedfs-application mapped to a seaweedfs suite that does not exist. Now it selects the suites that use tenant-root's object storage: bucket, the backup round-trips that write through the in-cluster seaweedfs-s3 endpoint, and harbor, which keeps its registry in a BucketClaim served by the seaweedfs COSI driver. The issue says this mapping would break the round-trip test. It doesn't, since that test only walks suite to source to suite, and vm-disk-application already maps to vminstance the same way. The test takes the expected set from the suites' own yaml.
  • A suite written as chainsaw-test.yml was invisible to both selectors. Chainsaw v0.2.15 loads that name when there is no chainsaw-test.yaml (pkg/discovery/load.go), so such a suite runs but never gets selected. Both scripts list it now. select-install.sh --validate also passed when find failed, and now it fails.
  • An edit under examples/backups/_lib/ was read as an app named _lib and selected nothing. It escalates now, same as hack/e2e-chainsaw/_lib/.
  • The selector comments quoted bats file counts and escalation-branch counts. All of them were stale, so I removed them. The doc half of select-e2e: the unit-lane bats count in the comment and the doc is wrong, and should be removed rather than fixed #4120 was already fixed on main.

Each fix has a test that fails on main. I also mutated each fix: its own test goes red and no other test does.

Three related gaps outside these lines are tracked in #4630: the packages/core/testing/Makefile comment that names only chainsaw-test.yaml, suites built from numbered step files, and a file placed directly in examples/backups/.

Two things worth knowing before merge:

  • Any file except the .disabled one in a parked suite's directory, like hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml, now always runs the full suite. That is the safe direction. If it gets expensive, those directories could be made inert.
  • The examples/backups/_lib/ rule and its doc line point at a directory another PR adds. If this PR merges first, the rule just has nothing to match yet.

Closes #3816, closes #3710, closes #4283, closes #4120, closes #4205, closes #4626.

Screenshots

Not a UI change.

Downstream repositories

Release note

fix(ci): e2e test selection no longer drops an escalation for a non-suite path under hack/e2e-chainsaw/, selects the suites that use seaweedfs instead of the full run, sees suites written as chainsaw-test.yml, and escalates edits to examples/backups/_lib/.

Summary by CodeRabbit

  • Bug Fixes

    • End-to-end test selection now recognizes suites configured with either supported YAML filename and reports discovery failures instead of silently proceeding.
    • Changes to shared backup walkthrough helpers and unrecognized test-suite directories now trigger broader test coverage.
    • Storage-related changes in SeaweedFS now select all relevant test suites.
  • Documentation

    • Updated testing guidance to describe suite discovery, file-change matching, and when the full test suite is selected.

A path under hack/e2e-chainsaw/<dir>/ put <dir> into the selection
without checking that it is a suite, leaving the final intersection to
drop it. Alone the path escalated through the empty-selection backstop,
but beside any path that contributed a suite the escalation vanished
and the run narrowed to that suite with nothing on stderr. Shared
material next to _lib/ or a suite nested deeper than discovery looks
then went untested in exactly the pull requests that also touch an app.

The directory name is now membership-tested where the path is
classified, as the hack/e2e-apps/ arm already does, so the decision is
a property of the path and names it.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
cozystack.seaweedfs-application mapped to a seaweedfs suite that does
not exist, so every seaweedfs change reached nothing runnable and paid
for the whole Chainsaw run. The suites that can regress from it are
bucket, the backup round-trips that write to the tenant-root instance
through its in-cluster S3 endpoint, and harbor, whose registry storage
is a BucketClaim served by the seaweedfs COSI driver with no graph edge
between the two. bucket alone would miss the CA and service-name paths
the round-trips depend on.

The test derives the expected set from the suites' own yaml, so a new
suite that names the endpoint or a BucketClaim there fails it until it
is mapped.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
Chainsaw loads chainsaw-test.yml when a directory has no
chainsaw-test.yaml, but select-e2e and select-install enumerated the
.yaml name only. A suite spelled that way ran whenever the whole
directory was handed to chainsaw, yet no escalation listed it and no
edit to it could select it, so it silently dropped out of every
narrowed run.

select-install also sent find's errors to /dev/null inside a pipeline
that reported sort's status, so a failed listing validated no suite at
all and passed. It is now captured and fails validation.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
The comments explaining the unit/e2e bats split quoted how many files
each side held, and the escalation helper how many branches call it.
Every figure had gone stale: nothing checks them, and they move each
time a bats file or an escalation is added. The Makefile expression
quoted beside the bats claim is what defines the set, so the
explanation stands without the number.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
examples/backups/<app>/ selects that app's suite, and a directory whose
name is no suite selects nothing. A helpers directory shared by every
walkthrough, examples/backups/_lib/, falls into the second case: an
edit to it alone produces an empty selection, which both lanes read as
"skip Chainsaw", so a change reaching every backup round-trip would run
none.

It now escalates to the full suite like hack/e2e-chainsaw/_lib/. The
set of suites that run a walkthrough is spread across the suites' own
scripts, and a derived subset that misses one would fail open.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
@github-actions github-actions Bot added area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files labels Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cdaebb27-b261-453f-908d-18840d17ac42

📥 Commits

Reviewing files that changed from the base of the PR and between 0592d0e and 08011ce.

📒 Files selected for processing (5)
  • docs/agents/e2e-testing.md
  • hack/select-e2e.sh
  • hack/select-e2e_test.bats
  • hack/select-install.sh
  • hack/select-install_test.bats

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The E2E selectors now discover Chainsaw suites defined with either .yaml or .yml. Path selection handles missing suites, seaweedfs mappings, and shared backup helpers. Install validation reports suite-discovery failures, and tests and documentation cover these changes.

Changes

E2E suite selection

Layer / File(s) Summary
Suite discovery and validation
docs/agents/e2e-testing.md, hack/select-e2e.sh, hack/select-e2e_test.bats, hack/select-install.sh, hack/select-install_test.bats
Both selectors recognize chainsaw-test.yaml and chainsaw-test.yml. Suite names are deduplicated. Install validation reports discovery failures and rejects unmapped suites. Documentation describes the supported filenames and discovery behavior.
Path selection and escalation
hack/select-e2e.sh, hack/select-e2e_test.bats, docs/agents/e2e-testing.md
Seaweedfs changes map to the listed suites. Chainsaw paths select a suite only when it appears in the discovered inventory; otherwise they trigger full-suite escalation. Changes under the shared backup helper path also trigger full-suite escalation. Tests cover these cases and non-suite directories.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 08011

The changes improve suite selection and validation without an identified merge-blocking issue. Merge after normal checks pass.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: fixing E2E suite-selection gaps in both select-e2e and select-install.
Linked Issues check ✅ Passed The PR satisfies the coding requirements for all active linked issues. For [#3816] and [#3710], select-e2e.sh membership-tests each Chainsaw directory against all_apps and escalates before final i…
Out of Scope Changes check ✅ Passed The changed files stay within the linked issue scope. Selector changes implement the requested discovery, escalation, mapping, and validation behavior. Test changes verify each selector behavior. Comm…
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 u…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

LGTM

Closes three real E2E-selector gaps, each pinned by a test that fails without the fix, verified offline by mutation.

What I checked

I ran the bats suites offline, no cluster, and reverted each new guard in turn: every one reddens exactly the test named for it.

  • chainsaw-test.yml discovery. Both selectors now enumerate chainsaw-test.yaml or chainsaw-test.yml, strip either suffix, and sort -u so a directory holding both spellings counts once. A .yml suite that previously ran but was never listed (and so never selected by its own per-suite edit) is now reachable. chainsaw-test.yml.disabled still lands on the .disabled arm and stays inert, and find -name chainsaw-test.yml does not match it.

  • The hack/e2e-chainsaw/*/* arm now membership-tests the derived suite against all_apps on the spot: present selects it, absent escalates with a named reason on stderr. This removes the merge-before-escalate shape (#3330) where a non-suite directory beside a path that contributed a suite narrowed the run silently. Confirmed by mutation: dropping the grep -Fxq sends the path back through the empty-selection backstop, which the rewritten test catches.

  • seaweedfs-application previously mapped to a suite that does not exist, so every seaweedfs change ran the whole suite. The new explicit list narrows that to the suites that actually use the tenant-root instance. I checked the list against the tree, not just against the test: the suites naming seaweedfs-s3 / BucketClaim / objectstorage.k8s.io in their yaml are exactly bucket clickhouse harbor kafka kafka-metadata mariadb mongodb postgres rabbitmq redis. foundationdb carries only an empty, disabled s3: block and etcd names the endpoint in a comment while CI gates its round-trip off, so both are correctly excluded. The self-checking test reddens if the hardcoded list and the yaml-derived set ever drift.

  • select-install.sh discover_suites now captures find's status on its own instead of letting the pipeline report sort's, so a failed listing fails closed in validate mode rather than validating nothing and passing. This only touches the --validate self-check; the closure (install-selection) path reads its suites from arguments and is unchanged, so selection for existing suites is not affected.

Caveats

One non-blocking note, no action required: the seaweedfs derivation sees only yaml-level references, so a suite that reached the instance exclusively through a sourced script would be invisible to both the list and the test. No such suite exists today and the comment already calls this out; worth a glance the next time a backup round-trip is added. Tested against origin/main: the selection scripts, the hack/e2e-chainsaw/ tree and cozytest.sh are unchanged on main since this branch's base, so the full-suite list the tests derive matches and there is no post-base test on main that this branch would fail.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit cdc4b88 into main Oct 1, 2026
20 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/select-e2e-escalation branch October 1, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

2 participants