Skip to content

test(chaos): add end-to-end induce-to-detect integration test#226

Open
vishalmore90 wants to merge 1 commit into
optiqor:mainfrom
vishalmore90:issue-150
Open

test(chaos): add end-to-end induce-to-detect integration test#226
vishalmore90 wants to merge 1 commit into
optiqor:mainfrom
vishalmore90:issue-150

Conversation

@vishalmore90

Copy link
Copy Markdown
Contributor

Description

The core value proposition of Kerno is the induce-detect-explain loop, yet there was no end-to-end regression test to assert that each chaos scenario actually triggers its expected diagnostic rule.

This PR implements TestChaosDetectionE2E inside internal/chaos/paired_rule_integration_test.go, gated behind the ebpf build tag since it requires a real eBPF build and root privileges to load BPF programs.

Changes

  • internal/chaos/paired_rule_integration_test.go:
    • Dynamic iteration over registered scenarios using chaos.List().
    • Precondition simulation (tc rules for loopback packet loss, virtual cgroups for container memory limit pressure).
    • Startup of live eBPF and procfs collectors (syscall, tcp, oom, disk, sched, fd, memory, cgroup_memory).
    • Bounded background execution of the chaos scenarios alongside diagnostic collection.
    • Evaluation of signals using doctor.Evaluate with test-calibrated thresholds.
    • Assertion of the matching PairedRule() in the doctor findings.

Verification

  • Cross-compiled unit tests and integration tests successfully for Linux:
    GOOS=linux go test -c -tags ebpf ./internal/chaos

… scenarios

Signed-off-by: vishal <httpsvishal07@gmail.com>
@vishalmore90 vishalmore90 requested a review from btwshivam as a code owner June 21, 2026 12:01
@github-actions github-actions Bot added the level:advanced 200+ lines or 6+ files (auto-applied) label Jun 21, 2026
@github-actions

Copy link
Copy Markdown

🚀 First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint + (eventually) the kernel matrix. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(doctor): add new rule or fix(bpf): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

@github-actions github-actions Bot added the testing Tests and test coverage label Jun 21, 2026
@vishalmore90

Copy link
Copy Markdown
Contributor Author

@btwshivam

Could you please take a final look when you have time? If everything looks good, I would appreciate an approval and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced 200+ lines or 6+ files (auto-applied) testing Tests and test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant