Skip to content

fix(test): print operation failure details in test get text output - #622

Merged
Harsh4902 merged 3 commits into
microcks:masterfrom
ish-g09:fix/test-get-text-output
Nov 27, 2026
Merged

Harsh4902 merged 3 commits into
microcks:masterfrom
ish-g09:fix/test-get-text-output

Conversation

@ish-g09

@ish-g09 ish-g09 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Description

When running microcks test get <testResultId> on a failed test in default text mode, the CLI was previously downcasting the result into a TestResultSummary and dropping all the TestCaseResults. This meant it just printed the same 1-line table as test list without showing which operation actually failed or what the error message was.

This PR wires test get in text mode to use the existing TextFormatter (similar to how microcks test renders results):

  • Route text mode through output.NewFormatter(output.FormatText) in cmd/testQuery.go so failed operations and their messages are printed directly in the terminal.
  • Update TextFormatter in pkg/output/text_formatter.go to display IN_PROGRESS when a test is still running so it isn't falsely marked as FAILURE.
  • Keep --output json untouched so IDE and VS Code integrations remain completely unaffected.
  • Added unit tests in cmd/test_query_test.go and pkg/output/output_test.go.

Related issue(s)

Fixes #608

AI Disclosure

The code changes and unit tests were written and verified by me. I used an AI assistant to discuss edge cases.

Testing

  • go vet ./... : clean (0 warnings)
  • go test -v ./pkg/output/... : all 11 tests pass
  • go test -v -run TestTestGetCommandOutputsText ./cmd/... : passes
  • Verified manually against a local mock server:
Screenshot 2026-11-07 at 14 11 04

Copilot AI balanced review requested due to automatic review settings November 7, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Signed-off-by: Harshvardhan Parmar <harshparmar4902@gmail.com>
Signed-off-by: Harshvardhan Parmar <harshparmar4902@gmail.com>

@Harsh4902 Harsh4902 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ish-g09 A small change was needed and I made that, rest was GTG. Thanks for this PR.

@Harsh4902
Harsh4902 merged commit 3c6eb4f into microcks:master Nov 27, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Build — cc4f7d03 Deployed Nov 27, 2026 by Harsh4902 via build-verify-package #912
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.

bug: microcks test get swallows test failure details and operation results in text output mode

3 participants