Repository navigation
test(e2e): migrate the E2E app suite from BATS to Kyverno Chainsaw #2979
Copy link
Copy link
Closed
Labels
area/ciIssues or PRs related to CI workflows, GitHub Actions, automationIssues or PRs related to CI workflows, GitHub Actions, automationarea/testingIssues or PRs related to testing (e2e, bats, unit tests)Issues or PRs related to testing (e2e, bats, unit tests)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Description
Goal
Migrate the E2E app test suite from BATS to Kyverno Chainsaw — a declarative, Kubernetes-native E2E framework (CNCF, KUTTL successor) — replacing the per-app BATS loop in hack/e2e-apps/.
Context
This was piloted and grown to the full suite in #2826 (postgres + bucket → all 18 app suites). That PR is being postponed out of the immediate #2397 "move E2E off the PR pipeline" push and tracked here, so the Chainsaw exploration doesn't gate the keystone E2E work. The branch feat/e2e-chainsaw-example stands as the reference implementation.
Why
- Declarative
assertcollapses thetimeout … until kubectl get … && kubectl waitpair (~100 occurrences) into a single existence-and-state poll, with a structured diff and automaticevents/describe/podLogscapture on failure (today onlyharbor.batsdoes this, by hand). - Removes a class of bash-level flakiness; the per-app 3× retry loop goes away (assertion polling replaces the fixed-timeout flakiness it papered over).
- Declarative tests are easier to select per-PR — complements the TIA work in feat(ci): test-impact analysis E2E (default-on) + release E2E workflow #2559 and epic [Epic] Diff-driven & scenario-based E2E testing for Cozystack #2847.
Scope (from the #2826 prototype)
- Port all 18 app suites under
hack/e2e-chainsaw/: postgres, bucket, mariadb, mongodb, redis, qdrant, clickhouse, kafka, etcd, openbao, harbor, foundationdb, external-dns, kuberture, vminstance, gateway, kubernetes-latest, kubernetes-previous. - Keep imperative logic in
scriptsteps (openbaoinit/unseal,kubertureexternal-dns probes,vminstance,gatewayadmission/impersonation,kubernetes-*); reusehack/e2e-chainsaw/_lib/run-kubernetes.shverbatim. - CI: the
e2ejob runschainsaw test hack/e2e-chainsaw/via a newtest-chainsawtarget and uploads the JUnitchainsaw-report.xml; add thechainsawbinary to the e2e-sandbox image.install-cozystackandtest-openapistay BATS.
Open questions / risks to resolve before adopting
- Chainsaw v0.2.15 JMESPath bug: number-literal comparisons (
ports[?port ==+ "N" +]) mis-evaluate; the prototype works around it with the(ports[*].port)projection form. Confirm fixed/tracked upstream before relying on number-literal filters. - TIA integration: how Chainsaw test directories map to
select-e2e.shper-app selection (today keyed onhack/e2e-apps/*.bats). - BATS retirement cadence: dual-run (Chainsaw alongside BATS) vs hard cutover. test(e2e): migrate app suite from BATS to Chainsaw and wire into CI #2826 removes the
.batsfiles outright — decide whether to soak in parallel first. - Soak the three platform-dependent suites (
gateway,kuberture,external-dns) and the two heavyweightkubernetes-*suites on full-platform CI before cutover.
References
- Prototype PR: test(e2e): migrate app suite from BATS to Chainsaw and wire into CI #2826 (
feat/e2e-chainsaw-example) - Related: Move E2E tests out of PR pipeline to release/nightly #2397 (move E2E off PR pipeline), [Epic] Diff-driven & scenario-based E2E testing for Cozystack #2847 (epic: diff-driven & scenario E2E), feat(ci): test-impact analysis E2E (default-on) + release E2E workflow #2559 (TIA)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/ciIssues or PRs related to CI workflows, GitHub Actions, automationIssues or PRs related to CI workflows, GitHub Actions, automationarea/testingIssues or PRs related to testing (e2e, bats, unit tests)Issues or PRs related to testing (e2e, bats, unit tests)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Activity
myasnikovdaniil commentedon Aug 14, 2026
Done in #2826.
hack/e2e-chainsaw/carries 22 app suites on main, 21 enabled plus backup disabled, and bats stays for cluster bootstrap and the OpenAPI checks by design.One thing the migration left behind, worth knowing before this closes:
hack/e2e-apps/still holdsmonitoring-oidc-system.batsandmonitoring-oidc-customconfig.bats, and no Makefile, hack script or workflow invokes either. Their 11 assertions on Grafanaauth.generic_oauth, the per-instance KeycloakClient and KeycloakClientScope, the 32-char client-secret Secret,skip_org_role_syncand the users-Job are the only e2e coverage monitoring OIDC has, and thekubernetes-oidc-*chainsaw suites are the tenant apiserver path, not this one. So that coverage reads as present and runs nowhere. #3453 carries it, and #3778 is the gate that makes this class loud instead of silent.Closing this one.