-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
mvn test
doesn't run tests
#823
Comments
@Chralu thanks, we indeed missed a step in the archetype when moving to JUnit 5. You have 2 simple options a) generate the archetype for 0.9.3 e.g. b) or - add 2 sections to the <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.version>3.6.0</maven.compiler.version>
<karate.version>0.9.4</karate.version>
</properties>
<dependencies>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</build>
</project> |
Thanks @ptrthomas ! It works fine with JUnit5. |
@Chralu great ! thank you for raising this genuine issue, I updated the docs as well. I'll keep this open as something pending 0.9.5 when it will be properly fixed |
adding some relevant info I found: https://dzone.com/articles/why-your-junit-5-tests-are-not-running-under-maven |
I am facing similar problem with Gradle. I created new Gradle project in IntelliJ then generated another one from maven archetype and copied src/test/java from maven project to gradle one. When I am trying to execute ./gradlew test the build succeeds, but tests are not run.
|
@yaci only 2 suggestions. try with karate 0.9.5.RC3 also refer: https://github.com/intuit/karate/wiki/Gradle |
@ptrthomas I was able to create a project and integrate Karate with maven and run tests, but when my colleagues are checkout my repo and want to run tests. We have an issue that says "Warning: Nashorn engine is planned to be removed from a future JDK release" And we have a problem with connection step definitions. Can you help us? |
@Artashes1996 use stack overflow for support please, or read: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue |
released 0.9.5 |
@ptrthomas , I am new to this KARATE framework and implemented in eclipse in a maven project. feature files are executed without using in pom.xml, while creating CI job, updated pom.xml file with tag details, tests are not running. Could you please help me?
output:- |
@reddyharinath I'm sorry I can't help unless you follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-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
Run tests
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 :About my environment
Thanks :)
The text was updated successfully, but these errors were encountered: