Knowledge Base > Cover CLI > Preflight checks

Preflight checks

Diffblue Cover’s preflight option checks the suitability of your environment without running a full process. This allows you to rectify any environmental challenges prior to attempting to test creation.

Running preflight checks

The preflight check can be run with a single dcover command from the root of the module and carries out the relevant checks. This is done by adding the option --preflight to the desired command.

The preflight check requires the all of the environmental conditions are met for running dcover:

Then the command can be run, for example:

$ dcover create --preflight

The --preflight option can be added to any dcover command, for example added to the coverage-reports option as dcover coverage-reports --preflight which will carry out checks relevant to creating coverage reports (such as checking the JaCoCo plugin version) but not other checks related to test creation (such as Spring dependencies).

Understanding the environment summary

After the checks have been carried out a summary table is displayed. Several key checks, along with any warnings and errors are shown with a result of SUCCESS, WARNING or ERROR. An overall Environment check status is also given.

INFO  Environment summary:
INFO  --------------------
INFO  Java version                  11.0.14             SUCCESS
INFO  Build system                  Gradle              SUCCESS
INFO  Testing framework             JUnit Jupiter 5     SUCCESS
INFO  Launcher                      JUnit Jupiter       SUCCESS
INFO  Test validation               Enabled             SUCCESS
INFO  Spring Core                   5.3.14              SUCCESS
WARN  Spring Web                    5.3.6               WARNING
INFO  Spring Test                   5.3.14              SUCCESS
INFO  Spring Boot                   2.6.2               SUCCESS
INFO  Spring Boot Test              2.6.2               SUCCESS
INFO  Hamcrest                      Hamcrest 2 2.2      SUCCESS
INFO  Mocking Framework             Mockito 4.0.0       SUCCESS
ERROR JVM matches compilation JDK   17                  ERROR
INFO  Environment check status: ERROR

Errors indicate a problem with the environment that must be corrected before the full command can be run (e.g. the current JVM does not match the compilation JDK). Warnings indicate the setup is not optimal, but they will not prevent the full command from being run (e.g. Spring dependencies are mismatched).

Detailed recommendations on how to fix the warnings and errors can be found above the summary table.

The summary table is displayed in the user log file even when a command is run without the --preflight option.