Spring 云合同测试的在线/离线模式问题

Problems with the online / offline mode of the Spring Cloud contract tests

我们在一些项目中使用 Spring 云合同测试,因为它具有很好的功能,我们所有的项目都使用 Spring。然而,这些测试变得非常不稳定,开发人员只是禁用它们,因为即使界面没有任何变化,它们也会破坏构建。

我们在在线模式下为 Jenkins 配置了测试,因此他们可以从 Artifactory 下载存根。然而,测试经常(至少每月两次)崩溃,因为存根已经在存储库中。我们无权访问远程存储库以手动删除存根,因此我们在离线模式下更改 运行 它们的配置。这一直有效,直到提供程序的版本发生变化,因为测试无法在本地找到新版本的存根并且它们再次崩溃,我们再次将它们更改为在线模式。

正如您想象的那样,这并不理想,我们也很担心,因为本地存根可能是当前版本的过时副本,我们不会检测提供程序何时进行重大更改。

是否有更好的方法来配置测试?如果我们可以配置它们,使它们始终下载存根并覆盖本地存根,那就太好了。

重复

我把答案也复制过来:

This problem might (it doesn't always happen) occur in CI systems when you have a shared .m2. In the next release (1.2.x and 2.0.0), thanks to closing of this issue https://github.com/spring-cloud/spring-cloud-contract/issues/545 , you'll be able to pass stubrunner.snapshot-check-skip system property or STUBRUNNER_SNAPSHOT_CHECK_SKIP environment variable or set the plugin property (for 2.0.0 only) to disable the check.