-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make VSTest runner work and enable html log #33915
Conversation
08007de
to
6d13cb3
Compare
6d13cb3
to
0ac4ab5
Compare
The VSTest runner is now supposed to work with the /p:TestRunner=vstest switch. Currently this is an opt-in but the desire is to get rid of xunit.console completely and just use VSTest.
0ac4ab5
to
df5c90a
Compare
Thanks. What does an error like this mean?
Did the test run and it just can't report on it, or did it skip it? |
It ran completely but it can't fetch individual data rows, means you won't be able to debug individual data rows in VS Test Explorer. I can only hide those diagnostic messages by disabling all, which might be possible as we only used them for the long running test support for which VSTest might have integrated support. |
Are we going to have a workflow in place to make changes in the VSTest runner that are required for not-yet-released .NET Core versions? For example, let's say that that we add a new platform and this starts failing. How we are going to make progress? I am asking about this because of I am stuck on a similar problem with BenchmarkDotNet in #33694. |
We already consume vstest via dependency flow which means getting live updates which aren't bound to VS releases. Additionally to that, we are actively collaborating with the vstest team (cc @nohwnd) and benefiting from each other. |
@@ -2,19 +2,15 @@ | |||
<PropertyGroup> | |||
<!-- Microsoft.Net.Test.Sdk brings a lot of satellite assemblies in. --> | |||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages> | |||
<TrxTestResultsName>testResults.trx</TrxTestResultsName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if the helix sdk supports .trx files to show the test results in AzDo, submitting to kusto and failing the build? If not we should request a feature for when we want to move to use this as our default test runner. cc: @alexperovich
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helix supports trx files for uploading to azure devops. Kusto is only supported for xunit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a lot of people use Kusto for metrics and what not as the AzDo APIs aren't that great to get test results and search through them. Would it be possible to add Kusto from a trx file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The support for processing xunit results into kusto is on the server side for helix and extending that for other formats would be a very large an potentially disruptive change. The azure devops uploading code is in arcade and very easy to change so it supports many formats. My understanding is that we want to consolidate everything to azure devops and make that experience better, rather than continue investing in our custom reporting. @Chrisboh may have more context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I knew that trx is supported but I didn't know about Kusto only working with the xunit xml format.
@@ -1,10 +1,13 @@ | |||
<Project> | |||
<PropertyGroup> | |||
<RunCommand>"$(RunScriptHost)"</RunCommand> | |||
<RunCommand>"$(DotNetTool)"</RunCommand> | |||
<RunCommand Condition="'$(ContinuousIntegrationBuild)' == 'true'">dotnet</RunCommand> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to understand, could you explain what's the difference in between DotNetTool
and dotnet
and why does it has to be different in CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DotNetTool is a property set by Arcade, mean it's available during the test invocation on your machine. On a different machine you don't want to hardcode the path into the RunTemplate.cmd/sh. There is more work required here anyway to make this work on CI.
My goal in a subsequent PR is to just use dotnet here instead and then for local local development, modify PATH to point to the RunScriptHost if not on CI. As said, I don't want to do this now as this just enables VSTest optionally and not on CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another blocker for enabling VSTest in CI is #1980.
@@ -0,0 +1,5 @@ | |||
{ | |||
"diagnosticMessages": false, | |||
"longRunningTestSeconds": 120, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this support is now built-in in VSTest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but I still need to play around with it. There's a blame mode which creates a sequence.xml which tells you which tests have run and which haven't but I don't know if that mode slows down the test invocation. cc @nohwnd
@@ -118,7 +118,6 @@ | |||
<XUnitVersion>2.4.1</XUnitVersion> | |||
<TraceEventVersion>2.0.5</TraceEventVersion> | |||
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion> | |||
<XUnitXmlTestLoggerVersion>2.1.26</XUnitXmlTestLoggerVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed? Just left-over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this was introduced only for vstest in a past PR but actually we don't need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for solving all my questions.
Issue was #32377. |
The VSTest runner is now supposed to work with the
/p:TestRunner=vstest
switch. Currently this is an opt-in but the desire is to get rid of
xunit.console completely and just use VSTest.
An html and trx log example for System.Text.RegularExpressions.Tests: testResults.zip
cc @stephentoub @danmosemsft