-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Separate unit and integration tests #4280
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
Conversation
- Use test target only for running integration tests - Use failsafe for running integration tests - Clean up pom.xml
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.
Pull Request Overview
This PR separates unit and integration tests by adding @tag annotations to categorize tests and updating the Maven build configuration to run them separately. The primary goal is to provide better test organization and enable different execution strategies for unit vs integration tests.
- Tests are tagged with appropriate @tag annotations ("integration", "scenario", etc.)
- Maven Surefire/Failsafe plugins are configured to run tagged and filename-based test categorization
- JaCoCo coverage collection is enhanced to track unit and integration test coverage separately
Reviewed Changes
Copilot reviewed 106 out of 106 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
Various test files | Added @tag("integration") annotations to classify integration tests |
pom.xml | Enhanced Maven configuration for separate unit/integration test execution and coverage collection |
.github/workflows/ | Updated CI workflows to use new test execution strategy |
Makefile | Updated commands to use verify instead of test phase |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.Timeout; | ||
import org.junit.jupiter.api.*; |
Copilot
AI
Sep 12, 2025
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.
[nitpick] Using wildcard imports (.*) is generally discouraged as it can lead to namespace pollution and unclear dependencies. Consider importing specific classes instead.
import org.junit.jupiter.api.*; | |
import org.junit.jupiter.api.AfterAll; | |
import org.junit.jupiter.api.BeforeAll; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Tag; | |
import org.junit.jupiter.api.Test; |
Copilot uses AI. Check for mistakes.
<exclude>**/examples/*.java</exclude> | ||
<exclude>**/scenario/*Test.java</exclude> | ||
<!-- Exclude integration tests from unit-test phase --> | ||
<exclude>**/*IntegrationTest.java</exclude> | ||
<exclude>**/*IntegrationTests.java</exclude> |
Copilot
AI
Sep 12, 2025
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 exclusion patterns for integration tests are duplicated between surefire and failsafe plugins. Consider extracting these patterns into properties to maintain consistency and reduce duplication.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Test Results 273 files - 2 1 errors 272 suites - 3 10m 42s ⏱️ -12s For more details on these parsing errors, see this check. Results for commit 7f86964. ± Comparison against base commit b04e64b. ♻️ This comment has been updated with latest results. |
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.
LGTM.
did you check why codeQl fails ? may be we should exclude failsafe-summary
file.
Co-authored-by: atakavci <a_takavci@yahoo.com>
Coverage is merged now and
mvn verify
target should be used to run all tests.