Skip to content

Conversation

mitchdenny
Copy link
Member

This PR starts to lay the groundwork for improving our testing story for the CLI. It does a few things:

Introduces an IDotNetCliRunner so that we can mock out executing CLI commands. Adds a couple of test classes - one for each command and some plumbing to support creating the service collection.

At the moment the test cases only cover making sure the --help command runs - a sort of smoke test.

@Copilot Copilot AI review requested due to automatic review settings April 8, 2025 23:50
@mitchdenny mitchdenny changed the title Minimal changes Minimal changes to improve CLI testability. Apr 8, 2025
@mitchdenny mitchdenny marked this pull request as draft April 8, 2025 23:51
@mitchdenny mitchdenny added this to the 9.2 milestone Apr 8, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

@mitchdenny mitchdenny force-pushed the mitchdenny/cli-testability-1 branch from 15354ed to 1e533c7 Compare April 8, 2025 23:52
@mitchdenny mitchdenny modified the milestones: 9.2, 9.3 Apr 9, 2025
Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

Nice! Except for the excess use of tuples

@mitchdenny
Copy link
Member Author

Once 9.2 ships we can get to work on those

async (context) => {
return await runner.GetAppHostInformationAsync(projectFile, cancellationToken);
});
var appHostInformationResult = await InteractionUtils.ShowStatusAsync(
Copy link
Member

Choose a reason for hiding this comment

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

This should also be an interface too right?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be eventually. I'm just starting to gather up everything first to centralise the dependency

@mitchdenny mitchdenny marked this pull request as ready for review April 10, 2025 22:31
@mitchdenny mitchdenny merged commit c7ddaf1 into main Apr 10, 2025
175 checks passed
@mitchdenny mitchdenny deleted the mitchdenny/cli-testability-1 branch April 10, 2025 22:31
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants