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

[TT-1144] add log verifier tests #949

Merged
merged 2 commits into from
May 13, 2024
Merged

[TT-1144] add log verifier tests #949

merged 2 commits into from
May 13, 2024

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented May 13, 2024

because why not?


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

This change introduces a new test suite for verifying log file behaviors under various conditions, ensuring robust logging functionality. It tests different scenarios including no logs, logs below a specified threshold level, allowed messages, and exceeding failure thresholds.

What

  • testreporters/reporter_model_test.go: New file added.
    • Adds a comprehensive test suite TestVerifyLogFile with multiple test cases to validate log file analysis functionality.
      • Tests range from no logs present, log levels below and above certain thresholds, handling of allowed messages, and verifying behavior when failure thresholds are met or exceeded.
      • Utilizes require assertions to validate expectations, ensuring the log file verification logic performs correctly under different scenarios.
      • Temporary files are used to simulate log files for testing, with checks for error handling and content verification.
      • Scenarios include checking for no errors when expected, correct error messages for various log levels and conditions, and the handling of allowed messages that should prevent logging errors under specific conditions.

@cl-sonarqube-production
Copy link

@Tofel Tofel marked this pull request as ready for review May 13, 2024 08:57
@Tofel Tofel requested review from sebawo and a team as code owners May 13, 2024 08:57
@Tofel Tofel merged commit 3dfcbf7 into main May 13, 2024
17 of 18 checks passed
@Tofel Tofel deleted the tt_1144_log_verifier_tests branch May 13, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants