Skip to content

feat(test): add --output (text/json/yaml/github-actions) for machine-readable results#488

Open
Caesarsage wants to merge 6 commits into
microcks:masterfrom
Caesarsage:feat/test-output
Open

feat(test): add --output (text/json/yaml/github-actions) for machine-readable results#488
Caesarsage wants to merge 6 commits into
microcks:masterfrom
Caesarsage:feat/test-output

Conversation

@Caesarsage

Copy link
Copy Markdown
Contributor

Adds --output to microcks test, with four formats:

Value Output
text (default) Human-readable summary (unchanged default behaviour)
json Full TestResult as JSON
yaml Full TestResult as YAML
github-actions GitHub Actions annotations + log groups + job step summary

Works for both the normal server path and --dry-run, since it's wired into the
shared test engine (runTestAndWait).

github-actions format

  • ::group:: / ::endgroup:: log-folding per operation
  • ::error:: per failing step, with the validation message
  • ::error file=<spec>,line=<n>:: when the local spec is known (--dry-run --artifact),
    mapping the failing operation to its line so the annotation lands on the diff
  • ::notice:: for passing operations, gated by MICROCKS_ACTIONS_VERBOSE
  • A per-operation markdown table appended to $GITHUB_STEP_SUMMARY

Tests

  • Unit tests for all four formatters, the github-actions escaping, the step
    summary, and the OpenAPI line-mapping (pkg/output).

Notes

Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
…ctions)

Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
…paths

Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant