简体   繁体   English

mvn clean install对于我的春季云合同消费者测试是成功的,但是当我手动运行测试时,它们失败了吗?

[英]mvn clean install is SUCCESS for my spring-cloud-contract consumer tests, but when I run the tests manually they are FAILING?

I have the spring-cloud-contract tests projects in place where I am doing a consumer-driven contract testing. 我在进行消费者驱动的合同测试的地方有“春季云合同测试”项目。 Instead of going through the code, I just have technical question. 我只需要解决技术问题,而不是遍历代码。 I have written my consumer test cases in a separate consumer side application which will talk to the producer stub jar. 我已经在一个单独的用户端应用程序中编写了我的用户测试用例,该应用程序将与生产者存根罐进行对话。 Everything goes fine, as the test pass if nothing changes in contract and fails when something in contract changes and not updated properly. 一切顺利,如果合同中没有任何变化,则测试通过;如果合同中的某些内容发生变化且未正确更新,则测试失败。

But when they fail, when I run the consumer side test cases, they fail manually when I run the test cases as Run as Tests in IDE . 但是当它们失败时,当我运行用户端测试用例时,当我以IDE Run as Tests运行测试用例时,它们会手动失败。 If I do mvn clean install builds are passing ? 如果我执行mvn clean install版本会通过? how is this possible ? 这怎么可能 ? How will I know if the tests failed ? 我怎么知道测试是否失败? do i have to run them manually everytime and see ? 我是否必须每次都手动运行它们才能看到? How will I know if the consumer side tests are failing if I add this code as pipeline build ? 如果我将此代码添加为管道构建,我怎么知道消费者方测试是否失败?

mvn clean install is passing even if tests are failing manually when I run them ? 即使我在运行测试时手动失败, mvn clean install也会通过?

I am not using skipTests flag 我没有使用skipTests标志

thanks for everyone's suggestion, I have found fix for this. 感谢大家的建议,我已经找到解决方法。 I have not added the naming convention Test for my test classes under src/main/test , which was causing this issue. 我尚未在src/main/test下为我的测试类添加命名约定Test ,这导致了此问题。 Fixed it. 修复。 Thanks for your help 谢谢你的帮助

'mvn clean install' will try to find test-cases in 'src/test/java' only. “ mvn clean install”将尝试仅在“ src / test / java”中查找测试用例。 Please check once if your test-classes reside at this location. 请检查一次您的考试班是否位于此位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 spring-cloud-gateway 合约测试中从 spring-cloud-contract 中设置带有 StubRunner 端口的 url - How to set urls with port of StubRunner from spring-cloud-contract in spring-cloud-gateway contract tests 为什么某些测试在 mvn clean install 时失败,但在我单独运行时却没有? - Why some tests fail when mvn clean install but not when I run them individually? Spring Cloud Contract 测试适用于 Maven,但不适用于 JUnit - Spring Cloud Contract tests work with Maven but not when run with JUnit “mvn clean install”运行测试,但不运行“mvn clean site” - “mvn clean install” runs tests, but not “mvn clean site” 用于 spring-cloud-contract 的自定义存根生成器 - Custom stub generator for spring-cloud-contract 使用spring-cloud-contract-oa3和spring cloud contract gradle插件时无法生成合约测试 - Unable to generate contract tests when using spring-cloud-contract-oa3 and spring cloud contract gradle plugin Maven无法在mvn -test上运行Junit测试 - Maven failing to run Junit Tests on mvn -test 我无法在 Maven 中使用 mvn test 运行我的测试 - I can´t run my tests using mvn test in Maven 生成的测试在Spring Cloud Contract中失败 - Generated tests fail in Spring Cloud Contract 在Eclipse中分别运行时,单元测试通过,但在mvn全新安装过程中失败 - Unit tests pass when ran separately in Eclipse but fail during mvn clean install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM