Skip to content

fix: 修复 TSF header 兼容测试与 polaris-config endpoint 测试的 CI 失败 - #1820

Merged
peerless1024 merged 4 commits into
2025.1from
fix/gateway-classpath-warning-in-tsf-header-test
Sep 10, 2026
Merged

peerless1024 merged 4 commits into
2025.1from
fix/gateway-classpath-warning-in-tsf-header-test

Conversation

@peerless1024

@peerless1024 peerless1024 commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

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 序列化。
  • 仅改测试与 CHANGELOG,无生产代码变更。

Test plan

  • mvn -pl spring-cloud-starter-tencent-metadata-transfer test → Tests run: 23, Failures: 0
  • mvn -pl spring-cloud-starter-tencent-polaris-config -Dtest=PolarisConfigEndpointTest test → Tests run: 4, Failures: 0
  • mvn -pl spring-cloud-tencent-commons -Dtest=MetadataLocalPropertiesTsfHeaderCompatibleTest test 通过
  • CI:junit 17/21/25 × ubuntu + windows、license、CodeCC、codecov 全部通过

evelynwei and others added 2 commits September 9, 2026 17:45
…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>
evelynwei and others added 2 commits September 10, 2026 10:57
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

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.83%. Comparing base (4b631dc) to head (1d7cf36).
⚠️ Report is 2 commits behind head on 2025.1.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peerless1024 peerless1024 changed the title fix: 排除 TSF header 兼容测试中的 Gateway classpath 警告自动配置 fix: 修复 TSF header 兼容测试与 polaris-config endpoint 测试的 CI 失败 Sep 10, 2026

@SkyeBeFreeman SkyeBeFreeman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@fuyuwei01 fuyuwei01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peerless1024
peerless1024 merged commit c581e9d into 2025.1 Sep 10, 2026
11 checks passed
@peerless1024
peerless1024 deleted the fix/gateway-classpath-warning-in-tsf-header-test branch September 10, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants