-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Karate tests should be integration tests in Maven #911
Comments
@atehrani personally I am not in favor of trying to force tests into any particular "bucket". FWIW karate has been in the wild for 2.5 years and this is the first time we've gotten feedback that Karate tests being treated like unit-tests is an "issue". Do note that Karate can flex to even do unit-tests - here is an example: https://twitter.com/ptrthomas/status/1132515667310047233 Yes, all the existing examples and demos use the That said, Karate does not "force" you into anything, you are free to use |
@atehrani just one more thing, here is a stack overflow answer that I think directly answers your question: https://stackoverflow.com/a/48522439/143475 |
an update for others looking for this solution, pasting a comment from a Stack Overflow answer below - https://stackoverflow.com/a/59084632/143475
|
Maven has lifecycle events dedicated for unit tests and integration tests, which are fundamentally different types of tests, hence the different lifecycles. In fact there are different Maven plugins for the respective lifecycles; the
maven-surefire-plugin
is dedicated for unit tests and themaven-failsafe-plugin
is dedicated for integration tests, this is clearly stated in the documentation.Karate tests, are by nature integration tests, not unit tests and should be treated as such. Currently Karate leverages the
maven-surefire-plugin
which is used for unit tests, this is incorrect. Because of this, it makes it very difficult to separate running unit tests vs integration tests, as Karate breaks the Maven convention (in many ways). Also the Maven lifecycle for integration tests has apre-integration-test
andpost-integration-test
lifecycle, which is handy to startup common utilities used by integration tests (such as WireMock, SQLite, ActiveMQ...etc).Are there examples to show how to use Karate using the
maven-failsafe-plugin
, is this even possible?The text was updated successfully, but these errors were encountered: