fix(channel): 修复发布构建中的测试跳过冲突 - #4112
Merged
Merged
Conversation
🤖 Augment PR Summary总结:将 Channel 模块 Surefire 的 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
🟢 Approval recommended
变更范围小且与仓库内其他模块(如 miniapp)已采用的 Surefire 跳过配置保持一致,能直接解决发布构建中的确定性失败场景。
Pull request overview
该 PR 聚焦修复 weixin-java-channel 模块在发布构建中使用 -Dmaven.test.skip=true 时的测试跳过行为冲突:此前 Surefire 被强制 <skip>false</skip>,会在测试未编译的情况下仍尝试执行 TestNG suite,导致类找不到的问题。改动使该模块与发布工作流的测试跳过语义保持一致,同时不影响默认情况下按 suite 运行测试。
Changes:
- 将
weixin-java-channel的maven-surefire-plugin配置从硬编码skip=false调整为读取${maven.test.skip}。 - 使
-Dmaven.test.skip=true能同时一致跳过测试编译与执行,避免发布流程中 TestNG suite 触发类缺失错误。
File summaries
| File | Description |
|---|---|
| weixin-java-channel/pom.xml | 将 Surefire 的 skip 改为读取 ${maven.test.skip},修复发布构建测试跳过语义不一致导致的 suite 执行失败 |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
发布工作流使用
-Dmaven.test.skip=true跳过测试编译,但 channel 模块固定 Surefire 的<skip>false</skip>,导致 TestNG 执行 suite 时找不到未编译的WxChannelProductManagementServiceImplTest。修复
让 Surefire 的
skip读取${maven.test.skip},使发布流程一致跳过测试编译与执行;常规构建仍运行对应 TestNG suite。验证
mvn -pl weixin-java-channel clean test -Dmaven.test.skip=true -Dgpg.skip=true --no-transfer-progressmvn -pl weixin-java-channel -am clean test -Dgpg.skip=true --no-transfer-progress(56 tests, 0 failures)