@@ -159,6 +159,51 @@ $ docker run -it quay.io/microcks/microcks-cli:latest microcks test 'Beer Catalo
159159```
160160
161161
162+ ## Machine-readable test output
163+
164+ ` microcks test ` accepts ` --output ` to control how the result is rendered:
165+
166+ | Value | Output |
167+ | --- | --- |
168+ | ` text ` (default) | Human-readable summary |
169+ | ` json ` | The full ` TestResult ` as JSON |
170+ | ` yaml ` | The full ` TestResult ` as YAML |
171+ | ` github-actions ` | GitHub Actions workflow commands (annotations + log groups + step summary) |
172+
173+ For machine formats (` json ` /` yaml ` /` github-actions ` ), progress goes to ** stderr**
174+ and only the formatted result is written to ** stdout** , so it can be piped or
175+ parsed cleanly:
176+
177+ ``` bash
178+ microcks test " Pastry API:1.0.0" http://localhost:8080/api OPEN_API_SCHEMA \
179+ --microcksURL=http://localhost:8585/api --output=json > result.json
180+ ```
181+
182+ ### GitHub Actions
183+
184+ With ` --output=github-actions ` , failures surface as ` ::error:: ` annotations,
185+ each operation is wrapped in a collapsible ` ::group:: ` , and a per-operation table
186+ is appended to the job summary (` $GITHUB_STEP_SUMMARY ` ). Set
187+ ` MICROCKS_ACTIONS_VERBOSE=true ` to also emit ` ::notice:: ` for passing operations.
188+
189+ ``` yaml
190+ # .github/workflows/contract-test.yml
191+ name : contract-test
192+ on : [pull_request]
193+ jobs :
194+ contract-test :
195+ runs-on : ubuntu-latest
196+ steps :
197+ - uses : actions/checkout@v4
198+ - name : Microcks contract test
199+ run : |
200+ microcks test "Pastry API:1.0.0" "${{ env.API_URL }}" OPEN_API_SCHEMA \
201+ --microcksURL=${{ secrets.MICROCKS_URL }} \
202+ --keycloakClientId=${{ secrets.MICROCKS_CLIENT_ID }} \
203+ --keycloakClientSecret=${{ secrets.MICROCKS_CLIENT_SECRET }} \
204+ --output=github-actions
205+ ` ` `
206+
162207## Tekton tasks
163208
164209This repository also contains different [Tekton](https://tekton.dev/) tasks definitions and sample pipelines. You'll find under the ` /tekton` folder the resource for current `v1beta1` Tekton API version and the older `v1alpha1` under `tekton/v1alpha1`.
0 commit comments