Skip to content

[ZEPPELIN-6281] Add Unit Tests for LivyVersion Class - #5029

Merged
ParkGyeongTae merged 7 commits into
apache:masterfrom
celinayk:ZEPPELIN-6281
Aug 22, 2025
Merged

[ZEPPELIN-6281] Add Unit Tests for LivyVersion Class#5029
ParkGyeongTae merged 7 commits into
apache:masterfrom
celinayk:ZEPPELIN-6281

Conversation

@celinayk

Copy link
Copy Markdown
Contributor

What is this PR for?

This PR adds a comprehensive suite of unit tests for the LivyVersion class. The LivyVersion class is critical for ensuring Zeppelin's compatibility with various versions of the Livy server.

What type of PR is it?

Test

Todos

  • Add LivyVersionTest.java with comprehensive test cases.
  • Ensure all tests pass with the existing LivyVersion implementation.

What is the Jira issue?

ZEPPELIN-6281

How should this be tested?

Screenshots (if appropriate)

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No


import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you update this to avoid the wildcard import and use explicit imports for the Assertions methods being used?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks for pointing that out!! I'll update the code to remove the wildcard and explicitly import only the Assertions methods that are used in the test.

@ParkGyeongTaeParkGyeongTae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make the minor changes I commented on.

@celinayk

Copy link
Copy Markdown
ContributorAuthor

Please make the minor changes I commented on.

Done. Thank you!

@ReamerReamer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a minor thing, everthing else looks good

Comment threadlivy/src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java Outdated
@ReamerReamer self-assigned this Aug 19, 2025
Reamer
Reamer previously approved these changes Aug 20, 2025

@ReamerReamer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Reamer

Copy link
Copy Markdown
Contributor

There are several checkstyle errors.

[INFO] --- checkstyle:3.4.0:check (checkstyle-fail-build) @ zeppelin-livy ---
[INFO] There are 36 errors reported by Checkstyle 9.3 with zeppelin/checkstyle.xml ruleset.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[27,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[29,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[30,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[31,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[32,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[34,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[36,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[37,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[38,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[39,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[41,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[43,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[44,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[45,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[46,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[47,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[48,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[49,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[51,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[53,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[54,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[56,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[57,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[58,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[60,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[62,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[63,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[64,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[66,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[68,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[69,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[70,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[72,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[74,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[75,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[76,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.

@celinayk

Copy link
Copy Markdown
ContributorAuthor

There are several checkstyle errors.

[INFO] --- checkstyle:3.4.0:check (checkstyle-fail-build) @ zeppelin-livy ---
[INFO] There are 36 errors reported by Checkstyle 9.3 with zeppelin/checkstyle.xml ruleset.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[27,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[29,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[30,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[31,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[32,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[34,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[36,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[37,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[38,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[39,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[41,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[43,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[44,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[45,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[46,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[47,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[48,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[49,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[51,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[53,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[54,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[56,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[57,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[58,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[60,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[62,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[63,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[64,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[66,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[68,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[69,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[70,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[72,5] (indentation) Indentation: 'method def modifier' has incorrect indentation level 4, expected level should be 2.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[74,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[75,9] (indentation) Indentation: 'method def' child has incorrect indentation level 8, expected level should be 4.
Error: src/test/java/org/apache/zeppelin/livy/LivyVersionTest.java:[76,5] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 4, expected level should be 2.

Thank you for your feedback !

@ParkGyeongTaeParkGyeongTae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 LGTM

@ParkGyeongTae
ParkGyeongTae merged commit f68d69b into apache:masterAug 22, 2025
28 of 33 checks passed
ParkGyeongTae pushed a commit that referenced this pull request Aug 22, 2025
### What is this PR for?
This PR adds a comprehensive suite of unit tests for the LivyVersion class. The LivyVersion class is critical for ensuring Zeppelin's compatibility with various versions of the Livy server.
### What type of PR is it?
Test
### Todos
* [x] Add LivyVersionTest.java with comprehensive test cases.
* [x] Ensure all tests pass with the existing LivyVersion implementation.
### What is the Jira issue?
[ZEPPELIN-6281](https://issues.apache.org/jira/browse/ZEPPELIN-6281)
### How should this be tested?
### Screenshots (if appropriate)
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Closes#5029 from celinayk/ZEPPELIN-6281.
Signed-off-by: ParkGyeongTae <gyeongtae@apache.org>
@ParkGyeongTae

Copy link
Copy Markdown
Member

Merged into master and branch-0.12

Sign up for freeto 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.

3 participants

@celinayk@Reamer@ParkGyeongTae