Use JUnit 5 in all lighty project and remove TestNG.#2598
Conversation
Summary of ChangesHello, 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 migrates the lighty project from TestNG to JUnit 5 for unit testing. This involves removing TestNG dependencies, adding JUnit 5 dependencies, and updating assertion and test lifecycle annotations in the test code. The goal is to modernize the testing framework and leverage the features offered by JUnit 5. 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. Changelog
Activity
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.
Code Review
This pull request provides a comprehensive migration from TestNG to JUnit 5 across the project. The changes are extensive and well-executed, covering dependency updates, annotation changes, and assertion migrations. I've added a few suggestions for improving test readability and correctness, such as using more specific assertions (assertFalse, assertArrayEquals) and addressing a minor logical flaw in one of the tests. Overall, this is a great step towards modernizing the test suite.
093df73 to
8f22444
Compare
Unify all the lighty tests to depend on junit.jupiter only. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
911e219 to
274184c
Compare
| import org.junit.jupiter.api.Test; | ||
|
|
||
| class SocketAnalyzerTest { | ||
| public class SocketAnalyzerTest { |
There was a problem hiding this comment.
no need to add public modifier
Replace testng dependencies with junit-jupiter to unify the test framework for the entire project. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
With the migration from TestNG to JUnit 5, TestNG suite XML files are no longer supported or required for test discovery. JUnit 5 automatically scans and discovers tests on the classpath. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
bc8385f to
8a64f24
Compare
9781874 to
0da1b37
Compare
Replace all testng and plain junit with junit.jupiter throughout the entire lighty.io project. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Following the migration from TestNG to JUnit 5, integration tests frequently failed with a `TimeoutException` during the Maven build phase. JUnit 5 handles test isolation and static initialization differently than TestNG, leading to higher initial CPU contention, classloading overhead, and garbage collection churn when booting heavy resources like the LightyController, Pekko, and Netty. As a result, the strict 10-second wait time for the server to start was regularly exceeded. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
These tests do not need to be public for JUnit 5. JIRA: LIGHTY-409 Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
No description provided.