Skip to content

Commit f9f0d0f

Browse files
committed
add doc
Signed-off-by: bowenlan-amzn <[email protected]>
1 parent 7b6c562 commit f9f0d0f

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/test-and-build-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Generate Jacoco Test Report
6060
if: always()
6161
run: |
62-
su `id -un 1000` -c "./gradlew jacocoTestReport -Dtests.coverage=true"
62+
su `id -un 1000` -c "./gradlew jacocoTestReport
6363
- name: Upload coverage XML
6464
uses: actions/upload-artifact@v4
6565
if: always()

DEVELOPER_GUIDE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [Setup](#setup)
66
- [Build](#build)
77
- [Building from the command line](#building-from-the-command-line)
8+
- [Code Coverage](#code-coverage)
89
- [Debugging](#debugging)
910
- [Using IntelliJ IDEA](#using-intellij-idea)
1011
- [Submitting Changes](#submitting-changes)
@@ -63,6 +64,31 @@ However, to build the `index management` plugin project, we also use the OpenSea
6364

6465
When launching a cluster using one of the above commands, logs are placed in `build/testclusters/integTest-0/logs`. Though the logs are teed to the console, in practices it's best to check the actual log file.
6566

67+
### Code Coverage
68+
69+
The project supports generating code coverage reports using JaCoCo.
70+
71+
#### Generating Coverage Reports
72+
73+
To generate code coverage reports
74+
75+
```bash
76+
./gradlew check -Dtests.coverage=true
77+
```
78+
79+
Or run any tests, and generate test report
80+
81+
```bash
82+
./gradlew test
83+
./gradlew jacocoTestReport
84+
```
85+
86+
#### Coverage Report Locations
87+
88+
After running with coverage enabled, reports are generated in:
89+
- **HTML Report**: `build/reports/jacoco/test/html/index.html` (human readable)
90+
- **XML Report**: `build/reports/jacoco/test/jacocoTestReport.xml` (for tools like Codecov)
91+
6692
### Debugging
6793

6894
Sometimes it is useful to attach a debugger to either the OpenSearch cluster or the integ tests to see what's going on. When running unit tests, hit **Debug** from the IDE's gutter to debug the tests. For the OpenSearch cluster or the integ tests, first, make sure start a debugger listening on port `5005`.

0 commit comments

Comments
 (0)