Write up description and add images
@@ -0,0 +1,50 @@
|
||||
# Key CI/CD/Jenkins Concepts and their Usage
|
||||
|
||||
## Displaying JUnit and JaCoCo test results
|
||||
|
||||
1. Configure the `gradle-initializr` project to parse the JUnit XML results for unit test. The files can be found in the directory `build/test-results/test`.
|
||||
2. Execute the build twice to generate a graph. Have a look at the executed tests in the test results.
|
||||
3. Include all test results (unit and integration tests) in the reporting.
|
||||
4. Have a look at how the test result trend changes.
|
||||
5. Install the JaCoCo plugin.
|
||||
6. Reconfigure the Gradle build step to also generate JaCoCo reports: `clean build jacocoTestReport jacocoIntegrationTestReport`.
|
||||
7. Add a post-build action for publish the JaCoCo reports. Use the following path to look for results: `build/jacoco/**.exec`.
|
||||
8. Execute the build twice to generate a graph. Have a look at the code coverage results.
|
||||
|
||||
<details><summary>Show Solution</summary>
|
||||
<p>
|
||||
|
||||
Publish the JUnit reports by pointing to the exact directory containing the XML files.
|
||||
|
||||

|
||||
|
||||
After executing the build twice you will see a test result trend graph.
|
||||
|
||||

|
||||
|
||||
Publish the JUnit reporting by using a wild card.
|
||||
|
||||

|
||||
|
||||
The trend changes accordingly.
|
||||
|
||||

|
||||
|
||||
Install the JaCoCo plugin.
|
||||
|
||||

|
||||
|
||||
Change the task list executed by the Gradle build step.
|
||||
|
||||

|
||||
|
||||
Configure JaCoCo reporting.
|
||||
|
||||

|
||||
|
||||
The JaCoCo coverage trend renders after executing the build twice.
|
||||
|
||||

|
||||
|
||||
</p>
|
||||
</details>
|
||||
BIN
images/05-test-execution-and-reporting/all-test-result-trend.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
images/05-test-execution-and-reporting/jacoco-config.png
Normal file
|
After Width: | Height: | Size: 1010 KiB |
BIN
images/05-test-execution-and-reporting/jacoco-plugin.png
Normal file
|
After Width: | Height: | Size: 869 KiB |
BIN
images/05-test-execution-and-reporting/jacoco-report.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
images/05-test-execution-and-reporting/jacoco-tasks.png
Normal file
|
After Width: | Height: | Size: 1000 KiB |
BIN
images/05-test-execution-and-reporting/jacoco-trend.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
images/05-test-execution-and-reporting/publish-all-tests.png
Normal file
|
After Width: | Height: | Size: 997 KiB |
BIN
images/05-test-execution-and-reporting/publish-unit-tests.png
Normal file
|
After Width: | Height: | Size: 998 KiB |
BIN
images/05-test-execution-and-reporting/test-result.png
Normal file
|
After Width: | Height: | Size: 930 KiB |
|
After Width: | Height: | Size: 1.1 MiB |