Skip to content

feat: add --output-format=github-actions flag to test command#346

Open
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/github-actions-output-format
Open

feat: add --output-format=github-actions flag to test command#346
A-d-i-t-y wants to merge 1 commit into
microcks:masterfrom
A-d-i-t-y:feat/github-actions-output-format

Conversation

@A-d-i-t-y
Copy link
Copy Markdown

Summary

Adds --output-format flag to the test command to improve CI/CD experience.

Problem

Test failures in GitHub Actions are buried in plain text logs. Developers
must open the Microcks UI to see per-operation results.

Solution

  • --output-format=plain (default) — existing behavior, no breaking change
  • --output-format=github-actions — emits workflow commands as PR annotations

Example output in GitHub Actions

::notice title=Test Passed::Operation GET /beer PASSED
::error title=Test Failed::Operation POST /beer FAILED

Files changed

  • cmd/test.go — added --output-format flag with validation
  • pkg/connectors/microcks_client.go — added TestResult, TestCaseResult,
    TestStepResult structs and GetTestResultDetails method

Closes #332

@Vaishnav88sk
Copy link
Copy Markdown

@A-d-i-t-y

Please pass the DCO.

@A-d-i-t-y A-d-i-t-y force-pushed the feat/github-actions-output-format branch from dd34a22 to be0f819 Compare May 9, 2026 14:50
@A-d-i-t-y
Copy link
Copy Markdown
Author

Hi @Vaishnav88sk, thank you for the review! I have signed off all commits to pass the DCO check. Could you please verify it and let me know if there are any further changes required? I am happy to work on any feedback you have.

@Caesarsage
Copy link
Copy Markdown
Contributor

This look like a total rewrite and could be hard to review.

If you are using an AI, it should only make the propose fix and not full change

@A-d-i-t-y
Copy link
Copy Markdown
Author

Hi @Caesarsage, thank you for the feedback! You are right, the changeset is larger than needed.

The core change is only:

  1. Three new structs (TestStepResult, TestCaseResult, TestResult) in microcks_client.go
  2. One new method GetTestResultDetails() in microcks_client.go
  3. The --output-format flag and printing logic in cmd/test.go

The rest of microcks_client.go was unintentionally included. I will clean up the PR to show only the minimal necessary diff. Sorry for the noise!

Add --output-format flag supporting:
- plain (default): existing behavior unchanged
- github-actions: emits ::error/::notice workflow commands for PR annotations

Closes microcks#332

Signed-off-by: Aditya <aaaditya1909@gmail.com>
@A-d-i-t-y A-d-i-t-y force-pushed the feat/github-actions-output-format branch from be0f819 to 872cdd6 Compare May 14, 2026 14:01
@A-d-i-t-y
Copy link
Copy Markdown
Author

Hi @Caesarsage @Harsh4902, I have cleaned up the PR. Now it only contains the minimal necessary changes:

  1. Three new structs (TestStepResult, TestCaseResult, TestResult) in microcks_client.go
  2. One new method GetTestResultDetails() in microcks_client.go
  3. The --output-format flag and printing logic in cmd/test.go

Please let me know if any further changes are needed!

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.

feat: add --output-format flag to emit GitHub Actions workflow annotations

3 participants