You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Add --output flag for JSONformatted test results #301
Currently, microcks test outputs human-readable text only. Developers running tests in CI/CD pipelines or scripts cannot programmatically parse test results without scraping/parsing text output.
Users can pass --output json to get structured JSON output, enabling easier integration with automation tools, CI/CD systems, and tooling that needs machine-parseable results for reporting or gating.
Aligns with Microcks' CI/CD story - developers should be able to get test results inline with code being tested, without requiring web UI navigation. JSON output enables IDE integration, offline validation, and GitHub Actions PR annotations.
Description
Add an --output flag to the microcks test command that allows users to select the output format. When --output json is specified, the command should output test results as structured JSON instead of human-readable text.
@cotishq Thanks for raising this issue. I remeber me and @lbroudoux had a discussion that we should add --output option for commands. But, we were not sure which kind of outputs should be shown, also can we store this output at perticular location for further usage? Think on this and let us know, we are happy to have suggestions and PR on this topic.
Thanks @Harsh4902 for giving clarity, I've already thought through the approach - here's what I'm proposing:
Output formats via --output flag:
text - default, current behavior unchanged
json - tructured JSON to stdout, useful for CI/CD scripting, IDE tooling, and GH Actions annotation pipelines
I'd hold off on additional formats like JUnit XML until i see how the TestResult struct maps - would love your thought on this
Output destination via --output-file=<path>:
Rather than always writing to stdout, an optional --output-file flag would write results to a specified file path. This enables GH Actions artifact uploads, local file caching for IDE integrations, and cleaner script pipelines without output redirection hacks.
i thought smthng like pr 1 covers --output=text/json + pkg/output/ shared formatter and --output-file can follow as pr 2 keeping scope reviewable. Happy to merge both in a single pr too,
would love your opinion on this approach, if it looks good i can start working on this path
Thanks @Harsh4902 for giving clarity, I've already thought through the approach - here's what I'm proposing: Output formats via --output flag:
text - default, current behavior unchanged
json - tructured JSON to stdout, useful for CI/CD scripting, IDE tooling, and GH Actions annotation pipelines
I'd hold off on additional formats like JUnit XML until i see how the TestResult struct maps - would love your thought on this
Output destination via --output-file=<path>: Rather than always writing to stdout, an optional --output-file flag would write results to a specified file path. This enables GH Actions artifact uploads, local file caching for IDE integrations, and cleaner script pipelines without output redirection hacks.
i thought smthng like pr 1 covers --output=text/json + pkg/output/ shared formatter and --output-file can follow as pr 2 keeping scope reviewable. Happy to merge both in a single pr too,
would love your opinion on this approach, if it looks good i can start working on this path
@Harsh4902@lbroudoux i have made the changes and the pr is ready for this like i have stated above, the PR 1 is ready, should i merge or include PR 2 (output destination) in this too or i should a raise a seperate issue and pr for it. Happy to go either way or any changes you prefer in the approach stated above, just waiting for your confirmation before raising the PR.
Hi @cotishq and @Harsh4902 —
i want to flag a coordination issue before
both PRs land separately.
i have PR #339 open which adds --output-format=plain/github-actions to
the test command (for issue #332). If cotishq's --output=text/json PR
also merges, the test command will end up with two separate overlapping
flags.
i would suggest we unify under a single --output flag with three values:
This closes both #301 and #332 in one clean flag. I am happy to update
PR #339 to follow this unified approach, or collaborate with @cotishq
if they want to include github-actions in their PR instead.
@Harsh4902 what is your preference — should we unify these?
@Harishrs2006 Thanks for flagging this. I raised #301 earlier and have been waiting for @Harsh4902 direction on the approach before opening a PR - wanted to make sure the design was confirmed first.
The unified --output flag idea with text, json, and github-actions makes sense. @Harsh4902 happy to go whichever direction works best - I can include github-actions support in my PR, or we can coordinate. Your call on how to proceed.
@cotishq@Harishrs2006 nice to see you guys are wanted to work in collaboration. I would say a you can use global --output flag and then with passing arguments you can change the type of output. This way, in future we can include more output types. And would also recommend text, json, yaml as must needed format.
@Harsh4902 got it! I'll update the implementation to include yaml alongside text and json under a global --output flag and raise the PR shortly. @Harishrs2006 once the base PR merges, you can add github-actions support on top - that keeps both PRs clean and reviewable separately.
Activity
cotishq commentedon May 6, 2026
@lbroudoux @Harsh4902 , how this sounds to you, if good i can a raise a pr
Harsh4902 commentedon May 7, 2026
@cotishq Thanks for raising this issue. I remeber me and @lbroudoux had a discussion that we should add
--outputoption for commands. But, we were not sure which kind of outputs should be shown, also can we store this output at perticular location for further usage? Think on this and let us know, we are happy to have suggestions and PR on this topic.cotishq commentedon May 7, 2026
Thanks @Harsh4902 for giving clarity, I've already thought through the approach - here's what I'm proposing:
Output formats via --output flag:
I'd hold off on additional formats like JUnit XML until i see how the TestResult struct maps - would love your thought on this
Output destination via
--output-file=<path>:Rather than always writing to stdout, an optional
--output-file flagwould write results to a specified file path. This enables GH Actions artifact uploads, local file caching for IDE integrations, and cleaner script pipelines without output redirection hacks.i thought smthng like pr 1 covers
--output=text/json+pkg/output/shared formatter and--output-filecan follow as pr 2 keeping scope reviewable. Happy to merge both in a single pr too,would love your opinion on this approach, if it looks good i can start working on this path
cotishq commentedon May 8, 2026
@Harsh4902 @lbroudoux i have made the changes and the pr is ready for this like i have stated above, the PR 1 is ready, should i merge or include PR 2 (output destination) in this too or i should a raise a seperate issue and pr for it. Happy to go either way or any changes you prefer in the approach stated above, just waiting for your confirmation before raising the PR.
Harishrs2006 commentedon May 8, 2026
Hi @cotishq and @Harsh4902 —
i want to flag a coordination issue before
both PRs land separately.
i have PR #339 open which adds --output-format=plain/github-actions to
the test command (for issue #332). If cotishq's --output=text/json PR
also merges, the test command will end up with two separate overlapping
flags.
i would suggest we unify under a single --output flag with three values:
This closes both #301 and #332 in one clean flag. I am happy to update
PR #339 to follow this unified approach, or collaborate with @cotishq
if they want to include github-actions in their PR instead.
@Harsh4902 what is your preference — should we unify these?
cotishq commentedon May 9, 2026
@Harishrs2006 Thanks for flagging this. I raised #301 earlier and have been waiting for @Harsh4902 direction on the approach before opening a PR - wanted to make sure the design was confirmed first.
The unified --output flag idea with text, json, and github-actions makes sense. @Harsh4902 happy to go whichever direction works best - I can include github-actions support in my PR, or we can coordinate. Your call on how to proceed.
Harsh4902 commentedon May 11, 2026
@cotishq @Harishrs2006 nice to see you guys are wanted to work in collaboration. I would say a you can use global
--outputflag and then with passing arguments you can change the type of output. This way, in future we can include more output types. And would also recommend text, json, yaml as must needed format.Harishrs2006 commentedon May 11, 2026
thanks @Harsh4902!
should
github-actionsformat (for::error::/::notice::annotations) be included alongsidetext,json,yamlor kept as a follow-up?@cotishq happy to contribute
github-actionssupport to your PR directly to avoid duplicationcotishq commentedon May 11, 2026
@Harsh4902 got it! I'll update the implementation to include yaml alongside text and json under a global --output flag and raise the PR shortly.
@Harishrs2006 once the base PR merges, you can add github-actions support on top - that keeps both PRs clean and reviewable separately.