Skip to content

tests: move Test_TraceeCapture from integration to e2e tests#5212

Draft
yanivagman wants to merge 1 commit intomainfrom
cursor/kernel-6-8-ebpf-load-6f65
Draft

tests: move Test_TraceeCapture from integration to e2e tests#5212
yanivagman wants to merge 1 commit intomainfrom
cursor/kernel-6-8-ebpf-load-6f65

Conversation

@yanivagman
Copy link
Copy Markdown
Collaborator

1. Explain what the PR does

Fixes #5187.
This PR addresses the miscategorization of Test_TraceeCapture by moving it from tests/integration to a new tests/e2e-capture directory. The test is an end-to-end test, as it uses testutils.NewRunningTracee to run Tracee as an external binary, unlike true integration tests that run Tracee in-process.

Changes include:

  • Moved capture_test.go to tests/e2e-capture/ and updated its package.
  • Created tests/e2e-capture-test.sh to execute these new e2e capture tests.
  • Updated .github/actions/run-e2e-tests/action.yaml to include the capture test in the CI workflow.

2. Explain how to test it

To test the e2e capture tests locally:

sudo ./tests/e2e-capture-test.sh

Look for "E2E CAPTURE TESTS PASSED" or "E2E CAPTURE TESTS FAILED" in the output. Note that the test is currently skipped due to known BPF file capture bugs (see issue #5171).

3. Other comments

The Test_TraceeCapture is currently skipped due to known BPF file capture bugs, as detailed in #5171. Once #5171 is resolved, the skip can be removed, and this test will run as part of the e2e test suite.


Open in Cursor Open in Web

This change addresses issue #5187 by refactoring the capture test from
integration tests to the e2e test framework.

The Test_TraceeCapture test uses testutils.NewRunningTracee which runs
tracee as an external binary (dist/tracee). This pattern is consistent
with e2e tests, not integration tests which run tracee in-process using
testutils.StartTracee.

Changes:
- Move capture_test.go from tests/integration/ to tests/e2e-capture/
- Create e2e-capture-test.sh script to run the capture tests
- Update run-e2e-tests GitHub action to include capture tests
- Update failed test detection logic to include capture test failures

The test is currently skipped due to known file capture bugs on certain
architectures (see issue #5171). Once those bugs are fixed, the test
will run as part of the e2e test suite.

Fixes: #5187

Co-authored-by: yaniv <yaniv@aquasec.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Jan 22, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yanivagman
Copy link
Copy Markdown
Collaborator Author

@cursoragent please review

@cursor
Copy link
Copy Markdown

cursor bot commented Jan 22, 2026

PR Review: tests: move Test_TraceeCapture from integration to e2e tests

Overall Assessment: Looks Good

The PR correctly addresses issue #5187 by moving Test_TraceeCapture from integration tests to the e2e test framework. The rationale is sound: the test uses testutils.NewRunningTracee (external binary) rather than testutils.StartTracee (in-process), making it an e2e test by nature.


Review Details

1. tests/e2e-capture/capture_test.go

Strengths:

  • Package correctly renamed from integration to e2ecapture
  • busyboxImage constant properly defined locally (since it's no longer sharing common_test.go)
  • All imports and functionality preserved correctly
  • Clear TODO comment explaining why the test is currently skipped with reference to issue Test_TraceeCapture fails on 6.12 #5171

No issues found.


2. tests/e2e-capture-test.sh

Strengths:

  • Follows the Bash style guide (#!/bin/bash, set -euo pipefail)
  • Properly sources the project's lib.sh for consistent logging functions
  • Good pre-flight checks (root privileges, tracee directory, binary existence)
  • Auto-builds tracee if not found
  • Appropriate kernel version check matching other e2e tests
  • Uses correct Go test flags (-tags ebpf, -p 1, -count=1, -race, -v)

Minor suggestion (non-blocking): The GO_ENV_EBPF variable is set but never used. You could either remove it or use it when invoking go test. However, this doesn't affect functionality since the test will work without it.


3. .github/actions/run-e2e-tests/action.yaml

Strengths:

  • Capture test step properly added in the correct position (after kernel test)
  • Log file naming consistent with other tests (/tmp/e2e-capture-test.log)
  • Failure detection condition correctly updated to include e2e-capture-test
  • Failed test name output properly added for artifact naming

No issues found.


Summary

File Status
tests/e2e-capture/capture_test.go ✓ Good
tests/e2e-capture-test.sh ✓ Good
.github/actions/run-e2e-tests/action.yaml ✓ Good
tests/integration/capture_test.go (deleted) ✓ Correct

Recommendation

Approve - The changes are well-structured and correctly move the capture test to the e2e framework where it belongs. The test is currently skipped due to known bugs (#5171), so there's no risk of CI failures once this is merged.

Open in Cursor Open in Web

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.44%. Comparing base (235daa0) to head (36c03e5).
⚠️ Report is 192 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5212      +/-   ##
==========================================
+ Coverage   33.51%   35.44%   +1.93%     
==========================================
  Files         250      239      -11     
  Lines       28908    31474    +2566     
==========================================
+ Hits         9688    11157    +1469     
- Misses      18609    19603     +994     
- Partials      611      714     +103     
Flag Coverage Δ
unit 35.44% <ø> (+1.93%) ⬆️
see 101 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yanivagman yanivagman changed the title Kernel 6.8 ebpf load tests: move Test_TraceeCapture from integration to e2e tests Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test_TraceeCapture should be refactored or moved to e2e

3 participants