question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`mvn test` doesn't run tests

See original GitHub issue

Hi all,

I’m having trouble executing Karate tests using Maven. Any help is welcome 😉

Steps to reproduce :

Create a new project using archetype

mvn archetype:generate \
-DarchetypeGroupId=com.intuit.karate \
-DarchetypeArtifactId=karate-archetype \
-DarchetypeVersion=0.9.4 \
-DgroupId=com.mycompany \
-DartifactId=myproject

Run tests

$ cd myproject
$ mvn test

Expected

Tests are compiled, then run.

Actual

Tests are compiled, but never run. The folder target/surefire-reports doesn’t exist.

Here is the mvn test output :

[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.mycompany:myproject >-----------------------
[INFO] Building myproject 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/karate/myproject/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ myproject ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /tmp/karate/myproject/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myproject ---
[INFO] Surefire report directory: /tmp/karate/myproject/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.486 s
[INFO] Finished at: 2019-07-09T11:18:47+02:00
[INFO] ------------------------------------------------------------------------

About my environment

$ mvn --version
Apache Maven 3.6.1 (NON-CANONICAL_2019-05-22T16:10:23+02:00_root; 2019-05-22T16:10:23+02:00)
Maven home: /opt/maven
Java version: 1.8.0_222, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.1.15-arch1-1-arch", arch: "amd64", family: "unix"

Thanks 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ptrthomascommented, Oct 27, 2019

@yaci only 2 suggestions. try with karate 0.9.5.RC3 also refer: https://github.com/intuit/karate/wiki/Gradle

0reactions
ptrthomascommented, Sep 29, 2021

@reddyharinath I’m sorry I can’t help unless you follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Maven Doesn't Find JUnit Tests to Run - Baeldung
Placing tests in the wrong folder is another reason why the tests aren't considered for execution. This occurs mainly due to the default...
Read more >
Maven doesn't execute any unit test - Stack Overflow
I am using Maven with multi-modules. There are 3 projects. ... I do got tests in my projects. But why it doesn't run...
Read more >
`mvn test` doesn't run tests · Issue #823 · karatelabs/karate
Hi all, I'm having trouble executing Karate tests using Maven. Any help is welcome ;) Steps to reproduce : Create a new project...
Read more >
Why Your JUnit 5 Tests Are Not Running Under Maven - DZone
Do you have JUnit 5 tests that run fine from your IDE but fail to run under Maven? Your test output looks like...
Read more >
Maven Surefire Plugin – Inclusions and Exclusions of Tests
Tests from dependencies. In order to scan dependencies by the Surefire plugin and find the test classes to execute in the dependencies, use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found