-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation about plugin integration tests
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Sonar Scanner Maven Plugin Integration Tests | ||
|
||
This module contains integration tests implemented via the [Apache Maven Invoker Plugin](https://maven.apache.org/plugins/maven-invoker-plugin/). | ||
|
||
The **Apache Maven Invoker Plugin** is configured in the [pom.xml](../../pom.xml) file to run the `Groovy` tests in the current directory. | ||
|
||
## Configuration | ||
|
||
The **Apache Maven Invoker Plugin** is further configured via the [Invoker Properties](https://maven.apache.org/plugins/maven-invoker-plugin/examples/invoker-properties.html), | ||
i.e. [invoker.properties](invoker.properties), to run the `Sonar Scanner Maven Plugin` with the `sonar.scanner.dumpToFile` property set to _out.properties_. | ||
This way the output of the `Sonar Scanner Maven Plugin` is written to a file named *out.properties* and can be used in the integration tests. | ||
|
||
### Debugging the Integration Tests | ||
|
||
The **Apache Maven Invoker Plugin** copies every directory from the `src/it` directory to a`target/it` and runs the tests from there. | ||
For each test, the _out.properties_ file is available in the `target/it/<test-name>` directory. | ||
|
||
## Usage | ||
|
||
The integration tests are automatically run when the `mvn clean install` command is executed from the root of the project. | ||
|
||
### Run only the Maven Plugin Integration Tests | ||
|
||
```bash | ||
cd ../.. | ||
mvn integration-test | ||
``` | ||
|
||
### Run only a specific Maven Plugin Integration Test | ||
|
||
For example running the Integration Test `java-multi-module` | ||
|
||
```bash | ||
cd ../.. | ||
mvn invoker:run -Dinvoker.test="java-multi-module" | ||
``` |