Update Spectre.Console - #26
Conversation
Updates Spectre.Console to 0.56.0 and Spectre.Console.Cli to 0.55.0 (not released in lockstep), plus the matching testing packages. Adapts to two breaking changes: commands' ExecuteAsync now takes a CancellationToken and is protected, and CommandAppTester/CommandAppResult moved to the new Spectre.Console.Cli.Testing package and is now single-use (tests that ran it more than once use a fresh tester per run). Removes the CommandAppTesterExtensions reflection hack now that input can go through the tester's own console.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Upgrades Spectre.Console/Spectre.Console.Cli and adjusts the command/test infrastructure to match the new ExecuteAsync(CommandContext, CancellationToken) signature and the relocation of CommandAppTester.
Changes:
- Bumps Spectre.Console packages and adds
Spectre.Console.Cli.Testing. - Updates command base/command implementations to the new
ExecuteAsync(..., CancellationToken)method signature. - Refactors tests to use
Spectre.Console.Cli.Testing.CommandAppTesterand removes the reflection-based custom console runner.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SolarWinds.Changesets.Tests/Version/VersionChangesetCommandTests.cs | Switches test import to the new Spectre.Console.Cli.Testing namespace. |
| tests/SolarWinds.Changesets.Tests/Status/StatusChangesetCommandTests.cs | Uses Spectre.Console.Cli.Testing and runs init via a separate tester during setup. |
| tests/SolarWinds.Changesets.Tests/Publish/PublishChangesetCommandTests.cs | Uses Spectre.Console.Cli.Testing and runs init via a separate tester during setup. |
| tests/SolarWinds.Changesets.Tests/Init/InitCommandTests.cs | Refactors app creation to adapt to updated testing API usage. |
| tests/SolarWinds.Changesets.Tests/Add/CommandAppTesterExtensions.cs | Removes reflection-based helper no longer needed after package upgrade. |
| tests/SolarWinds.Changesets.Tests/Add/AddCommandTests.cs | Migrates interactive console input to the tester’s built-in console and uses CLI testing package. |
| tests/SolarWinds.Changesets.Tests/SolarWinds.Changesets.Tests.csproj | Adds reference to Spectre.Console.Cli.Testing. |
| src/SolarWinds.Changesets/Shared/ConfigurationCommandBase.cs | Updates command override signature to include CancellationToken. |
| src/SolarWinds.Changesets/Commands/Init/InitChangesetCommand.cs | Updates command override signature/docs to include CancellationToken. |
| Directory.Packages.props | Bumps Spectre.Console package versions and adds CLI testing version. |
| .changeset/upgrade-spectre-console.md | Adds changeset entry documenting the upgrade and API changes. |
magiino
left a comment
There was a problem hiding this comment.
Thank you for your contribution! 🚀 The changes are looking solid, and I really appreciate the clear and detailed overview of the updates.
|
@JohnCampionJr the commits are not verified. We can not merge the PR :/ https://docs.github.com/en/authentication/managing-commit-signature-verification Would you be able to squash all commits in this PR into a single commit and create a new verified commit? |
|
as we enforce signed commits, I have re-signed all, pulled changes to our repo, and created a new PR new PR: #31 |

Part of #16.
Updates Spectre.Console to 0.56.0 and Spectre.Console.Cli to 0.55.0, plus the matching testing packages.
Two breaking changes adapted:
Also removes the CommandAppTesterExtensions reflection hack tests now push input through the tester's console.