8000 Fix Integration Tests by geyslan · Pull Request #4157 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix Integration Tests #4157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 28, 2024
Merged

Fix Integration Tests #4157

merged 3 commits into from
Jun 28, 2024

Conversation

geyslan
Copy link
Member
@geyslan geyslan commented Jun 26, 2024

Close: #4156

1. Explain what the PR does

74bfd7d fix(tests): refactor Test_TraceeCapture
4e1f899 fix(tests): Test_EventsDependencies
f493e28 chore: turn logger thread-safe

74bfd7d fix(tests): refactor Test_TraceeCapture

This test was failing when other tests were run before it and failed,
tracee running was not stopped and some garbage was left in the system.

Two major changes were made:

1. Do not fail the test before stopping tracee.
2. Always remove capture files after the test (do cleanup).

4e1f899 fix(tests): Test_EventsDependencies

Test_EventsDependencies overrides the default logger to capture the logs
and check them as part of the test.

Before it was synced to pass in the github actions, what wasn't
happening locally or in a different environment.

Since the logger was not thread safe, it was causing the test to fail
(data race). That forced the previous commit which turned Logger into a
thread safe logger.

This fixes the problem refactoring it to override and restore the logger
in the correct steps.

2. Explain how to test it

3. Other comments

@geyslan geyslan self-assigned this Jun 26, 2024
@geyslan geyslan force-pushed the 4156-fix-int-tests branch 2 times, most recently from fc00c99 to b22f771 Compare June 27, 2024 17:04
@geyslan geyslan marked this pull request as ready for review June 27, 2024 18:06
geyslan added 2 commits June 27, 2024 15:17
Test_EventsDependencies overrides the default logger to capture the logs
and check them as part of the test.

Before it was synced to pass in the github actions, what wasn't
happening locally or in a different environment.

Since the logger was not thread safe, it was causing the test to fail
(data race). That forced the previous commit which turned Logger into a
thread safe logger.

This fixes the problem refactoring it to override and restore the logger
in the correct steps.
This test was failing when other tests were run before it and failed,
tracee running was not stopped and some garbage was left in the system.

Two major changes were made:

1. Do not fail the test before stopping tracee.
2. Always remove capture files after the test (do cleanup).
@geyslan geyslan force-pushed the 4156-fix-int-tests branch from b22f771 to 74bfd7d Compare June 27, 2024 18:18
Copy link
Collaborator
@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

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

LGTM

@geyslan geyslan merged commit ee4376d into aquasecurity:main Jun 28, 2024
32 checks passed
@geyslan geyslan deleted the 4156-fix-int-tests branch June 28, 2024 18:27
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.

Integration Tests failing
2 participants
0