-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Update xunit to official 2.4.0 runner #31260
Changes from all commits
3d223d3
f528b66
bfb6d9c
1b33f6c
591f0b5
c54d4a2
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.2.0-preview1-03116-01 | ||
| 2.2.0-preview1-03122-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,8 @@ | |
| <!-- Define vNext UAP Moniker --> | ||
| <PropertyGroup> | ||
| <UAPvNextVersion>10.0.16300</UAPvNextVersion> | ||
| <UAPvNextTFMFull>UAP,Version=v$(UAPvNextVersion)</UAPvNextTFMFull> | ||
| <UAPvNextTFI>UAP</UAPvNextTFI> | ||
|
Member
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. out of curiosity: what's TFI? Target Framework Identifier?
Member
Author
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. right. |
||
| <UAPvNextTFMFull>$(UAPvNextTFI),Version=v$(UAPvNextVersion)</UAPvNextTFMFull> | ||
| <UAPvNextTFM>uap$(UAPvNextVersion)</UAPvNextTFM> | ||
| </PropertyGroup> | ||
|
|
||
|
|
@@ -45,9 +46,7 @@ | |
|
|
||
| <!-- Output directories --> | ||
| <BinDir Condition="'$(BinDir)'==''">$(ProjectDir)bin/</BinDir> | ||
|
|
||
| <ObjDir Condition="'$(ObjDir)'==''">$(BinDir)obj/</ObjDir> | ||
|
Member
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. 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.
Member
Author
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. ObjDir isn't used anywhere in buildtools |
||
| <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">$(ObjDir)</BaseIntermediateOutputPath> | ||
|
|
||
| <TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BinDir)tests/</TestWorkingDir> | ||
| <PackageOutputRoot Condition="'$(PackageOutputRoot)'=='' and '$(NonShippingPackage)' == 'true'">$(BinDir)packages_noship/</PackageOutputRoot> | ||
| <PackageOutputRoot Condition="'$(PackageOutputRoot)'==''">$(BinDir)packages/</PackageOutputRoot> | ||
|
|
@@ -88,6 +87,7 @@ | |
| https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; | ||
| https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; | ||
| https://api.nuget.org/v3/index.json; | ||
| https://www.myget.org/F/xunit/api/v3/index.json; | ||
|
Member
Author
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. This is temporary till xunit bugfixes
Member
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. We probably need something tracking removing it somehow lest it cause some subtle problem in the future.
Member
Author
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. |
||
| $(OverridePackageSource); | ||
| $(RestoreSources) | ||
| </RestoreSources> | ||
|
|
@@ -166,9 +166,8 @@ | |
| <PropertyGroup> | ||
| <TargetsNetCoreApp Condition="$(TargetGroup.StartsWith('netcoreapp'))">true</TargetsNetCoreApp> | ||
| <TargetsUap Condition="$(TargetGroup.StartsWith('uap'))">true</TargetsUap> | ||
| <TargetsNetStandard Condition="$(TargetGroup.StartsWith('netstandard'))">true</TargetsNetStandard> | ||
| <TargetsNetCoreApp Condition="$(TargetGroup.StartsWith('netcoreapp'))">true</TargetsNetCoreApp> | ||
| <TargetsAot Condition="$(TargetGroup.EndsWith('aot'))">true</TargetsAot> | ||
| <TargetsNetStandard Condition="$(TargetGroup.StartsWith('netstandard'))">true</TargetsNetStandard> | ||
| <TargetsNetFx Condition="$(TargetGroup.StartsWith('net4')) OR '$(TargetGroup)' == 'netfx'">true</TargetsNetFx> | ||
| </PropertyGroup> | ||
|
|
||
|
|
@@ -260,6 +259,15 @@ | |
|
|
||
| <!-- Set up the default output and intermediate paths --> | ||
| <PropertyGroup> | ||
| <!-- | ||
| Microsoft.NET.TargetFrameworkInference.targets appends the TargetFramework. | ||
| We do this manually and use the TargetGroup instead. | ||
| --> | ||
| <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
|
|
||
| <!-- Suppress preview message as we are usually using preview SDK versions. --> | ||
| <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> | ||
|
|
||
| <OSPlatformConfig>$(OSGroup).$(Platform).$(ConfigurationGroup)</OSPlatformConfig> | ||
| <TargetOutputRelPath Condition="'$(TargetGroup)'!=''">$(TargetGroup)/</TargetOutputRelPath> | ||
|
|
||
|
|
@@ -268,8 +276,8 @@ | |
| <OutputPathSubfolder Condition="'$(IsCompatAssembly)'=='true'">/Compat</OutputPathSubfolder> | ||
| <OutputPath Condition="'$(OutputPath)'==''">$(BaseOutputPath)$(OSPlatformConfig)/$(MSBuildProjectName)/$(TargetOutputRelPath)$(OutputPathSubfolder)</OutputPath> | ||
|
|
||
| <IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(BaseIntermediateOutputPath)$(OSPlatformConfig)/</IntermediateOutputRootPath> | ||
| <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(IntermediateOutputRootPath)$(MSBuildProjectName)/$(TargetOutputRelPath)</IntermediateOutputPath> | ||
| <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'==''">$(RootIntermediateOutputPath)$(OSPlatformConfig)/$(MSBuildProjectName)/</BaseIntermediateOutputPath> | ||
| <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseIntermediateOutputPath)$(TargetOutputRelPath)</IntermediateOutputPath> | ||
|
|
||
| <RuntimePath Condition="'$(RuntimePath)' == ''">$(BinDir)runtime/$(BuildConfiguration)/</RuntimePath> | ||
| <ShimsTargetRuntimeRoot>$(BinDir)shimsTargetRuntime/</ShimsTargetRuntimeRoot> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,17 @@ | |
| <SuppressPackageTargetFrameworkCompatibility Include="$(UAPvNextTFM)" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- | ||
| Import Test SDK props and targets. | ||
| This needs to happen here as the IsInvokableTestProject prop is required | ||
| which isn't available before Directory.Build.targets. | ||
| TODO: Fix VB test project reference to Test SDK. | ||
|
Member
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. Is this TODO part of this PR?
Member
Author
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. No that's an open issue: https://github.com/dotnet/corefx/issues/31875 |
||
| --> | ||
| <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" /> | ||
|
Member
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. Should we put this condition into a property to avoid duplication?
Member
Author
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. Same as XUnitExtensions. Not going to do this now, let's consider it for a later clean up. |
||
| <Import Condition="'$(IncludeVSTestReferences)' == 'true' AND ('$(BuildingNETCoreAppVertical)' == 'true' OR '$(BuildingNETFxVertical)' == 'true') AND '$(Language)' != 'VB'" Project="$(PackagesDir)\microsoft.net.test.sdk\$(MicrosoftDotNetTestSdkVersion)\build\netcoreapp1.0\Microsoft.Net.Test.Sdk.targets" /> | ||
| <Import Condition="'$(IncludeVSTestReferences)' == 'true' AND ('$(BuildingNETCoreAppVertical)' == 'true' OR '$(BuildingNETFxVertical)' == 'true')" Project="$(PackagesDir)\microsoft.codecoverage\$(MicrosoftDotNetTestSdkVersion)\build\netstandard1.0\Microsoft.CodeCoverage.targets" /> | ||
|
|
||
| <Target Name="ProducesPackageId" | ||
| Returns="@(PackageIds)"> | ||
| <ItemGroup> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,7 +270,7 @@ msbuild System.Runtime.Tests.csproj /p:TargetGroup=netfx | |
|
|
||
| #### Filtering tests using traits | ||
|
|
||
| The tests can also be filtered based on xunit trait attributes defined in [`xunit.netcore.extensions`](https://github.com/dotnet/buildtools/tree/master/src/xunit.netcore.extensions). These attributes are specified above the test method's definition. The available attributes are: | ||
| The tests can also be filtered based on xunit trait attributes defined in [`Microsoft.DotNet.XUnitExtensions`](https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.XUnitExtensions). These attributes are specified above the test method's definition. The available attributes are: | ||
|
|
||
| #### OuterloopAttribute | ||
|
|
||
|
|
@@ -298,7 +298,7 @@ Use this attribute on test methods to specify that this test may only be run on | |
| - `nonlinuxtests` for tests that don't run on Linux | ||
| - `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)** | ||
|
Member
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. Should this point to arcade? Or not yet?
Member
Author
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. done. |
||
|
|
||
| When running tests by building a test project, tests that don't apply to the `OSGroup` are not run. For example, to run Linux-specific tests on a Linux box, use the following command line: | ||
| ```sh | ||
|
|
@@ -350,7 +350,7 @@ Use this attribute over test methods to skip tests only on the specific target f | |
|
|
||
| If it needs to be skipped in multiple frameworks and the reasons are different please use two attributes on the same test so that you can specify different reasons for each framework. | ||
|
|
||
| **Currently this are the [Framework Monikers](https://github.com/dotnet/buildtools/blob/master/src/xunit.netcore.extensions/TargetFrameworkMonikers.cs#L23-L26) that we support through our test execution infrastructure** | ||
| **Currently this are the [Framework Monikers](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.XUnitExtensions/TargetFrameworkMonikers.cs#L23-L26) that we support through our test execution infrastructure** | ||
|
|
||
| #### ConditionalFactAttribute | ||
| Use this attribute to run the test only when a condition is `true`. This attribute is used when `ActiveIssueAttribute` or `SkipOnTargetFrameworkAttribute` are not flexible enough due to needing to run a custom logic at test time. This test behaves as a `[Fact]` test that has no test data passed in as a parameter. | ||
|
|
@@ -431,7 +431,7 @@ msbuild <csproj_file> /t:BuildAndTest /p:OSGroup=Windows_NT | |
|
|
||
| Alternatively, you can directly invoke the XUnit executable by changing your working directory to the test execution directory at `bin\tests\{OSPlatformConfig)\{Project}.Tests\{TargetGroup}.{TestTFM}\` which is created when the test project is built. For example, the following command runs all Linux-supported inner-loop tests: | ||
| ```sh | ||
| ./corerun xunit.console.netcore.exe <test_dll_file> -notrait category=nonlinuxtests -notrait category=OuterLoop | ||
| ./corerun xunit.console.dll <test_dll_file> -notrait category=nonlinuxtests -notrait category=OuterLoop | ||
| ``` | ||
|
|
||
| ### Code Coverage | ||
|
|
@@ -460,7 +460,7 @@ cd src\Microsoft.CSharp\tests | |
| ::TODO: The exact properties needed for .NET Native tests runs after engineering work is TBD | ||
| msbuild /t:BuildAndTest /p:TargetGroup=uap /p:UseDotNetNativeToolchain=true | ||
| ``` | ||
| If native compilation succeeds, the test will build and run as a native executable named "xunit.console.netcore.exe" in a folder named "native" in the test execution folder. Note many tests in CoreFX are not ready to run though native compilation yet. | ||
| If native compilation succeeds, the test will build and run as a native executable named "xunit.console.dll" in a folder named "native" in the test execution folder. Note many tests in CoreFX are not ready to run though native compilation yet. | ||
|
|
||
| A slight variation on these arguments will allow you to build and run against `uap`, the managed version of the UWP Framework subset, used when debugging UWP applications in Visual Studio: | ||
| ```cmd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ Performance test files (if present) are stored within a library's ```tests/Perfo | |
| **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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am curious, why was It looks like we need it to actually run the tests. Otherwise, they just build. Without: With: Should we add it back?
Member
Author
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 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. |
||
| - Linux: ```<repo-root>/Tools/msbuild.sh /t:BuildAndTest /p:Performance=true /p:ConfigurationGroup=Release /p:TargetOS=Linux``` | ||
| - Windows (using admin command shell): ```msbuild /t:BuildAndTest /p:ConfigurationGroup=Release``` | ||
| - Linux: ```<repo-root>/Tools/msbuild.sh /t:BuildAndTest /p:ConfigurationGroup=Release``` | ||
|
|
||
| **Note: Because build-tests.cmd/sh runs tests concurrently, do not use it for executing performance tests.** | ||
| **Note: Because build-tests.cmd/sh runs tests concurrently, do not use it for executing performance tests. If you still want to run them concurrently you need to pass the flag `/p:Performance=true` to it: `build-tests -release -- /p:Performance=true`.** | ||
|
Member
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. Why would you ever run the concurrently - just to check for functional correctness? Worth a note
Member
Author
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 perf.groovy script runs them that way: https://github.com/dotnet/corefx/blob/master/perf.groovy#L99
Member
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. Must be for correctness. @jorive
Member
Author
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. That and gathering results that are time independent like allocation. (was my guess) 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. @danmosemsft That flag was inherit from the unit projects/msbuild. At the moment, we do not run benchmarks concurrently. On the other hand, we could use it for correctness, but I believe it will only work with profile off. |
||
|
|
||
| The results files will be dropped in corefx/bin/tests/FLAVOR/TESTLIBRARY/TARGETFRAMEWORK. The console output will also specify the location of these files. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,6 +246,12 @@ | |
| "values": [], | ||
| "defaultValue": "" | ||
| }, | ||
| "Performance": { | ||
| "description": "Enables/Disables performance test execution.", | ||
| "valueType": "property", | ||
| "values": ["True", "False"], | ||
| "defaultValue": false | ||
| }, | ||
| }, | ||
| "commands": { | ||
| "build-directory": { | ||
|
|
@@ -334,14 +340,16 @@ | |
| "tests": { | ||
| "description": "Builds src and then builds and runs the tests for the given configuration.", | ||
| "settings": { | ||
| "BuildTests": true | ||
| "BuildTests": true, | ||
| "Performance": "default" | ||
| } | ||
| }, | ||
| "testsOnly": { | ||
| "description": "Builds and runs the tests for the given configuration.", | ||
| "settings": { | ||
| "Project": "src/tests.builds", | ||
| "MsBuildLogging":"/flp:v=normal;LogFile=build-tests.log" | ||
| "MsBuildLogging":"/flp:v=normal;LogFile=build-tests.log", | ||
| "Performance": "default" | ||
|
Member
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. Don't we also have to add this for the above alias? (tests)
Member
Author
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. thanks, will add it. though not sure if that one is still in use. |
||
| } | ||
| }, | ||
| "debug": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| netcoreappaot; | ||
| netstandard; | ||
| netfx; | ||
| netcoreapp; | ||
| </BuildConfigurations> | ||
| </PropertyGroup> | ||
| </Project> | ||
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 did we have to do this? do we expect the Moniker name to change?
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 just felt like it make sense to extract it and avoid the duplication. I don't know if it will ever change...