Skip to content
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

test:fix WebMvcServiceRegistryAutoConfigurationTest to pass #10

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

liqi19950722
Copy link
Contributor

@liqi19950722 liqi19950722 commented Feb 7, 2024

修复testcase
由于加入spring-cloud和kubernetes-starter依赖,ApplicationContext会创建BootstrapApplicationContext,并且创建kubernetes相关组件(ApiClient CoreApi)时缺少配置,导致报错。
需要禁用下列组件:

  1. @ConditionalOnKubernetesEnabled相关的Bean
  2. KubernetesInformerAutoConfiguration
  3. KubernetesManifestsAutoConfiguration

2和3不禁用test也能跑过,就是会出现error stack

目前通过inline test properties解决

还可以通过bootstrap.yaml解决

spring:
  cloud:
    kubernetes:
      enabled: false
kubernetes:
  informer:
    enabled: false
  manifests:
    enabled: false
  reconciler:
    enable: false

@mercyblitz mercyblitz merged commit e46dca7 into microsphere-projects:main Feb 7, 2024
@liqi19950722 liqi19950722 deleted the fixTestCase branch February 7, 2024 07:09
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.

2 participants