-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe 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. |
||
<HtmlTestResultsName>testResults.html</HtmlTestResultsName> | ||
<TestResultsName>$(HtmlTestResultsName)</TestResultsName> | ||
<TestRunnerConfigPath>$(MSBuildThisFileDirectory)vstest.xunit.json</TestRunnerConfigPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitVersion)" /> | ||
<PackageReference Include="XunitXml.TestLogger" Version="$(XUnitXmlTestLoggerVersion)" /> | ||
|
||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkVersion)" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="$(TestRunnerConfigPath)" | ||
CopyToOutputDirectory="PreserveNewest" | ||
Visible="false" /> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Just to understand, could you explain what's the difference in between There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Another blocker for enabling VSTest in CI is #1980. |
||
<RunArguments>test $(TargetFileName)</RunArguments> | ||
|
||
<!-- CLI options --> | ||
<RunArguments>$(RunArguments) --logger "xunit;LogFilePath=$(TestResultsName)"</RunArguments> | ||
<RunArguments>$(RunArguments) --nologo</RunArguments> | ||
<RunArguments>$(RunArguments) --logger "trx;LogFileName=$(TrxTestResultsName)"</RunArguments> | ||
<RunArguments>$(RunArguments) --logger "html;LogFileName=$(HtmlTestResultsName)"</RunArguments> | ||
<RunArguments>$(RunArguments) --framework $(TargetFramework)</RunArguments> | ||
<RunArguments>$(RunArguments) --platform $(ArchGroup)</RunArguments> | ||
<RunArguments Condition="'$(TestDisableParallelization)' != 'true'">$(RunArguments) --parallel</RunArguments> | ||
|
@@ -27,6 +30,7 @@ | |
<!-- RunConfiguration settings. --> | ||
<RunSettingsOptions Condition="'$(TestDisableParallelization)' == 'true'">$(RunSettingsOptions) RunConfiguration.DisableParallelization=true</RunSettingsOptions> | ||
<RunSettingsOptions Condition="'$(TestDisableAppDomain)' == 'true'">$(RunSettingsOptions) RunConfiguration.DisableAppDomain=true</RunSettingsOptions> | ||
<RunArguments Condition="'$(RunSettingsOptions)' != ''">$(RunArguments) --(RunSettingsOptions)</RunArguments> | ||
<RunSettingsOptions>$(RunSettingsOptions) RunConfiguration.DotNetHostPath="$(RunScriptHost)"</RunSettingsOptions> | ||
<RunArguments>$(RunArguments) --$(RunSettingsOptions)</RunArguments> | ||
</PropertyGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"diagnosticMessages": false, | ||
"longRunningTestSeconds": 120, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 |
||
"shadowCopy": false | ||
} |
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.