-
Notifications
You must be signed in to change notification settings - Fork 1k
Add complete test cases for SparkApplication #7087
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
Add complete test cases for SparkApplication #7087
Conversation
Summary of ChangesHello @Abhay349, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the test coverage for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request significantly improves the test coverage for the SparkApplication resource interpreter by adding several new test cases for status aggregation, component interpretation, health checks, and status reflection. The new tests are well-structured and cover important edge cases. I've identified an issue with an incorrect expected memory value in one of the new test files and a minor formatting issue. Overall, this is a valuable contribution.
...izations/sparkoperator.k8s.io/v1beta2/SparkApplication/testdata/interpretcomponent-test.yaml
Outdated
Show resolved
Hide resolved
...izations/sparkoperator.k8s.io/v1beta2/SparkApplication/testdata/interpretcomponent-test.yaml
Outdated
Show resolved
Hide resolved
...izations/sparkoperator.k8s.io/v1beta2/SparkApplication/testdata/interpretcomponent-test.yaml
Outdated
Show resolved
Hide resolved
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7087 +/- ##
==========================================
+ Coverage 46.55% 46.56% +0.01%
==========================================
Files 700 700
Lines 48091 48091
==========================================
+ Hits 22387 22392 +5
+ Misses 24021 24017 -4
+ Partials 1683 1682 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e3886af to
38eee15
Compare
|
Thanks |
|
Hi @FAUST-BENCHOU Would you like to review this PR? |
Sure!let me take a look at relative lua script first. |
|
The core tests are covered, but the boundary case tests are relatively weak. Below are some of my suggestions for improvement (of course, you can extend these suggestions as well). AggregateStatus1.Several status items have missing fields: Some untested items may lack fields such as executionAttempts and submissionAttempts. Lines 302 to 305 in 04aed89
InterpretComponent1.GPU resources related Lines 187 to 194 in 04aed89
2.some default value like executor.instances driver.memory executor.memory......3.Pod template related Lines 84 to 108 in 04aed89
InterpretHealthall in all good.maybe you can also consider scenarios where InterpretStatus (ReflectStatus)good but maybe u can consider that when applicationState, driverInfo, executorState, etc. are nil, a copy will be made. @Abhay349 Thanks for you awesome job! |
|
@XiShanYongYe-Chang This is just my opinion; any feedback is welcome.🙃 |
|
@FAUST-BENCHOU Thanks for review.. |
|
Thanks a lot for the review and suggestions I’ll update the tests accordingly. Thanks again! |
I think we should explicitly test the boundary cases of missing fields, rather than relying solely on default values, to ensure the logic is correct when fields are missing. |
|
Sure, I will fix it shortly.. |
38eee15 to
2f0a1b3
Compare
Signed-off-by: Abhay349 <[email protected]>
2f0a1b3 to
4a02960
Compare
|
hi @FAUST-BENCHOU @XiShanYongYe-Chang, I have added required changes, Thanks |
|
Let's wait for @FAUST-BENCHOU to confirm it again. |
|
@XiShanYongYe-Chang overall great! |
XiShanYongYe-Chang
left a comment
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.
Thanks @Abhay349 @FAUST-BENCHOU
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| state: "" | ||
| operation: InterpretHealth | ||
| output: | ||
| healthy: true |
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.
SparkApplication unhealthy when applicationState.state is empty
why is the output healthy?
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.
According to logic,
empty string "" !="FAILED",so state == "" is treated as healthy
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.
got that,maybe you can change comment to like SparkApplication healthy when applicationState.state is empty
| applicationState: {} | ||
| operation: InterpretStatus | ||
| output: | ||
| status: {} |
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.
The message is "InterpretStatus should copy applicationState even if the state field is missing".but the expected output is: status: {}. This is inconsistent with the description of "copy applicationState" (if it is to be copied, the applicationState field should be included, even if the map is empty).
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.
Apologies for description issue,
"InterpretStatus does not copy applicationState when state field is missing", will it work?
| # case4. SparkApplication with missing attempts fields | ||
| # case5. SparkApplication with missing executorState | ||
| # case6. SparkApplication with missing lastSubmissionAttemptTime | ||
| # case7. SparkApplication with missing terminationTime |
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.
The comments need to be updated; they don't match the test cases.
|
Hi @Abhay349, just as @FAUST-BENCHOU said, some use case descriptions seem to be inconsistent with the content. Could you help revise the descriptions of the use cases? (The test cases themselves are fine.) |
What does this PR do?
This PR adds test cases for
SparkApplication (sparkoperator.k8s.io/v1beta2).