-
Notifications
You must be signed in to change notification settings - Fork 8.9k
test: Add common test config for dynamic server port assignment in tests #7435
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
Signed-off-by: yongjunhong <[email protected]>
6dc179a to
c46d7db
Compare
Signed-off-by: yongjunhong <[email protected]>
4f24cf4 to
8660d13
Compare
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
1a0bee0 to
76b4d2b
Compare
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7435 +/- ##
============================================
- Coverage 58.62% 58.32% -0.30%
- Complexity 571 575 +4
============================================
Files 1269 1269
Lines 45730 45774 +44
Branches 5548 5555 +7
============================================
- Hits 26807 26698 -109
- Misses 16344 16508 +164
+ Partials 2579 2568 -11 🚀 New features to boost your workflow:
|
Signed-off-by: yongjunhong <[email protected]>
Signed-off-by: yongjunhong <[email protected]>
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 adds a common test configuration enabling dynamic server port assignment in tests, ensuring that tests run on available ports instead of hard-coded ones. The key changes include:
- Incorporation of a new DynamicPortTestConfig class to dynamically allocate ports.
- Updates across multiple test files to import and use the DynamicPortTestConfig via @import annotations.
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/test/java/org/apache/seata/server/raft/execute/GlobalSessionExecuteTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/raft/execute/BranchSessionExecuteTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/raft/RaftSyncMessageTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/raft/RaftServerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/logging/AppenderTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/redis/RedisLuaLockManagerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/redis/RedisLockManagerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/file/FileLockManagerImplTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/db/DataBaseLockStoreDAOTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/db/DataBaseLockManagerImplTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/lock/DistributedLockerFactoryTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/event/DefaultCoreForEventBusTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/coordinator/DefaultCoreTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/coordinator/DefaultCoordinatorTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/controller/VGroupMappingControllerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/controller/ClusterControllerTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration; also commented out the TestPropertySource annotation. |
| server/src/test/java/org/apache/seata/server/ParameterParserTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/LoaderConfTest.java | Added import and @import(DynamicPortTestConfig.class) for dynamic port configuration. |
| server/src/test/java/org/apache/seata/server/DynamicPortTestConfig.java | New file providing dynamic port assignment for tests. |
xingfudeshi
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.
LGTM
Signed-off-by: yongjunhong <[email protected]>
|
funky-eyes
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.
LGTM
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews