Update xunit to official 2.4.0 runner#31260
Conversation
3a8ab75 to
d3b500d
Compare
| <PropertyGroup> | ||
| <RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'"> | ||
| https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; | ||
| https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json; |
There was a problem hiding this comment.
We should put this package on an existing feed instead of adding this feed to the list.
| Include="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\*.*" | ||
| Exclude="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\xunit.console.exe.config" | ||
| Include="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\net472\*.*" | ||
| Exclude="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\net472\xunit.console.exe.config;$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\net472\xunit.console.x86.exe.config" |
There was a problem hiding this comment.
This can be written with * -- net472\xunit.console.*exe.config?
| <TargetsNetStandard Condition="$(TargetGroup.StartsWith('netstandard'))">true</TargetsNetStandard> | ||
| <TargetsNetCoreApp Condition="$(TargetGroup.StartsWith('netcoreapp'))">true</TargetsNetCoreApp> | ||
| <TargetsAot Condition="$(TargetGroup.EndsWith('aot'))">true</TargetsAot> | ||
| <!-- <TargetFrameworkIdentifier Condition="'$(TargetsNetCoreApp)' == 'true' OR '$(TargetsUap)' == 'true' OR '$(TargetsAot)' == 'true'">.NETCoreApp</TargetFrameworkIdentifier> --> |
There was a problem hiding this comment.
Why are we adding this comments?
8b79f9b to
e40c121
Compare
| <PropertyGroup> | ||
| <UAPvNextVersion>10.0.16300</UAPvNextVersion> | ||
| <UAPvNextTFMFull>UAP,Version=v$(UAPvNextVersion)</UAPvNextTFMFull> | ||
| <UAPvNextTFI>UAP</UAPvNextTFI> |
There was a problem hiding this comment.
Why did we have to do this? do we expect the Moniker name to change?
There was a problem hiding this comment.
I just felt like it make sense to extract it and avoid the duplication. I don't know if it will ever change...
| <!-- Output directories --> | ||
| <BinDir Condition="'$(BinDir)'==''">$(ProjectDir)bin/</BinDir> | ||
|
|
||
| <ObjDir Condition="'$(ObjDir)'==''">$(BinDir)obj/</ObjDir> |
There was a problem hiding this comment.
Makes me a bit worried the fact that we are not defining this property anymore. I wonder if there will be any side effects like stuff binplaced now on the source tree.
There was a problem hiding this comment.
ObjDir isn't used anywhere in buildtools
| @@ -0,0 +1,105 @@ | |||
| Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework | |||
| Copyright (C) Microsoft Corporation. All rights reserved. | |||
There was a problem hiding this comment.
Looks like you accidentally included this file.
There was a problem hiding this comment.
It was me 😆 I just deleted it in the last commit.
|
@dotnet-bot test OSX x64 Debug Build please |
|
This PR is now ready to be merged as soon as |
|
@dotnet-bot test UWP CoreCLR x64 Debug Build please |
| TODO: Fix VB test project reference to Test SDK. | ||
| --> | ||
| <Import Condition="'$(IncludeVSTestReferences)' == 'true' AND '$(Language)' != 'VB'" Project="$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\buildMultiTargeting\Microsoft.Net.Test.Sdk.props" /> | ||
| <Import Condition="'$(IncludeVSTestReferences)' == 'true' AND ('$(BuildingNETCoreAppVertical)' == 'true' OR '$(BuildingNETFxVertical)' == 'true')" Project="$(PackagesDir)\microsoft.codecoverage\$(MicrosoftDotNetTestSdkVersion)\build\netstandard1.0\Microsoft.CodeCoverage.props" /> |
There was a problem hiding this comment.
Should we put this condition into a property to avoid duplication?
There was a problem hiding this comment.
Same as XUnitExtensions. Not going to do this now, let's consider it for a later clean up.
| - `nonosxtests` for tests that don't run on OS X | ||
|
|
||
| **[Available Test Platforms](https://github.com/dotnet/buildtools/blob/master/src/xunit.netcore.extensions/TestPlatforms.cs#L10)** | ||
| **[Available Test Platforms](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.XUnitExtensions/TestPlatforms.cs#L10)** |
There was a problem hiding this comment.
Should this point to arcade? Or not yet?
| @@ -185,8 +188,8 @@ | |||
| </UpdateStep> | |||
| <XmlUpdateStep Include="BuildTools"> | |||
There was a problem hiding this comment.
Isn't this package coming from arcade now?
| </PackageReference> | ||
| <PackageReference Include="Microsoft.DotNet.BuildTools.TestSuite"> | ||
| <Version>$(XunitNetcoreExtensionsVersion)</Version> | ||
| <PackageReference Include="Microsoft.DotNet.XUnitExtensions"> |
There was a problem hiding this comment.
I feel like this package id is used in various places, should we define a property for it?
There was a problem hiding this comment.
Will not converge these for now as I don't think it's worth introducing a separate property. Let's deal with this at a later point.
There was a problem hiding this comment.
I think it is worth because if at some point we rename this package again, we just change one property instead of 20 different sites.
There was a problem hiding this comment.
we use it in 3 places in corefx and once in buildtools. I don't want to touch it now as we are moving the test framework to arcade and this will change. also I don't want to change buildtools again.
There was a problem hiding this comment.
Fair enough. Something to keep in mind for next iteration though.
| <Reference Include="System.Runtime.InteropServices" /> | ||
| <ReferenceFromRuntime Include="xunit.core" /> | ||
| <ReferenceFromRuntime Include="Xunit.NetCore.Extensions" /> | ||
| <ReferenceFromRuntime Include="Microsoft.DotNet.XUnitExtensions" /> |
| protected static readonly string HostRunner = TestConsoleApp; | ||
|
|
||
| private static readonly string ExtraParameter = ""; | ||
| protected static readonly string HostRunnerName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"; |
There was a problem hiding this comment.
Should we use PlatformDetection instead?
There was a problem hiding this comment.
Add necessary Test SDK assemblies Enable test sdk props & targets only for netcoreapp
| <PropertyGroup> | ||
| <BuildConfigurations> | ||
| netcoreapp; | ||
| netstandard; |
There was a problem hiding this comment.
Why are we changing the perf tests configurations to netstandard?
There was a problem hiding this comment.
Discussed offline. Promoting them to netstandard allows running in different configurations.
| public partial class ProcessTests : ProcessTestBase | ||
| { | ||
| [Fact] | ||
| [ActiveIssue(31908, TargetFrameworkMonikers.Uap)] |
There was a problem hiding this comment.
Should this be added to the class instead?
There was a problem hiding this comment.
As it's a partial class I didn't put it on the class as that leads to disabling all the ProcessTests for uap.
There was a problem hiding this comment.
But you're already adding it to ProcessTests.cs (Also weird enough, this file is named .netcoreapp.cs and disabling tests for uap in here?)
There was a problem hiding this comment.
oh you are right. the netcoreapp file is also used in uap...
safern
left a comment
There was a problem hiding this comment.
Some minor feedback and questions. Once addressed LGTM.
Disable/Enable tests for clean uap CI leg
| <!-- uap is an alias for uapvNext any/coreclr runtime --> | ||
| <TargetGroups Include="uap"> | ||
| <TargetFramework>$(UAPvNextTFM)</TargetFramework> | ||
| <TargetFrameworkIdentifier>$(UAPvNextTFI)</TargetFrameworkIdentifier> |
There was a problem hiding this comment.
Why do you need the Identifier and Version in some both not others?
There was a problem hiding this comment.
They are currently only inferred by the SDK for netcoreapp, netstandard and net: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L18
|
@dotnet-bot test this please |
|
@ViktorHofer Any plans on upgrading xunit to 2.4.0 in coreclr repo? |
|
Isn't coreclr already using xunit 2.4? https://github.com/dotnet/coreclr/blob/master/dependencies.props#L41 |
| **Step # 2:** Change directory to the performance tests directory: ```cd path/to/library/tests/Performance``` | ||
|
|
||
| **Step # 3:** Build and run the tests: | ||
| - Windows (using admin command shell): ```msbuild /t:BuildAndTest /p:Performance=true /p:ConfigurationGroup=Release /p:TargetOS=Windows_NT``` |
There was a problem hiding this comment.
I am curious, why was /p:Performance=true removed from the instructions here?
It looks like we need it to actually run the tests. Otherwise, they just build.
Without:
E:\GitHub\Fork\corefx\src\System.Memory\tests\Performance>dotnet msbuild /t:BuildAndTest /p:ConfigurationGroup=Release
Microsoft (R) Build Engine version 15.9.19+g938f3292a0 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
PerfRunner -> E:\GitHub\Fork\corefx\bin\AnyOS.AnyCPU.Release\PerfRunner\netstandard\PerfRunner.exe
System.Memory.Performance.Tests -> E:\GitHub\Fork\corefx\bin\AnyOS.AnyCPU.Release\System.Memory.Performance.Tests\netcoreapp\System.Memory.Performance.Tests.dll
With:
E:\GitHub\Fork\corefx\src\System.Memory\tests\Performance>dotnet msbuild /t:BuildAndTest /p:ConfigurationGroup=Release /p:Performance=true
Microsoft (R) Build Engine version 15.9.19+g938f3292a0 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
PerfRunner -> E:\GitHub\Fork\corefx\bin\AnyOS.AnyCPU.Release\PerfRunner\netstandard\PerfRunner.exe
System.Memory.Performance.Tests -> E:\GitHub\Fork\corefx\bin\AnyOS.AnyCPU.Release\System.Memory.Performance.Tests\netcoreapp\System.Memory.Performance.Tests.dll
Using E:\GitHub\Fork\corefx\bin\testhost\netcoreapp-Windows_NT-Release-x64\ as the test runtime folder.
Executing in E:\GitHub\Fork\corefx\bin\tests\System.Memory.Performance.Tests\netcoreapp-Windows_NT-Release-x64\
----- start 13:11:21.67 =============== To repro directly: =====================================================
...
results
...
Should we add it back?
There was a problem hiding this comment.
I removed it from the docs because with that PR I enabled running perf test projects without the /p:Performance=true flag. Unfortunately @weshaggard had to default the performance flag to false when he switched to the new bootstrapping model: 66392f5#diff-4b2f402501d23abbede6eac0f47783e4R127
I'll update the docs.
| <PropertyGroup> | ||
| <UAPvNextVersion>10.0.16300</UAPvNextVersion> | ||
| <UAPvNextTFMFull>UAP,Version=v$(UAPvNextVersion)</UAPvNextTFMFull> | ||
| <UAPvNextTFI>UAP</UAPvNextTFI> |
There was a problem hiding this comment.
out of curiosity: what's TFI? Target Framework Identifier?
Fixes https://github.com/dotnet/corefx/issues/31319
Fixes https://github.com/dotnet/corefx/issues/31761
Fixes https://github.com/dotnet/corefx/issues/31886
Fixes https://github.com/dotnet/corefx/issues/21483
Depends on package publish of dotnet/arcade#352
Depends on dotnet/buildtools#2106
Depends on package publish of microsoft/xunit-performance#269 (which would depend on commandlineparser/commandline#307 but I have pushed a package to nuget till the PR is merged and an updated package is uploaded)
Depends on package publish of microsoft/xunit-performance#270 (same but for Wheelies/MarkdownLog#16)
Scenarios tested:
Depends on dotnet/arcade#355
Runs the uap tests in a console application which supports multi-instancing. Remove specific UWP RemoteExecutor code in corefx and the whole service project in buildtools
(https://github.com/dotnet/buildtools/tree/master/src/xunit.runner.uap - I won't delete that until everything's merged). This allows CI integration of our uap test suite and also enables setting different cultures as RemoteExecutor code now truly lives in a separate process instead of a single process.
Scenarios tested:
Enable Perf Tests for NetFX and promote perf projects to netstandard where applicable (95%).
Add UAP test leg to CI
cc @danmosemsft