maven-surefire-plugin

Maven Surefire not running JUnit 5 tests

柔情痞子 提交于 2021-02-11 13:00:20
问题 I've been trying to run JUnit 5 tests with Maven Surefire. However, it doesn't seem like Surefire is running any tests at all, even though I do have some, and in the default directory, too. This is the console output I'm getting: https://prnt.sc/ugo1xt Here are the relevant parts of the pom.xml: <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.7.0-M1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins>

Maven Surefire not running JUnit 5 tests

风格不统一 提交于 2021-02-11 12:59:06
问题 I've been trying to run JUnit 5 tests with Maven Surefire. However, it doesn't seem like Surefire is running any tests at all, even though I do have some, and in the default directory, too. This is the console output I'm getting: https://prnt.sc/ugo1xt Here are the relevant parts of the pom.xml: <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.7.0-M1</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins>

Running different test suites using testng and maven

北城余情 提交于 2021-02-06 13:49:01
问题 I am using TestNg and Maven with the surefire plugin to run my tests. I have several different components that I want to be able to run at different times using the same pom. Currently to do this I have several different XML files defining a test suite and I have the pom set up so i can do mvn test -Dtestfile=/path and use that suite instead. I was wondering if there is a way to combine the XML files into one file and chose base off testnames or some other system? EDIT: I have all my tests

surefire results not showing in the test tab of gitlab CI/CD

我是研究僧i 提交于 2021-01-29 17:39:05
问题 I have a java-maven application and I am trying to display my junit results on gitlab as shown in the gitlab help here: https://docs.gitlab.com/ee/ci/junit_test_reports.html#viewing-junit-test-reports-on-gitlab I added the maven-surefire-plugin in the pom build and the maven-surefire-report-plugin in the pom reporting section. I checked that it works because the surefire-report.html is correctly created in my local target repository, with the test results. Then i configured my gitlabci.yaml

Surefire fails because of checking if System.exit() was called in one of junit tests

孤人 提交于 2021-01-28 14:16:27
问题 To depict the problem I encountered, let's assume there is a dummy class: import static java.lang.System.exit class Example { void methodGeneratingSystemExit1() { exit 1 } void methodGeneratingSystemExit2() { exit 2 } } And a test against it: import org.junit.Test import org.junit.Rule import org.junit.contrib.java.lang.system.ExpectedSystemExit class ExampleTest { @Rule public final ExpectedSystemExit expectedSystemExit = ExpectedSystemExit.none() @Test void "System exits with code 1 when

Surefire rerun failing tests not working

你。 提交于 2021-01-21 08:14:48
问题 I want to rerun a test that I know will fail cause I am trying to test the Surefire parameter for re-running the failing tests. I tried running Maven with these two commands neither of them works as expected -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails test and -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails surefire:test Here is part of pom.xml <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-api</artifactId> <version>2.19.1</version> <

Surefire rerun failing tests not working

别来无恙 提交于 2021-01-21 08:14:05
问题 I want to rerun a test that I know will fail cause I am trying to test the Surefire parameter for re-running the failing tests. I tried running Maven with these two commands neither of them works as expected -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails test and -Dsurefire.rerunFailingTestsCount=2 -Dtest=TestThatFails surefire:test Here is part of pom.xml <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-api</artifactId> <version>2.19.1</version> <