Repository navigation
fix(e2e): improve failure diagnostics - #3421
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThe PR updates dataplane capture handling for scheduled NotReady pods, centralizes Talos diagnostics collection with regression tests, changes pre-commit locking to use the Git common directory, and sets YAML output for two Chainsaw Bucket retrieval steps. ChangesDataplane capture handling
Talos diagnostics collection
Workflow support updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant kubectl
participant pod_filter_affected
participant dataplane_capture
participant LoadBalancer_checks
kubectl->>pod_filter_affected: provide pod status rows
pod_filter_affected->>dataplane_capture: return scheduled NotReady pods
dataplane_capture->>LoadBalancer_checks: continue when no affected pods
sequenceDiagram
participant cozyreport.sh
participant cozyreport_collect_talos_node
participant talosctl
cozyreport.sh->>cozyreport_collect_talos_node: pass config, node, and output directory
cozyreport_collect_talos_node->>talosctl: collect dmesg and service logs
talosctl-->>cozyreport_collect_talos_node: write diagnostic output
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).pre-commit-config.yamlTraceback (most recent call last): hack/e2e-chainsaw/bucket/chainsaw-test.yamlTraceback (most recent call last): hack/e2e-chainsaw/harbor/chainsaw-test.yamlTraceback (most recent call last): 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 |
Assisted-By: GPT-5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-By: GPT-5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-By: GPT-5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-By: GPT-5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
b11e870 to
6a41d65
Compare
IvanHunters
left a comment
There was a problem hiding this comment.
Verdict
LGTM with non-blocking notes
Diagnostics/CI-only change (no packages/ touched); the three new behavior tests are non-vacuous and pass under the CI dash path, the shell is portable, and the pre-commit worktree fix is behavior-preserving. Two minor items could not be verified offline and are noted below.
Caveats
-
Phase 5b/5c (upgrade + fresh-install / config-matrix): not applicable. The PR touches only
hack/*diagnostics +hack/e2e-chainsaw/*test manifests +.pre-commit-config.yaml; no chart,values.yaml, migration, CRD, RBAC, PackageSource, bundle, or ApplicationDefinition. No customer upgrade or install surface is affected. -
Shell portability (dash vs ash vs bash): verified, no defect.
hack/cozyreport.shandhack/e2e-capture-dataplane.share#!/bin/sh, contain no bashisms (grep forset -o pipefail/[[/arrays/local/<<</${x,,}returned only comment-text false hits), passdash -n, and both new bats suites run green when driven throughhack/cozytest.shunder/bin/sh=dash (the CI runner path). The sourcing guards (return 0 2>/dev/nullincozyreport.sh:16-18of the diff;E2E_CAPTURE_DATAPLANE_LIBguard athack/e2e-capture-dataplane.sh:219) behave correctly: the guard variable is a non-exported shell var, so the subprocess-invoked full-script test (capture-dataplane.bats:66-84) is not short-circuited by it. -
cozytest.sh hook fidelity: verified, no dead code. Neither new
.batsfile definessetup/teardown/setup_file/teardown_file(those are silently never run byhack/cozytest.sh). The top-leveltalosctl()mock inhack/cozyreport-talos.bats:14-16is correctly placed at file scope, not nested in the@test, matching the runner's bare-}block-terminator constraint documented in its comment (hack/cozyreport-talos.bats:12-13); the test passes, confirming the mock is in scope at call time. -
Test adequacy (Phase 5d): required regression tests present and non-vacuous, verified by mutation. Reverting
pod_filter_affectedto require a podIP ($3!="") turnscapture-dataplane.bats:45RED; revertingcozyreport_collect_talos_nodeto the old-n-only +dmesg --tail=200shape turnscozyreport-talos.bats:18RED; re-adding the pre-fix earlyexit 0on emptyaffectedturns the LB-independence testcapture-dataplane.bats:66RED. All three mutations produced the expected failure; the fixes are protected. -
hack/e2e-chainsaw/{bucket,harbor}/chainsaw-test.yamlformat: yamlon thegetcollector: not offline-schema-validated (no chainsaw binary in the hermetic environment). Low risk:.chainsaw.yaml:195already usesformat: XML, soformatis a known field in this tree, and the PR body'schainsaw test --no-cluster --include-test-regex '^$'run exercises manifest parsing. An operator running the chainsaw suite on a dev cluster confirms it live. -
.pre-commit-config.yamlworktree lock fix (sh -c 'exec flock -x "$(git rev-parse --git-common-dir)/pre-commit.lock" "$@"' -- sh -c '...'): traced the argv wrapping —"$@"resolves tosh -c '<inner>' <appended-files>, soflockacquires the shared lock then execs the inner generator; appended filenames land as ignored positionals exactly as in the pre-change form. Behavior-preserving except for the intended common-dir path. Confirmedgit rev-parse --git-common-dirreturns.gitin a normal checkout (identical to the old literal). No automated regression test accompanies this (inherent to a pre-commit entry); manual trace only.
VerdictLGTM with non-blocking notes Diagnostics/CI-only change (no Caveats
|
What this PR does
Improves E2E failure diagnostics tracked in #3368:
Tenant-worker Talos logs remain outside this PR because the runner does not currently have a tenant talosconfig.
Part of #3368.
Testing
hack/cozytest.sh hack/capture-dataplane.batshack/cozytest.sh hack/cozyreport-talos.batssh -n hack/e2e-capture-dataplane.shsh -n hack/cozyreport.shchainsaw test --no-cluster --config hack/e2e-chainsaw/.chainsaw.yaml --include-test-regex '^$' hack/e2e-chainsaw/bucket hack/e2e-chainsaw/harborpre-commit run --all-filesScreenshots
Not applicable.
Downstream repositories
Release note
Summary by CodeRabbit
Bug Fixes
Tests