Skip to content

Keep long terminal JSON output valid - #258

Merged
Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/fix-dryrun-json-width
Oct 26, 2026
Merged

Mike Krüger (mkrueger) merged 2 commits into
mainfrom
dev/mkrueger/fix-dryrun-json-width

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Fix the Azure pipeline failure and preserve valid terminal JSON output on narrow consoles.

The normal CI failure was caused by long JSON strings being wrapped by the Spectre.Console renderer at the agent's console width. The resulting inserted carriage return made the test's JSON output invalid. For JSON lines that exceed the console width, the shell now writes the already-formatted JSON directly to stdout instead of routing it through the renderer that inserts line breaks. Short output remains syntax-highlighted.

The import dry-run output test uses a stable console width, and a new regression renders a 100-character string at 40 columns and parses the resulting stdout as JSON.

Validation: the full test suite passes locally (4886 passed, 0 failed, 131 skipped).

The interactive JSON renderer wraps at the console width, so on narrow build agents the long temp-file path was split inside a JSON string and the test failed to parse the output.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The isolated test-only change follows established patterns, preserves console cleanup, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Stabilizes the import dry-run output test by removing its dependence on the build agent’s console width.

Changes:

  • Pins the captured console width to 200 to prevent wrapping inside JSON strings, matching existing console-capture tests.
File Description
CosmosDBShell.Tests/​CommandTests/​ImportCommandTests.cs Sets a fixed console width for dry-run output validation.

Review effort: Balanced

@github-code-quality

github-code-quality Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: C#

C# / code-coverage/dotnet

main 4ff7843 dev/mkrueger/fix-dry... 1b585d4 +/-
72% 72% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 26, 2026 16:00 UTC

Copilot AI balanced review requested due to automatic review settings October 26, 2026 15:54
@mkrueger Mike Krüger (mkrueger) changed the title Pin console width in import dry-run output test Keep long terminal JSON output valid Oct 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused rendering change addresses the wrapping failure with a matching regression test and no identified blocking issues.

No open issues 🎉

Review effort: Balanced

@mkrueger
Mike Krüger (mkrueger) enabled auto-merge (squash) October 26, 2026 15:58
@mkrueger
Mike Krüger (mkrueger) merged commit db49321 into main Oct 26, 2026
13 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/fix-dryrun-json-width branch October 26, 2026 16:07
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.

3 participants