question

Tri avatar image
Tri asked Tri commented

running `mvn test` locally on crud-java project (Week 3): zero test executed

Hi,

Trying to run locally the unit tests of week3-AppDev-crud/crud-java Zero test was executed. What is the reason Maven could not run any test?

  • OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)

  • Apache Maven 3.6.3

  • macOS 10.15.5

$ mvn test

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.datastax.workshop:crud-java:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 76, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 72, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------< com.datastax.workshop:crud-java >-------------------
[INFO] Building crud-java 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ crud-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ crud-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ crud-java ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ crud-java ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ crud-java ---
[INFO] Surefire report directory: ~/Documents/CASSANDRA/cassandra-workshop-series/week3-AppDev-crud/crud-java/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.601 s
[INFO] Finished at: 2020-07-23T13:17:49-04:00
[INFO] ------------------------------------------------------------------------
workshop
1 comment
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image Erick Ramirez ♦♦ commented ·

Just acknowledging your question. We've been inundated with questions from the workshops plus the migration to the DataStax Academy platform so I haven't had the chance to look into this. Cheers!

0 Likes 0 ·

1 Answer

Cedrick Lunven avatar image
Cedrick Lunven answered Tri commented

Hi,

I am able to reproduce the "issue". Definitively some compatibility with Maven and JUNIT 5...as usual I would say.

https://dzone.com/articles/why-your-junit-5-tests-are-not-running-under-maven

Still investigating on my end if I can make it work. Now this command is not part of the exercises, you specified the test you want to run one by one because they will failed until you fix the code.

mvn test -Dtest=com.datastax.workshop.Ex02_Connect_to_Cassandra
1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tri avatar image Tri commented ·

The workaround works OK, thx for the link explaining the issue. Hope you can apply the fix.

Anything wrong in the pom.xml, are those WARNING related to the issue?

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 76, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 72, column 12
0 Likes 0 ·