-
Notifications
You must be signed in to change notification settings - Fork 731
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 missing tests for the CronJob analyzer #1019
test: added missing tests for the CronJob analyzer #1019
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch.
just one question.
i guess comparing failureText can occur unexpected test fail in the future even code is right.
how do you think?
Thanks, Great question. I think you're right, there's a possibility of the failure text changing in the future and when that happens the test will break even though it shouldn't. I've compared failureText in tests for others analyzers as well. Looks like now would be a great time to update them as well. Thought? |
- Fixed a small bug where pre-analysis was incorrectly appended to the results every time at the end of the for loop. This caused the result for a single cronjob failure to be appended multiple times in the final results. - Added missing test cases to ensure proper testing of the CronJob analyzer. The addition of these missing test cases has increased the code coverage of this analyzer to over 96%. Partially Addresses: k8sgpt-ai#889 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
It is possible that the error or failure strings might change in the future, causing the tests to fail. This commit addresses that issue by removing the matching of failure text from various analyzer tests. Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
58a6577
to
f426be7
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1019 +/- ##
==========================================
+ Coverage 65.71% 67.24% +1.53%
==========================================
Files 30 30
Lines 2549 2549
==========================================
+ Hits 1675 1714 +39
+ Misses 827 791 -36
+ Partials 47 44 -3 ☔ View full report in Codecov by Sentry. |
yes. it needs to be. but not urgent. feel free to do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better.
thanks for stable tests.
📑 Description
Fixed a small bug where pre-analysis was incorrectly appended to the results every time at the end of the for loop. This caused the result for a single cronjob failure to be appended multiple times in the final results.
Added missing test cases to ensure proper testing of the CronJob analyzer. The addition of these missing test cases has increased the code coverage of this analyzer to over 96%.
Partially Addresses: #889
✅ Checks