Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 22, 2024

Description

I have some external tests that invoke some of the SDK's cobra commands. Those tests often involve creating the command, calling cmd.SetOutput, executing the command, and then inspecting its output.

This change updates the client context to prefer cmd.Output if set (which should only happen in tests), falling back to stdout otherwise; so it should not change any existing client-facing behavior, but it does otherwise make command output testable.

Summary by CodeRabbit

  • New Features

    • Enhanced command context to include output capabilities, improving how outputs are handled in the application.
  • Tests

    • Introduced a new test to verify command output when using the updated context, ensuring reliability in output handling.

This is an automatic backport of pull request #22334 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team October 22, 2024 23:15
@github-actions github-actions bot added the C:CLI label Oct 22, 2024
@julienrbrt julienrbrt merged commit d6028b1 into release/v0.52.x Oct 22, 2024
70 of 72 checks passed
@julienrbrt julienrbrt deleted the mergify/bp/release/v0.52.x/pr-22334 branch October 22, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants