From 0c896cca5191f040c07aaef5e903976a8c773c3b Mon Sep 17 00:00:00 2001 From: Angelo Date: Fri, 8 Sep 2023 15:57:44 +0200 Subject: [PATCH] Update develop.md with Invoker Tests debugging instruction (#180) --- develop.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/develop.md b/develop.md index 8cdc923e..109af3e3 100644 --- a/develop.md +++ b/develop.md @@ -14,10 +14,21 @@ Run a scan using your local build: # run scan in some project `mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.5-SNAPSHOT:sonar` - +### Testing + There are 3 type of tests: -* Unit tests (in src/test/java) that you can run with `mvn test` -* Invoker tests (in src/it) that you can run with `mvn verify` -* Integration tests (in its) that you have to run as a separate Maven project (`cd its && mvn verify`) +#### Unit Tests +The Unit Tests are located in src/test/java, and they can be run with `mvn test` + +#### Invoker Tests +The Invoker tests are located in src/it, and they can be run with `mvn verify` + +The [maven-invoker-plugin](https://maven.apache.org/plugins/maven-invoker-plugin/) allows to debug single tests from the cli with `mvn invoker:run -Dinvoker.test= -Dinvoker.mavenExecutable=mvnDebug`. + +For example, in order to debug the test [java-compiler-executable](src/it/java-compiler-executable), run `mvn invoker:run -Dinvoker.test=java-compiler-executable -Dinvoker.mavenExecutable=mvnDebug` and then attach the project to the debug process: IntelliJ Toolbar -> Run -> Attach to Process. + +*Note* that you have to run `mvn invoker:install` to debug the latest changes in your code! +#### Integration Tests +The Integration tests are located in its, and they can be run as a separate Maven project: `cd its && mvn verify`