maven surefire-plugin is skipping tests

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


maven surefire-plugin is skipping tests



Recently in our hadoop project, we added maven-surefire-plugin for running unit tests by categories. Related blocks in hadoop root pom.xml file as below:


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<groups>${test.groups}</groups>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.21.0</version>
</dependency>
</dependencies>
</plugin>

<profile>
<id>flakies</id>
<properties>
<test.groups>org.apache.hadoop.classification.TestJUnitCategory$FlakiesTest</test.groups>
</properties>
</profile>
<profile>
<id>stables</id>
<properties>
<test.groups>org.apache.hadoop.classification.TestJUnitCategory$StablesTest</test.groups>
</properties>
</profile>
<profile>
<id>integrations</id>
<properties>
<test.groups>org.apache.hadoop.classification.TestJUnitCategory$IntegrationsTest</test.groups>
</properties>
</profile>
<profile>
<id>none</id>
<properties>
<test.groups>!org.apache.hadoop.classification.TestJUnitCategory$AllTest</test.groups>
</properties>
</profile>





Invoking tests by category works fine: mvn -P integrations.
However, our old fashioned unit test execution got skipped by this maven-surefire-plugin:


13:16:35 [INFO] --- maven-antrun-plugin:1.7:run (create-log-dir) @ hadoop-hdfs ---
13:16:35 [INFO] Executing tasks
13:16:35
13:16:35 main:
13:16:35 [delete] Deleting directory /tmp/tmp.o7flMN8505/src/ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test/data
13:16:35 [mkdir] Created dir: /tmp/tmp.o7flMN8505/src/ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test/data
13:16:35 [copy] Copying 16 files to /tmp/tmp.o7flMN8505/src/ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test-classes/webapps
13:16:35 [INFO] Executed tasks
13:16:35 [INFO]
13:16:35 [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hadoop-hdfs ---
13:16:35 [INFO] Nothing to compile - all classes are up to date
13:16:35 [INFO]
13:16:35 [INFO] --- maven-surefire-plugin:2.20:test (default-test) @ hadoop-hdfs ---
13:16:35 [INFO] Surefire report directory: /tmp/tmp.o7flMN8505/src/ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/surefire-reports
13:16:35 [INFO] parallel='none', perCoreThreadCount=true, threadCount=0, useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, threadCountMethods=0, parallelOptimized=true
13:16:35 [INFO]
13:16:35 [INFO] -------------------------------------------------------
13:16:35 [INFO] T E S T S
13:16:35 [INFO] -------------------------------------------------------
13:26:01 [INFO]
13:26:01 [INFO] Results:
13:26:01 [INFO]
13:26:01 [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
13:26:01 [INFO]
13:26:01 [INFO]
13:26:01 [INFO] --- maven-antrun-plugin:1.7:run (hdfs-test-bats-driver) @ hadoop-hdfs ---



I also verified that by removing surefire-plugin block in root pom.xml file will make these tests executing again as usual. So I have some questions here:



Why tests were skipped in this case?



I saw the reported surefire-plugin version was 2.20 while I was defining 2.21 in my change. I assume this is because it gets overwritten by the parent pom. So how do I make it use my customized version?



Is the version 2.21 the right version for this? I saw some post indicated version 2.21 might have some bug?



Many thanks,









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived