Skip to content

Commit 56a196e

Browse files
maskarbclaude
andauthored
fix: escape JSON in junit-summary custom_data, normalize YAML quoting (#783)
## Summary Fixes the backend unit test workflow failing at the "Mark Workflow failure if test reporting failed" step, and normalizes YAML quoting for consistency. ## Changes - **Fix JSON escaping in `custom_data`** — The `junit-summary` action's `custom_data` parameter had unescaped double quotes inside a double-quoted YAML string, causing the test reporting step to fail even when all tests passed. Fixed by escaping inner quotes with backslashes. - **Normalize YAML quoting** — Switched all string values from single quotes to double quotes for consistency across the workflow file. ## Test plan - [ ] Push to branch and verify the unit test workflow completes without "test reporting failed" error - [ ] Verify the HTML report artifact link appears in the test summary 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0a5f8f8 commit 56a196e

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

.github/workflows/unit-tests.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'components/backend/**'
8-
- 'components/ambient-api-server/**'
9-
- 'components/runners/claude-code-runner/**'
10-
- 'components/ambient-cli/**'
11-
- 'components/ambient-sdk/go-sdk/**'
12-
- '.github/workflows/unit-tests.yml'
13-
- '!**/*.md'
7+
- "components/backend/**"
8+
- "components/ambient-api-server/**"
9+
- "components/runners/claude-code-runner/**"
10+
- "components/ambient-cli/**"
11+
- "components/ambient-sdk/go-sdk/**"
12+
- ".github/workflows/unit-tests.yml"
13+
- "!**/*.md"
1414

1515
pull_request:
1616
paths:
17-
- 'components/backend/**'
18-
- 'components/ambient-api-server/**'
19-
- 'components/runners/claude-code-runner/**'
20-
- 'components/ambient-cli/**'
21-
- 'components/ambient-sdk/go-sdk/**'
22-
- '.github/workflows/unit-tests.yml'
23-
- '!**/*.md'
17+
- "components/backend/**"
18+
- "components/ambient-api-server/**"
19+
- "components/runners/claude-code-runner/**"
20+
- "components/ambient-cli/**"
21+
- "components/ambient-sdk/go-sdk/**"
22+
- ".github/workflows/unit-tests.yml"
23+
- "!**/*.md"
2424

2525
workflow_dispatch:
2626
inputs:
2727
test_label:
2828
description: "Backend test label filter"
29-
default: 'unit'
29+
default: "unit"
3030
required: true
3131
type: string
3232
default_namespace:
3333
description: "Default namespace for backend testing"
34-
default: 'test-namespace'
34+
default: "test-namespace"
3535
required: false
3636
type: string
3737

@@ -83,8 +83,8 @@ jobs:
8383
- name: Set up Go
8484
uses: actions/setup-go@v6
8585
with:
86-
go-version-file: 'components/backend/go.mod'
87-
cache-dependency-path: 'components/backend/go.sum'
86+
go-version-file: "components/backend/go.mod"
87+
cache-dependency-path: "components/backend/go.sum"
8888

8989
- name: Create reports directory
9090
shell: bash
@@ -146,16 +146,16 @@ jobs:
146146
uses: kubeflow/pipelines/.github/actions/junit-summary@master
147147
if: (!cancelled()) && steps.upload.outcome != 'failure'
148148
with:
149-
xml_files: '${{ env.TESTS_DIR }}/reports'
150-
custom_data: '{"HTML Report": "${{ steps.upload.outputs.artifact-url }}"}'
149+
xml_files: "${{ env.TESTS_DIR }}/reports"
150+
custom_data: '{\"HTML Report\": \"${{ steps.upload.outputs.artifact-url }}\"}'
151151
continue-on-error: true
152152

153153
- name: Publish Test Summary
154154
id: summary
155155
uses: kubeflow/pipelines/.github/actions/junit-summary@master
156156
if: (!cancelled()) && steps.upload.outcome == 'failure'
157157
with:
158-
xml_files: '${{ env.TESTS_DIR }}/reports'
158+
xml_files: "${{ env.TESTS_DIR }}/reports"
159159
continue-on-error: true
160160

161161
- name: Mark Workflow failure if test step failed
@@ -184,8 +184,8 @@ jobs:
184184
- name: Set up Go
185185
uses: actions/setup-go@v6
186186
with:
187-
go-version-file: 'components/ambient-api-server/go.mod'
188-
cache-dependency-path: 'components/ambient-api-server/go.sum'
187+
go-version-file: "components/ambient-api-server/go.mod"
188+
cache-dependency-path: "components/ambient-api-server/go.sum"
189189

190190
- name: Create secrets directory
191191
run: |
@@ -215,8 +215,8 @@ jobs:
215215
- name: Set up Python
216216
uses: actions/setup-python@v6
217217
with:
218-
python-version: '3.11'
219-
cache: 'pip'
218+
python-version: "3.11"
219+
cache: "pip"
220220

221221
- name: Install dependencies
222222
run: |
@@ -253,8 +253,8 @@ jobs:
253253
- name: Set up Go
254254
uses: actions/setup-go@v6
255255
with:
256-
go-version-file: 'components/ambient-cli/go.mod'
257-
cache-dependency-path: 'components/ambient-cli/go.sum'
256+
go-version-file: "components/ambient-cli/go.mod"
257+
cache-dependency-path: "components/ambient-cli/go.sum"
258258

259259
- name: Build binary
260260
run: |

0 commit comments

Comments
 (0)