Skip to content
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

Fix Unit Tests Failing in Pypanther #1335

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

ben-githubs
Copy link
Contributor

Background

pypanther's testing suite always runs the auxiliiary functions (title, dedup, alert_context, etc.) regardless of whether the unit test is expected to return True or False. This is different from PAT's behaviour, where those functions only run when the unit test has ExpectedResult=True. Due to this expectation, some rules have auxilliary functions designed in a way where they don't execute properly for all test logs. This PR addresses the problem with 2 of our rules.

Changes

  • Added logic to 2 rules to ensure they don't raise exceptions when processing log events for all tests

Testing

  • Confirmed that ALL tests pass when using both PAT and pypanther

@ben-githubs ben-githubs requested a review from a team as a code owner August 22, 2024 19:21
Copy link

😱
looks like some things could be wrong with the packs

[INFO][root]: ignoring file dependabot.yml

Copy link
Contributor

@arielkr256 arielkr256 left a comment

Choose a reason for hiding this comment

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

LGTM!

@arielkr256 arielkr256 merged commit 04187a0 into release Aug 22, 2024
6 checks passed
@arielkr256 arielkr256 deleted the THREAT-378/fix-failing-pypanther-tests branch August 22, 2024 19:25
@arielkr256 arielkr256 added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants