Repository navigation
fix: 修复 TSF header 兼容测试与 polaris-config endpoint 测试的 CI 失败 - #1820
Merged
peerless1024 merged 4 commits intoSep 10, 2026
Merged
Conversation
…er compatible test MetadataLocalPropertiesTsfHeaderCompatibleTest was the only @SpringBootTest in spring-cloud-tencent-commons without an inline web-application-type and gateway auto configuration excludes. Because spring-webmvc and spring-cloud-gateway (webflux) coexist on the test classpath, Boot deduced a servlet context and GatewayClassPathWarningAutoConfiguration aborted startup with MvcFoundOnClasspathException. Align the properties with MetadataLocalPropertiesTest. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Prevent servlet-based SpringBootTest from hitting MvcFoundOnClasspathException, which triggered FailedEventApplicationListener.System.exit(0) and aborted the Surefire fork. Co-authored-by: Cursor <cursoragent@cursor.com>
The module has no Jackson on the test classpath and the project has moved to Jackson 3, so importing com.fasterxml.jackson.databind broke testCompile. Assert on the endpoint map directly instead of serializing it. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2025.1 #1820 +/- ##
============================================
+ Coverage 55.26% 55.83% +0.56%
Complexity 152 152
============================================
Files 487 487
Lines 14286 14461 +175
Branches 1798 1828 +30
============================================
+ Hits 7895 8074 +179
+ Misses 5753 5724 -29
- Partials 638 663 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
peerless1024
deleted the
fix/gateway-classpath-warning-in-tsf-header-test
branch
September 10, 2026 04:00
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.
Summary
DecodeTransferTsfHeaderCompatibleTest(feat: support encoding and decoding TSF headers without TSF Consul #1816 引入)以 servlet 方式启动上下文,但测试 classpath 上同时有spring-cloud-gateway-server-webflux。spring.cloud.gateway.enabled=false关不掉GatewayClassPathWarningAutoConfiguration,会抛出MvcFoundOnClasspathException。上下文失败后FailedEventApplicationListener调用System.exit(0),Surefire 表现为 forked VM 异常退出。已按同类 servlet 测试排除三个 Gateway 自动配置。MetadataLocalPropertiesTsfHeaderCompatibleTest同样缺少 web-application-type 与 Gateway 自动配置排除,已与同目录MetadataLocalPropertiesTest对齐。PolarisConfigEndpointTest仍引用 Jackson 2 的com.fasterxml.jackson.databind.ObjectMapper。2025.1 已切到 Jackson 3,且polaris-config测试 classpath 上没有该依赖,导致testCompile失败。改为直接断言 endpoint 返回的 Map,不再做 JSON 序列化。Test plan
mvn -pl spring-cloud-starter-tencent-metadata-transfer test→ Tests run: 23, Failures: 0mvn -pl spring-cloud-starter-tencent-polaris-config -Dtest=PolarisConfigEndpointTest test→ Tests run: 4, Failures: 0mvn -pl spring-cloud-tencent-commons -Dtest=MetadataLocalPropertiesTsfHeaderCompatibleTest test通过