Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Update xunit to official 2.4.0 runner#31260

Merged
ViktorHofer merged 6 commits into
dotnet:masterfrom
ViktorHofer:XUnitRunner
Aug 23, 2018
Merged

Update xunit to official 2.4.0 runner#31260
ViktorHofer merged 6 commits into
dotnet:masterfrom
ViktorHofer:XUnitRunner

Conversation

@ViktorHofer
Copy link
Copy Markdown
Member

@ViktorHofer ViktorHofer commented Jul 23, 2018

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

  1. Update XUnit runner to 2.4.0

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:

  1. Update XUnit UWP runner

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:

  • uap
  • CI
  1. Enable Perf Tests for NetFX and promote perf projects to netstandard where applicable (95%).

  2. Add UAP test leg to CI

cc @danmosemsft

@ViktorHofer ViktorHofer added area-Infrastructure-libraries * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) labels Jul 23, 2018
@ViktorHofer ViktorHofer self-assigned this Jul 23, 2018
@ViktorHofer ViktorHofer requested review from safern and weshaggard July 23, 2018 00:44
@ViktorHofer ViktorHofer force-pushed the XUnitRunner branch 3 times, most recently from 3a8ab75 to d3b500d Compare July 23, 2018 14:30
Comment thread Directory.Build.props Outdated
<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;
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.

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"
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.

This can be written with * -- net472\xunit.console.*exe.config?

Comment thread Directory.Build.props Outdated
<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> -->
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.

Why are we adding this comments?

@ViktorHofer ViktorHofer force-pushed the XUnitRunner branch 16 times, most recently from 8b79f9b to e40c121 Compare August 12, 2018 17:22
Comment thread Directory.Build.props
<PropertyGroup>
<UAPvNextVersion>10.0.16300</UAPvNextVersion>
<UAPvNextTFMFull>UAP,Version=v$(UAPvNextVersion)</UAPvNextTFMFull>
<UAPvNextTFI>UAP</UAPvNextTFI>
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.

Why did we have to do this? do we expect the Moniker name to change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I just felt like it make sense to extract it and avoid the duplication. I don't know if it will ever change...

Comment thread Directory.Build.props
<!-- Output directories -->
<BinDir Condition="'$(BinDir)'==''">$(ProjectDir)bin/</BinDir>

<ObjDir Condition="'$(ObjDir)'==''">$(BinDir)obj/</ObjDir>
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.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ObjDir isn't used anywhere in buildtools

Comment thread out.txt Outdated
@@ -0,0 +1,105 @@
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
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.

Looks like you accidentally included this file.

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.

It was me 😆 I just deleted it in the last commit.

@ViktorHofer
Copy link
Copy Markdown
Member Author

@dotnet-bot test OSX x64 Debug Build please

@ViktorHofer
Copy link
Copy Markdown
Member Author

This PR is now ready to be merged as soon as microsoft.dotnet.uap.testtools.1.0.19.nupkg are pushed to our myget feed and CI is green.

@ViktorHofer
Copy link
Copy Markdown
Member Author

@dotnet-bot test UWP CoreCLR x64 Debug Build please

Comment thread Directory.Build.targets
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" />
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.

Should we put this condition into a property to avoid duplication?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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)**
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.

Should this point to arcade? Or not yet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread dependencies.props Outdated
@@ -185,8 +188,8 @@
</UpdateStep>
<XmlUpdateStep Include="BuildTools">
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.

Isn't this package coming from arcade now?

</PackageReference>
<PackageReference Include="Microsoft.DotNet.BuildTools.TestSuite">
<Version>$(XunitNetcoreExtensionsVersion)</Version>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions">
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.

I feel like this package id is used in various places, should we define a property for it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

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.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

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.

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" />
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.

Another usage of this guy.

protected static readonly string HostRunner = TestConsoleApp;

private static readonly string ExtraParameter = "";
protected static readonly string HostRunnerName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet";
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.

Should we use PlatformDetection instead?

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.

<PropertyGroup>
<BuildConfigurations>
netcoreapp;
netstandard;
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.

Why are we changing the perf tests configurations to netstandard?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Discussed offline. Promoting them to netstandard allows running in different configurations.

public partial class ProcessTests : ProcessTestBase
{
[Fact]
[ActiveIssue(31908, TargetFrameworkMonikers.Uap)]
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.

Should this be added to the class instead?

Copy link
Copy Markdown
Member Author

@ViktorHofer ViktorHofer Aug 23, 2018

Choose a reason for hiding this comment

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

As it's a partial class I didn't put it on the class as that leads to disabling all the ProcessTests for uap.

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.

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?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oh you are right. the netcoreapp file is also used in uap...

Copy link
Copy Markdown
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

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>
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.

Why do you need the Identifier and Version in some both not others?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@ViktorHofer
Copy link
Copy Markdown
Member Author

@dotnet-bot test this please

@4creators
Copy link
Copy Markdown
Contributor

@ViktorHofer Any plans on upgrading xunit to 2.4.0 in coreclr repo?

@ViktorHofer
Copy link
Copy Markdown
Member Author

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```
Copy link
Copy Markdown

@ahsonkhan ahsonkhan Oct 24, 2018

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment thread Directory.Build.props
<PropertyGroup>
<UAPvNextVersion>10.0.16300</UAPvNextVersion>
<UAPvNextTFMFull>UAP,Version=v$(UAPvNextVersion)</UAPvNextTFMFull>
<UAPvNextTFI>UAP</UAPvNextTFI>
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.

out of curiosity: what's TFI? Target Framework Identifier?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right.

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.