Is there a way to run Karate test during maven's integration test phase?

有些话、适合烂在心里 提交于 2019-12-24 19:43:19

问题


Is there a way to run Karate test during maven's integration test phase? It seems that surefire plugin is hardcoded into Karate. I have tried to override it using failsafe plugin but with no luck. I don't want test to run along with unit tests.

Thank in advance!


回答1:


It seems that surefire plugin is hardcoded into Karate

I'm not sure where you got that impression, but no, the surefire plugin is not hardcoded into Karate.

Keep in mind that the simplest way to not run a JUnit test via surefire is to not use the *Test.java naming convention.

I think the solution for you is simple, whichever JUnit test is the "entry-point" for your Karate tests (the parallel runner is recommended) - just use the failsafe naming conventions.

And then, just include the failsafe plugin as per the examples and it should work. If you have trouble getting that to work (unlikely), then you should look at maven profiles.

EDIT: also see this comment: Is there a way to run Karate tests as an integration test suite against a pre-booted spring boot server?

Turns out that I cannot be done and it is a limitation of Maven, not Karate. Howto add another test source folder to Maven and compile it to a separate folder? - Here is my test project to prove it out: https://github.com/djangofan/spring-boot-hello - Thanks for leading me down what appears to have been the correct path to discover the limitation. Using Gradle would likely solve my issue but that is not an option on my project. If I use Karate for "separated integration tests", I need a separate mvn test module.



来源:https://stackoverflow.com/questions/48521404/is-there-a-way-to-run-karate-test-during-mavens-integration-test-phase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!