Skip to content

Add ability to use custom runsettings for tests#1710

Merged
filipw merged 5 commits intoOmniSharp:masterfrom
Samirat:samirat/pr_to_omnisharp
Mar 3, 2020
Merged

Add ability to use custom runsettings for tests#1710
filipw merged 5 commits intoOmniSharp:masterfrom
Samirat:samirat/pr_to_omnisharp

Conversation

@Samirat
Copy link
Copy Markdown
Contributor

@Samirat Samirat commented Feb 12, 2020

Currently, the RunSettings are sent to Omnisharp as a a path, and then loaded. Alternatively, we could load the runsettings in the extension, and then send XML with the request.

Related PR to omnisharp-vscode: dotnet/vscode-csharp#3573

}

public override GetTestStartInfoResponse GetTestStartInfo(string methodName, string testFrameworkName, string targetFrameworkVersion)
public override GetTestStartInfoResponse GetTestStartInfo(string methodName, string runSettings, string testFrameworkName, string targetFrameworkVersion)
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.

normally we do not break the public APIs but this particular package is no published on nuget, so it's OK

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even though these functions are public, TestManager and VSTestManager are actually internal classes, so there probably isn't any worry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was more concerned about the changes to the over-the-wire interface. At least the stdio version of the server seems to treat arguments as optional, in which case I think everything remains compatible.

{
if (runSettingsPath != null)
{
return File.ReadAllText(runSettingsPath);
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.

you should check if the file exists, if not, I'd fallback to defaults to not crash?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added an error message if runsettings load fails, and it will continue with default settings.

[Fact]
public async Task RunMSTestWithoutRunSettings()
{
await RunDotNetTestAsync(
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.

if this is supposed to fail, could you assert on some failure conditions to distinguish a "failure by design" from "failure because something got broken"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added some additional assertions.

@filipw
Copy link
Copy Markdown
Member

filipw commented Mar 2, 2020

thanks a lot for the PR - looks very good, just left some small comments

Copy link
Copy Markdown
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@filipw
Copy link
Copy Markdown
Member

filipw commented Mar 3, 2020

@JoeRobich @mholo65 @david-driscoll any objections on this?

@filipw filipw merged commit b60f3e4 into OmniSharp:master Mar 3, 2020
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