Skip to content

Commit a56a227

Browse files
committed
Ensure reporting is aware of the two test executions.
1. **action.yml** — Widens the default `report-path` glob from `target/surefire-reports/TEST-*.xml` to `target/surefire-reports*/TEST-*.xml` so both report directories are picked up. Replaces the `-d "$REPORT_DIR"` directory check with `compgen -G` since the path now contains a wildcard in the directory component. 2. **build-test.yml** — Adds `target/surefire-reports-isolated/` to the artifact upload path so the isolated execution's reports are preserved in CI. 3. **pom.xml** — Adds `<reportsDirectory>${project.build.directory}/surefire-reports-isolated</reportsDirectory>` (with a comment) to the `isolated-resume-tests` Surefire execution so its XML reports don't overwrite the default-test reports for the same classes. Signed-off-by: Ed Burns <edburns@microsoft.com>
1 parent 4a2e79c commit a56a227

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/actions/test-report/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
report-path:
55
description: "Path to the test report XML files (glob pattern)"
66
required: false
7-
default: "target/surefire-reports/TEST-*.xml"
7+
default: "target/surefire-reports*/TEST-*.xml"
88
jacoco-path:
99
description: "Path to the JaCoCo XML report"
1010
required: false
@@ -25,7 +25,8 @@ runs:
2525
REPORT_DIR=$(dirname "${{ inputs.report-path }}")
2626
REPORT_PATTERN=$(basename "${{ inputs.report-path }}")
2727
28-
if [ -d "$REPORT_DIR" ]; then
28+
# Use compgen to check if the glob expands to any files
29+
if compgen -G "${{ inputs.report-path }}" > /dev/null 2>&1; then
2930
TESTS_RUN=$(grep -h "tests=" ${{ inputs.report-path }} 2>/dev/null | sed 's/.*tests="\([0-9]*\)".*/\1/' | awk '{s+=$1} END {print s}')
3031
FAILURES=$(grep -h "failures=" ${{ inputs.report-path }} 2>/dev/null | sed 's/.*failures="\([0-9]*\)".*/\1/' | awk '{s+=$1} END {print s}')
3132
ERRORS=$(grep -h "errors=" ${{ inputs.report-path }} 2>/dev/null | sed 's/.*errors="\([0-9]*\)".*/\1/' | awk '{s+=$1} END {print s}')

.github/workflows/build-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
path: |
131131
target/jacoco-test-results/sdk-tests.exec
132132
target/surefire-reports/
133+
target/surefire-reports-isolated/
133134
retention-days: 1
134135

135136
- name: Generate JaCoCo badge

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@
359359
</goals>
360360
<configuration>
361361
<groups>isolated-resume</groups>
362+
<!-- Use a separate report directory so these results
363+
don't overwrite the default-test XML reports for
364+
the same test classes (CopilotSessionTest,
365+
StreamingFidelityTest). -->
366+
<reportsDirectory>${project.build.directory}/surefire-reports-isolated</reportsDirectory>
362367
</configuration>
363368
</execution>
364369
<!-- Exclude the isolated resume tests from the main run -->

0 commit comments

Comments
 (0)