Test Verification

After tests have been generated, dcover verifies newly created tests by invoking the test phase of your build tool (Maven, Gradle). dcover will then remove any created tests that fail compilation or execution.

  • Existing unit tests must be compiling and passing (mvn test, gradle test) before dcover create is invoked.

    Run with --skip-test-verification if this is not the case.

  • If unverified JUnit 5 tests (those which fail to compile or run successfully) are generated by dcover create, please confirm that running mvn test actually executes your unit tests. JUnit 5 requires at minimum Maven Surefire v2.22.0 to work, and if an older version is present mvn test will pass without executing any tests. You can specify the Surefire Plugin version in your POM using:

    <build>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
        </plugin>
      </plugins>
    </build>
    
  • When running mvn test, dcover can disable known style checking plugins (checkstyle, spring-javaformat) by using the --ignore-stylechecks argument.

  • Test verification is bypassed if a build tool (Maven, Gradle) is not detected from your environment.

    In that case it is possible that some created tests may fail compilation or execution.

results matching ""

    No results matching ""