Skip to content

Commit

Permalink
Merge pull request #119 from launchableinc/ST-732-doc
Browse files Browse the repository at this point in the history
[ST-732] doc for the maven plugin
  • Loading branch information
Konboi authored Feb 3, 2021
2 parents d950c65 + a3c8ff8 commit 2e31bc1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [GoogleTest \(C++\)](integrations/googletest.md)
* [Go Test](integrations/go-test.md)
* [Gradle](integrations/gradle.md)
* [Maven](integrations/maven.md)
* [Minitest \(Ruby\)](integrations/minitest.md)
* [Nose \(Python\)](integrations/nose-python.md)
* [Generic file based test runner](integrations/file.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ Then, after tests run, you send test reports to Launchable. How you do this depe
* [GoogleTest](integrations/googletest.md#recording-test-results)
* [Go Test](integrations/go-test.md#recording-test-results)
* [Gradle](integrations/gradle.md#recording-test-results)
* [Maven](integrations/maven.md)
* [Minitest](integrations/minitest.md#recording-test-results)
* [Nose](integrations/nose-python.md)

Expand All @@ -229,6 +230,7 @@ See the following sections for how to fill the `...(test runner specific part)..
* [GoogleTest](integrations/googletest.md#subsetting-test-execution)
* [Go Test](integrations/go-test.md#subsetting-test-execution)
* [Gradle](integrations/gradle.md#subsetting-test-execution)
* [Maven](integrations/maven.md)
* [Minitest](integrations/minitest.md#subsetting-test-execution)
* [Nose](integrations/nose-python.md#subsetting-test-execution)

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [GoogleTest \(C++\)](googletest.md)
* [Go Test](go-test.md)
* [Gradle](gradle.md)
* [Maven](integrations/maven.md)
* [Minitest \(Ruby\)](minitest.md)
* [Nose \(Python\)](nose-python.md)

Expand Down
30 changes: 30 additions & 0 deletions docs/integrations/maven.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Maven

## Recording test results

The Surefire Plugin is default report plugin for [Apache Maven](https://maven.apache.org/) and used during the test phase of the build lifecycle to execute the unit tests of an application. See [Maven Surefire Plugin – Introduction](https://maven.apache.org/surefire/maven-surefire-plugin/)

After running tests, point to the directory that contains all the generated test report XML files. You can specify multiple directories, for example if you do multi-project build:

```bash
# run the tests however you normally do, then produce a JUnit XML file
maven tests

launchable record tests --build <BUILD NAME> maven ./project1/target/surefire-reports/ ./project2/target/surefire-reports/
```

For more information and advanced options, run `launchable record tests maven --help`

## Subsetting test execution

To select a meaningful subset of tests, then feed that into Launchable CLI:

```bash
launchable subset --build <BUILD NAME> project1/src/test/java project2/src/test/java > launchable-subset.txt
```

The file will contain the subset of tests that should be run. You can now invoke your test executable to run exactly those tests:

```bash
maven test -Dsurefire.includeFiles=launchable-subset.txt
```

0 comments on commit 2e31bc1

Please sign in to comment.