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

test: added tests for the log analyzer #1010

Merged
merged 1 commit into from
May 9, 2024

Conversation

VaibhavMalik4187
Copy link
Contributor

📑 Description

  • Added new tests for LogAnalyzer defined in the pkg/analyzer package. Increased the code coverage of the log.go file to >90%

  • Added fake logs string to the errorPattern to enable the discovery of error logs during the tests.

TODO: Find a method to edit logs of the containers defined in the Kubernetes client config.

Partially addresses: #889

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Copy link
Contributor

@JuHyung-Son JuHyung-Son left a comment

Choose a reason for hiding this comment

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

good work! i commented two questions

pkg/analyzer/log_test.go Show resolved Hide resolved
pkg/analyzer/log_test.go Show resolved Hide resolved
@VaibhavMalik4187 VaibhavMalik4187 marked this pull request as draft March 14, 2024 18:14
@VaibhavMalik4187 VaibhavMalik4187 marked this pull request as ready for review March 16, 2024 18:36
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.63%. Comparing base (85a76a3) to head (f21c669).
Report is 22 commits behind head on main.

❗ Current head f21c669 differs from pull request most recent head b2da8f6. Consider uploading reports for the commit b2da8f6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   69.12%   69.63%   +0.51%     
==========================================
  Files          30       30              
  Lines        2552     2549       -3     
==========================================
+ Hits         1764     1775      +11     
+ Misses        746      727      -19     
- Partials       42       47       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

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

I am okay with this as a first pass

* Added new tests for `LogAnalyzer` defined in the `pkg/analyzer`
  package. Increased the code coverage of the `log.go` file to >90%

Partially addresses: k8sgpt-ai#889

Signed-off-by: VaibhavMalik4187 <[email protected]>
@VaibhavMalik4187
Copy link
Contributor Author

I am okay with this as a first pass

Thanks, I've rebased this branch to include the latest changes.

@AlexsJones AlexsJones merged commit 2c7c744 into k8sgpt-ai:main May 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants