diff --git a/.azure/pipelines/helix-test.yml b/.azure/pipelines/helix-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..2bd5284917f8519c4396e8412f93ad2f9fda52d4 --- /dev/null +++ b/.azure/pipelines/helix-test.yml @@ -0,0 +1,28 @@ +# Don't run CI for this config yet. We're not ready to move official builds on to Azure Pipelines +trigger: none + +# Run PR validation on all branches +pr: + branches: + include: + - '*' + +jobs: +- job: Helix + timeoutInMinutes: 240 + pool: + name: Hosted VS2017 + vmImage: vs2017-win2016 + steps: + - checkout: self + clean: true + - script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog + displayName: Run build.cmd helix target + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log' + PublishLocation: Container + ArtifactName: $(Agent.Os)_$(Agent.JobName) + continueOnError: true + condition: always() diff --git a/Directory.Build.props b/Directory.Build.props index a67c0adcf579e17fcc78b01b4e0ea6b4a38f41c0..1c93448fcf46a3b33621e46f20a9a7480955d238 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,4 @@ -<Project> +<Project> <Import Project="version.props" /> <PropertyGroup> diff --git a/Directory.Build.targets b/Directory.Build.targets index 1654fd256f7f95aca0dfd4eec1a81675e9cd215c..8cf7d9e01fbc9c9e99e50cdb2ebf6017b5972a53 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -60,6 +60,8 @@ <IsPackable Condition="'$(IsPackable)' == '' ">false</IsPackable> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion> + + <BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload> </PropertyGroup> <Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " /> @@ -68,4 +70,96 @@ <Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" /> <Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" /> <Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" /> + + <!-- Move to CSharp.Common.props --> + <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND '$(IsHelixJob)' == 'true' "> + <PackageReference Include="xunit.runner.console" Version="2.4.1" /> + </ItemGroup> + + <!-- Prepares the test projects for helix by including xunit and publishing --> + <Target Name="PrepareHelixPayload" Returns="@(HelixDirectory)"> + <ItemGroup> + <_TargetFrameworks Remove="@(_TargetFrameworks)" /> + <_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" /> + </ItemGroup> + + <MSBuild Projects="$(MSBuildProjectFullPath)" + Targets="_PrepareHelixPayloadInner" + Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))"> + <Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" /> + </MSBuild> + </Target> + + <Target Name="_PrepareHelixPayloadInner" + DependsOnTargets="Publish" + Condition="'$(BuildHelixPayload)' == 'true'" + Returns="@(HelixDirectory)"> + + <ItemGroup> + <HelixDirectory Include="$(MSBuildProjectFullPath)" /> + </ItemGroup> + </Target> + + <!-- Build the actual helix work items to send to helix queues --> + <Target Name="CreateHelixPayload" Returns="@(HelixPayload)"> + <ItemGroup> + <_TargetFrameworks Remove="@(_TargetFrameworks)" /> + <_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" /> + </ItemGroup> + + <MSBuild Projects="$(MSBuildProjectFullPath)" + Targets="_CreateHelixPayloadInner" + Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))"> + <Output TaskParameter="TargetOutputs" ItemName="HelixPayload" /> + </MSBuild> + </Target> + + <Target Name="CollectXunitConsoleRunner" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> + <PropertyGroup> + <XunitConsoleRunnerDir>$([System.IO.Path]::GetDirectoryName($(XunitConsole472Path)))</XunitConsoleRunnerDir> + </PropertyGroup> + + <ItemGroup> + <XunitConsoleRunnerFiles Include="$(XunitConsoleRunnerDir)/**/*" /> + </ItemGroup> + + <Copy SourceFiles="@(XunitConsoleRunnerFiles)" DestinationFolder="$(PublishDir)" /> + </Target> + + <Target Name="_CreateHelixPayloadInner" + DependsOnTargets="CollectXunitConsoleRunner" + Condition="($(IsWindowsHelixQueue) OR '$(TargetFrameworkIdentifier)' != '.NETFramework')" + Returns="@(HelixPayload)"> + + <ConvertToAbsolutePath Paths="$(PublishDir)"> + <Output TaskParameter="AbsolutePaths" PropertyName="PublishAbsoluteDir" /> + </ConvertToAbsolutePath> + + <!-- Windows NetCore --> + <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND $(IsWindowsHelixQueue)" > + <_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.cmd" /> + </ItemGroup> + + <!-- Windows NetFramework --> + <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND $(IsWindowsHelixQueue)" > + <_CopyItems Include="$(MSBuildThisFileDirectory)test\xunit\runtests.cmd" /> + </ItemGroup> + + <!-- NonWindows --> + <ItemGroup Condition="!$(IsWindowsHelixQueue)" > + <_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.sh" /> + </ItemGroup> + + <Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(PublishAbsoluteDir)" /> + + <ItemGroup> + <HelixPayload Include="$(PublishAbsoluteDir)"> + <TestAssembly>$(TargetFileName)</TestAssembly> + <TestName>$(MSBuildProjectName)-$(TargetFramework)</TestName> + <Command Condition="$(IsWindowsHelixQueue)">runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command> + <Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command> + <TestTimeout>00:30:00</TestTimeout> + </HelixPayload> + </ItemGroup> + </Target> </Project> diff --git a/NuGet.config b/NuGet.config index cec9479a72bfa183df4d1eb0f06779f46f2caff3..1b75d58a6a0efa5204166af269e8b8a5579e1133 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,6 +7,7 @@ The only allowed feed here is myget.org/aspnet-tools which is required to work around https://github.com/Microsoft/msbuild/issues/2914 --> + <add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> <add key="myget.org aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" /> </packageSources> </configuration> diff --git a/build/repo.targets b/build/repo.targets index b076164fc812d72741edb75c8c460a4f6e4029c1..846202e99d18a9a8f429f12c6a4c4d3c5b3132d7 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -111,4 +111,30 @@ Properties="$(BuildProperties);__DummyTarget=GenerateBuildAssetManifest" /> </Target> + <!-- will move into korebuild --> + <Target Name="HelixPublish" DependsOnTargets="Restore"> + <ItemGroup> + <CsProjects Include="@(ProjectToBuild)" Condition="'%(Extension)' == '.csproj'" /> + </ItemGroup> + <MSBuild Projects="@(CsProjects)" + Targets="PrepareHelixPayload" + BuildInParallel="false"> + <Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" /> + </MSBuild> + + <ItemGroup> + <HelixTestProject Include="@(HelixDirectory)" /> + </ItemGroup> + </Target> + + <Target Name="Helix" DependsOnTargets="HelixPublish"> + <PropertyGroup> + <HelixTestProjects>@(HelixTestProject)</HelixTestProjects> + </PropertyGroup> + <MSBuild Projects="$(MSBuildThisFileDirectory)..\test\helix.proj" + Targets="Test" + Properties="ProjectsToTest=$(HelixTestProjects)" + ContinueOnError="ErrorAndStop" + BuildInParallel="false" /> + </Target> </Project> diff --git a/eng/targets/CSharp.Common.targets b/eng/targets/CSharp.Common.targets index 8df4213c6295d101a2a71067f80da68195ba2814..4ed1d933eb10841fbd07ce455071aa0e25fcdacc 100644 --- a/eng/targets/CSharp.Common.targets +++ b/eng/targets/CSharp.Common.targets @@ -5,7 +5,7 @@ <TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework> <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier> </PropertyGroup> - + <Import Project="Packaging.targets" /> <Import Project="ResolveReferences.targets" /> </Project> diff --git a/src/Azure/AzureAD/test/FunctionalTests/Microsoft.AspNetCore.Authentication.AzureAD.FunctionalTests.csproj b/src/Azure/AzureAD/test/FunctionalTests/Microsoft.AspNetCore.Authentication.AzureAD.FunctionalTests.csproj index ed2253ef17862fb4c54f95e7030bfcf501dac330..a5ad6b4adea7e4db0a6f4b0679e60636441ebf3d 100644 --- a/src/Azure/AzureAD/test/FunctionalTests/Microsoft.AspNetCore.Authentication.AzureAD.FunctionalTests.csproj +++ b/src/Azure/AzureAD/test/FunctionalTests/Microsoft.AspNetCore.Authentication.AzureAD.FunctionalTests.csproj @@ -2,6 +2,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Components/Blazor/Build/test/Microsoft.AspNetCore.Blazor.Build.Tests.csproj b/src/Components/Blazor/Build/test/Microsoft.AspNetCore.Blazor.Build.Tests.csproj index 37a3d5ebb75f679bb0c42f18760f151870931a71..23ffdf166d772e6b134bfe894922c8b5649687e9 100644 --- a/src/Components/Blazor/Build/test/Microsoft.AspNetCore.Blazor.Build.Tests.csproj +++ b/src/Components/Blazor/Build/test/Microsoft.AspNetCore.Blazor.Build.Tests.csproj @@ -30,6 +30,7 @@ <ItemGroup> <ProjectReference Include="..\..\testassets\StandaloneApp\StandaloneApp.csproj" /> + <Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> <Compile Include="$(ComponentsSharedSourceRoot)test\**\*.cs" LinkBase="Helpers" /> </ItemGroup> diff --git a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs index 4e880ee59fab1b07369a3625c17600f205282fdb..c7435cacdf663e47a4912ba4da001db30683b395 100644 --- a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs +++ b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; using Xunit.Abstractions; @@ -19,7 +20,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test _output = output; } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6549 public void FindsReferenceAssemblyGraph_ForStandaloneApp() { // Arrange diff --git a/src/Components/Server/test/Microsoft.AspNetCore.Components.Server.Tests.csproj b/src/Components/Server/test/Microsoft.AspNetCore.Components.Server.Tests.csproj index a4ea166fa2e81438a96bbcc1168f3b5f69785ca1..e551455138a469508e6f48341daf532ef47ea032 100644 --- a/src/Components/Server/test/Microsoft.AspNetCore.Components.Server.Tests.csproj +++ b/src/Components/Server/test/Microsoft.AspNetCore.Components.Server.Tests.csproj @@ -2,6 +2,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <!-- https://github.com/aspnet/AspNetCore/issues/7202 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj index da9688a6fbf05f3700570bbfe01549bf6a47b0fc..5a886ef6359ab848927f6a24367d73030b3bbea8 100644 --- a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj +++ b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj @@ -10,6 +10,8 @@ Temporarily disabled until this runs on macOS --> <SkipTests Condition="'$(BlazorAllTests)' != 'true'">true</SkipTests> + <!-- https://github.com/aspnet/AspNetCore/issues/6857 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs b/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs index a66ebec2e811eaf07ced1d6177d165fdd2c9583c..7bc096645e7ac5854846d64838b5bcea472a9c05 100644 --- a/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs +++ b/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs @@ -113,8 +113,9 @@ namespace Microsoft.AspNetCore.DataProtection }); } - [ConditionalFact] + [ConditionalFact] [X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void System_UsesProvidedDirectoryAndCertificate() { var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx"); @@ -164,6 +165,7 @@ namespace Microsoft.AspNetCore.DataProtection [ConditionalFact] [X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void System_UsesProvidedCertificateNotFromStore() { using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) diff --git a/src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj b/src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj index 1df9abdd17581ec873145ba3e2238076b0b00a5d..809684fa400382ec44f9ee2535fc9acfff5a23bf 100644 --- a/src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj +++ b/src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj @@ -7,6 +7,7 @@ <ItemGroup> <Compile Include="..\..\shared\test\*.cs" /> <Content Include="TestFiles\**\*" CopyToOutputDirectory="PreserveNewest" /> + <Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj index 469f493fcc7a1f7905b6ec3cbd40fadb503f16ee..bc1d97c7ccf8d6b6d1d8080ebdf39ea865e21440 100644 --- a/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj +++ b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj @@ -2,6 +2,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj b/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj index c2c50d92a28afc519588a3aa4c40d2e151f01bf6..4a70294b6c0e8529f968e61100be134fa778d863 100644 --- a/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj +++ b/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj @@ -5,6 +5,7 @@ </PropertyGroup> <ItemGroup> + <Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> <Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" /> </ItemGroup> diff --git a/src/Hosting/Hosting/test/WebHostTests.cs b/src/Hosting/Hosting/test/WebHostTests.cs index d7f0de86b8de3ba2e2b64efb4aa27ffd5e0059d9..a9d4d681fada335ca4a79c8eba8926219a99bdec 100644 --- a/src/Hosting/Hosting/test/WebHostTests.cs +++ b/src/Hosting/Hosting/test/WebHostTests.cs @@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -194,7 +195,8 @@ namespace Microsoft.AspNetCore.Hosting } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() { var data = new Dictionary<string, string> @@ -233,7 +235,8 @@ namespace Microsoft.AspNetCore.Hosting } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var data = new Dictionary<string, string> @@ -308,7 +311,8 @@ namespace Microsoft.AspNetCore.Hosting } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public void WebHostApplicationLifetimeEventsOrderedCorrectlyDuringShutdown() { using (var host = CreateBuilder() diff --git a/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj b/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj index 8aba2780e96e8ee00a27e0fd28b1f59d33a6116c..f4f340b347f49748b8e06c58586820bc613b0553 100644 --- a/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj +++ b/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj @@ -2,6 +2,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs b/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs index d643372063cc3089975391053e0acd048212fa73..87893cc21be16183a7a00a4b5b843fd8bed118ac 100644 --- a/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs +++ b/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs @@ -173,17 +173,17 @@ namespace Microsoft.AspNetCore.Routing var ex = Assert.Throws<InvalidOperationException>(() => addressScheme.FindEndpoints("any name")); // Assert - Assert.Equal(@"The following endpoints with a duplicate endpoint name were found. - -Endpoints with endpoint name 'name1': -a -b -c - -Endpoints with endpoint name 'name2': -e -f -", ex.Message); + Assert.Equal(String.Join(Environment.NewLine, @"The following endpoints with a duplicate endpoint name were found.", +"", +"Endpoints with endpoint name 'name1':", +"a", +"b", +"c", +"", +"Endpoints with endpoint name 'name2':", +"e", +"f", +""), ex.Message); } private EndpointNameAddressScheme CreateAddressScheme(params Endpoint[] endpoints) diff --git a/src/Http/Routing/test/UnitTests/Internal/DfaGraphWriterTest.cs b/src/Http/Routing/test/UnitTests/Internal/DfaGraphWriterTest.cs index bcabc39d37db6fd8a415fa7380dd01a3fa3f2084..14efa64d360ad72092c406d950226dc6a82fd795 100644 --- a/src/Http/Routing/test/UnitTests/Internal/DfaGraphWriterTest.cs +++ b/src/Http/Routing/test/UnitTests/Internal/DfaGraphWriterTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.IO; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing.Patterns; @@ -33,10 +34,9 @@ namespace Microsoft.AspNetCore.Routing.Internal graphWriter.Write(endpointsDataSource, writer); // Assert - Assert.Equal(@"digraph DFA { -0 [label=""/""] -} -", writer.ToString()); + Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", +@"0 [label=""/""]", +"}") + Environment.NewLine, writer.ToString()); } [Fact] @@ -57,10 +57,9 @@ namespace Microsoft.AspNetCore.Routing.Internal graphWriter.Write(endpointsDataSource, writer); // Assert - Assert.Equal(@"digraph DFA { -0 [label=""/""] -} -", writer.ToString()); + Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", +@"0 [label=""/""]", +@"}") + Environment.NewLine, writer.ToString()); } [Fact] @@ -82,14 +81,13 @@ namespace Microsoft.AspNetCore.Routing.Internal // Assert var sdf = writer.ToString(); - Assert.Equal(@"digraph DFA { -0 [label=""/ HTTP: GET""] -1 [label=""/ HTTP: *""] -2 -> 0 [label=""HTTP: GET""] -2 -> 1 [label=""HTTP: *""] -2 [label=""/""] -} -", sdf); + Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", +@"0 [label=""/ HTTP: GET""]", +@"1 [label=""/ HTTP: *""]", +@"2 -> 0 [label=""HTTP: GET""]", +@"2 -> 1 [label=""HTTP: *""]", +@"2 [label=""/""]", +@"}") + Environment.NewLine, sdf); } } } diff --git a/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs b/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs index 7c5bdbdd95950b4061c0b2562388ba9e54c004ee..9d67c126d69826779098159255b62ac516187751 100644 --- a/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs +++ b/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs @@ -167,10 +167,8 @@ namespace Microsoft.AspNetCore.Routing.Matching // Assert Assert.Equal( -@"The request matched multiple endpoints. Matches: - -test: /test2 -test: /test3", ex.Message); +@"The request matched multiple endpoints. Matches: " + Environment.NewLine + Environment.NewLine + +"test: /test2" + Environment.NewLine + "test: /test3", ex.Message); Assert.Null(context.Endpoint); } @@ -204,4 +202,4 @@ test: /test3", ex.Message); return new DefaultEndpointSelector(); } } -} \ No newline at end of file +} diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs index 450c59c8b4099e671e6d2cc474d7dd535b478cdb..40a22ff1a71059d29bfb8ca098ca29abe41d1e2e 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs @@ -22,7 +22,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer UnsafeEphemeralKeySet : (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? X509KeyStorageFlags.PersistKeySet : X509KeyStorageFlags.DefaultKeySet); - [ConditionalFact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 [FrameworkSkipCondition(RuntimeFrameworks.CLR)] public void Configure_AddsDevelopmentKeyFromConfiguration() { @@ -62,7 +63,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void Configure_LoadsPfxCertificateCredentialFromConfiguration() { // Arrange @@ -91,7 +93,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer Assert.Equal("AC8FDF4BD4C10841BD24DC88D983225D10B43BB2", key.Certificate.Thumbprint); } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void Configure_LoadsCertificateStoreCertificateCredentialFromConfiguration() { try diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs index eb36e05ae7b5817b5b66c7214de9640a71953c83..8551f9ccae6d589bc76c290453cf7ac25818e426 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs @@ -58,7 +58,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration Assert.Equal("Couldn't find a valid certificate with subject 'Invalid' on the 'CurrentUser\\My'", exception.Message); } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public static void LoadFromStoreCert_SkipsCertificatesNotYetValid() { try @@ -80,7 +81,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public static void LoadFromStoreCert_PrefersCertificatesCloserToExpirationDate() { try @@ -102,7 +104,8 @@ namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Configuration } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public static void LoadFromStoreCert_SkipsExpiredCertificates() { try diff --git a/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj b/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj index 6edd688ee0a285986e14d22a04b5c13003ddeb37..3aa92b508419cd09adecc56450834aaa75ceceea 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.Tests.csproj @@ -6,6 +6,7 @@ <ItemGroup> <Reference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" /> + <Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/Identity/test/Identity.FunctionalTests/Microsoft.AspNetCore.Identity.FunctionalTests.csproj b/src/Identity/test/Identity.FunctionalTests/Microsoft.AspNetCore.Identity.FunctionalTests.csproj index 80893bda8efaa697004a2deedf93d8e9a1f967ad..eef6ae2c6c17986227855e1c43cc7acdd56d80ad 100644 --- a/src/Identity/test/Identity.FunctionalTests/Microsoft.AspNetCore.Identity.FunctionalTests.csproj +++ b/src/Identity/test/Identity.FunctionalTests/Microsoft.AspNetCore.Identity.FunctionalTests.csproj @@ -2,6 +2,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs index f18fde8e52b2c4fc2dc5ef794cf0a34c95b72370..64fe82e866ac0082c2e6e735872e203f8a6d2237 100644 --- a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs +++ b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs @@ -11,6 +11,7 @@ using System.Net.Http; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; using Xunit.Abstractions; @@ -37,7 +38,8 @@ namespace Microsoft.AspNetCore.Identity.Test } } - [Theory] + [ConditionalTheory] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6549 [MemberData(nameof(ScriptWithIntegrityData))] public async Task IdentityUI_ScriptTags_SubresourceIntegrityCheck(ScriptTag scriptTag) { @@ -65,7 +67,8 @@ namespace Microsoft.AspNetCore.Identity.Test } } - [Theory] + [ConditionalTheory] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6549 [MemberData(nameof(ScriptWithFallbackSrcData))] public async Task IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent(ScriptTag scriptTag) { diff --git a/src/Identity/test/Identity.Test/Microsoft.AspNetCore.Identity.Test.csproj b/src/Identity/test/Identity.Test/Microsoft.AspNetCore.Identity.Test.csproj index 337f6d41bbf30440fd4c32ab9d690d11fc864f1a..1f2466bd152650cc9129318bc27c148b4befeda1 100644 --- a/src/Identity/test/Identity.Test/Microsoft.AspNetCore.Identity.Test.csproj +++ b/src/Identity/test/Identity.Test/Microsoft.AspNetCore.Identity.Test.csproj @@ -6,6 +6,7 @@ <ItemGroup> <Compile Include="$(IdentityTestSharedSourceRoot)**\*.cs" /> + <Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj b/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj index d59d1ff4cd7890f2e404d9326fe0725b41a5fc13..4e7b9c97504f4b3e731d62d29bd76fcc19ca9121 100644 --- a/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj +++ b/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj @@ -4,6 +4,8 @@ <TargetFramework>netcoreapp3.0</TargetFramework> <TestGroupName>Cors.FunctionalTests</TestGroupName> <DefaultItemExcludes>$(DefaultItemExcludes);node_modules\**\*</DefaultItemExcludes> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj b/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj index d5a887ef27caad8a98ce050a6b356c5de445fb88..8bb18b2095d2a90edee5e4ea60daeb85d00af328 100644 --- a/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj +++ b/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj @@ -9,6 +9,8 @@ <WarningsNotAsErrors>$(WarningsNotAsErrors);xUnit1004</WarningsNotAsErrors> <!-- Temporarily suppress warnings about Microsoft.AspNetCore.Server.IntegrationTesting --> <NoWarn>$(NoWarn);NU1605</NoWarn> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Mvc/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj b/src/Mvc/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj index 34afae6bb9b3eff4e6442ca9d1e8b6f49e200c5e..7381768d876b95fc0da7dc7b25e432c84ddc5773 100644 --- a/src/Mvc/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj +++ b/src/Mvc/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj @@ -8,6 +8,8 @@ <DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants> <!-- The test asset projects this depends on are not strong-named. --> <SignAssembly>false</SignAssembly> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Mvc/test/Mvc.Analyzers.Test/Mvc.Analyzers.Test.csproj b/src/Mvc/test/Mvc.Analyzers.Test/Mvc.Analyzers.Test.csproj index 9514be6a93a0eee9132e0f70af43f49f67f1b5d7..4f0353cd9581f38969a921989117104aec8bd543 100644 --- a/src/Mvc/test/Mvc.Analyzers.Test/Mvc.Analyzers.Test.csproj +++ b/src/Mvc/test/Mvc.Analyzers.Test/Mvc.Analyzers.Test.csproj @@ -4,6 +4,8 @@ <TargetFramework>netcoreapp3.0</TargetFramework> <PreserveCompilationContext>true</PreserveCompilationContext> <RootNamespace>Microsoft.AspNetCore.Mvc.Analyzers</RootNamespace> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Mvc/test/Mvc.Api.Analyzers.Test/Mvc.Api.Analyzers.Test.csproj b/src/Mvc/test/Mvc.Api.Analyzers.Test/Mvc.Api.Analyzers.Test.csproj index cd9bf7c9e4bad12eb5d04e4a806af7ff33530f66..e64d31125d567e6bed0875aa3d71c23fb833947f 100644 --- a/src/Mvc/test/Mvc.Api.Analyzers.Test/Mvc.Api.Analyzers.Test.csproj +++ b/src/Mvc/test/Mvc.Api.Analyzers.Test/Mvc.Api.Analyzers.Test.csproj @@ -3,6 +3,8 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> <RootNamespace>Microsoft.AspNetCore.Mvc.Api.Analyzers</RootNamespace> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj index a8cd236f3de989e19814e96e52d6f1746cf4a011..92df65c736245a76ced64e1ac1520897f7739236 100644 --- a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj +++ b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj @@ -8,6 +8,8 @@ <!-- Workaround until https://github.com/aspnet/AspNetCore/issues/4321 is resolved. --> <RunTemplateTests Condition="'$(OS)' != 'Windows_NT'">true</RunTemplateTests> <SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests> + <!-- https://github.com/aspnet/AspNetCore/issues/6857 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj b/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj index fb386d335cd0c5c32f94db43664ce924e26d0927..7625b71c87ea5cbb41e06b1ed14d034824dc109b 100644 --- a/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj +++ b/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj @@ -4,6 +4,8 @@ <TargetFramework>netcoreapp3.0</TargetFramework> <IsSampleProject>false</IsSampleProject> <PlatformTarget>AnyCPU</PlatformTarget> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <Import Project="$(MvcTestingTargets)" Condition="'$(MvcTestingTargets)' != ''" /> diff --git a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj index dd2bcc8e4587717547f8c687d02e4e3023e6def1..8c1c804ec6871245035a8ae2cfd0579abd946537 100644 --- a/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj +++ b/src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj @@ -5,6 +5,8 @@ <DisableFastUpToDateCheck>True</DisableFastUpToDateCheck> <TestGroupName>IISExpress.FunctionalTests</TestGroupName> <SkipTests Condition=" '$(SkipIISExpressTests)' == 'true' ">true</SkipTests> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs index f91bee1dd6e82e05fad64cf7199af33d98cc9dd7..50f5a561ec47133911ef9c2d0e8467cf7fd69b6b 100644 --- a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs @@ -5,13 +5,15 @@ using System; using System.IO; using System.Linq; using System.Reflection; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests { public class GeneratedCodeTests { - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void GeneratedCodeIsUpToDate() { var repositoryRoot = typeof(GeneratedCodeTests).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().First(f => string.Equals(f.Key, "RepositoryRoot", StringComparison.OrdinalIgnoreCase)).Value; diff --git a/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj b/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj index cc07e55027a022c657942edb11c06604ba7b07e5..c2c641e26f629c1f0ac2f0a4fefe0800bb69559d 100644 --- a/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj +++ b/src/Servers/Kestrel/Kestrel/test/Microsoft.AspNetCore.Server.Kestrel.Tests.csproj @@ -7,6 +7,7 @@ <ItemGroup> <Compile Include="$(SharedSourceRoot)NullScope.cs" /> <Compile Include="$(KestrelSharedSourceRoot)test\*.cs" LinkBase="shared" /> + <Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> <Content Include="$(KestrelSharedSourceRoot)test\TestCertificates\*.pfx" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" /> <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> diff --git a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs index e8e989f1befcfe280af8a9b98e630d5a265c74ad..88c37750f604dfa436bd88da8ac23e67d09b1c05 100644 --- a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs +++ b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs @@ -34,6 +34,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalFact] [HostNameIsReachable] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7267 public async Task RegisterAddresses_HostName_Success() { var hostName = Dns.GetHostName(); @@ -332,6 +333,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalFact] [HostNameIsReachable] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7267 public async Task ListenAnyIP_HostName_Success() { var hostName = Dns.GetHostName(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj index 293b468728b04c11c308338a0fcf8e9e1f52b33f..c2046f8cd88a4543b54bb455ccb95b2b7953e926 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/InMemory.FunctionalTests.csproj @@ -4,6 +4,8 @@ <TargetFramework>netcoreapp3.0</TargetFramework> <ServerGarbageCollection>true</ServerGarbageCollection> <TestGroupName>InMemory.FunctionalTests</TestGroupName> + <!-- // https://github.com/aspnet/AspNetCore/issues/7000 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index 361b4c0e50b9373571f1c0a8aacad72f7ec8af58..8de79a438b4c867e4a080983d60b621ca04404ed 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -25,6 +25,7 @@ namespace Interop.FunctionalTests { [ConditionalTheory] [MemberData(nameof(H2SpecTestCases))] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7299 public async Task RunIndividualTestCase(H2SpecTestCase testCase) { var hostBuilder = new WebHostBuilder() diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj index cbc4c1fad4b0cad6ed2df016f7bdde08e675c12b..765da9ed4de7c2a59e3ecd16e22b16396755b1b6 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Interop.FunctionalTests.csproj @@ -13,6 +13,7 @@ <Compile Include="$(KestrelSharedSourceRoot)test\TransportTestHelpers\IWebHostPortExtensions.cs" LinkBase="shared" /> <Compile Include="$(KestrelSharedSourceRoot)test\TestResources.cs" LinkBase="shared" /> <Content Include="$(KestrelSharedSourceRoot)test\TestCertificates\*.pfx" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" /> + <Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> </ItemGroup> <ItemGroup> diff --git a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj index 690d9f5d9b2e823e54e805182d78e69459799be9..1c713c566d796eddf13855168338e29d55035a5b 100644 --- a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj +++ b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj @@ -7,13 +7,14 @@ </PropertyGroup> <ItemGroup> + <Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> <Compile Include="..\BindTests\**\*.cs" /> <Compile Include="..\Libuv.FunctionalTests\TransportSelector.cs" /> <Compile Include="$(SharedSourceRoot)NullScope.cs" /> <Compile Include="$(KestrelSharedSourceRoot)test\*.cs" LinkBase="shared" /> <Compile Include="$(KestrelSharedSourceRoot)test\TransportTestHelpers\*.cs" LinkBase="shared\TransportTestHelpers" /> <Content Include="$(KestrelSharedSourceRoot)test\TestCertificates\*.pfx" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" /> - </ItemGroup> + </ItemGroup> <ItemGroup> <Reference Include="Microsoft.AspNetCore.Server.Kestrel" /> diff --git a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj index b0622e4eb3ad7a7f8a82995135638bc7ba5d8c50..7a2adf01b0adb1b87082e472a0984a0b4662b367 100644 --- a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj @@ -7,6 +7,7 @@ </PropertyGroup> <ItemGroup> + <Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> <Compile Include="..\BindTests\**\*.cs" /> <Compile Include="..\Sockets.FunctionalTests\TransportSelector.cs" /> <Compile Include="$(SharedSourceRoot)NullScope.cs" /> diff --git a/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj b/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj index 4163c6ddf8bc4af684c237082881a246e8209e16..791e6986277f51c93408b9dcfc9db0e3ba96ddf2 100644 --- a/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj +++ b/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj @@ -2,6 +2,7 @@ <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs index 52caae046d1a519d8b6c430ee5eafba81e5533e3..5b770a4b04bdfedadf958e5508766adab494fe9a 100644 --- a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs +++ b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs @@ -8,6 +8,7 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; using Xunit.Abstractions; @@ -107,7 +108,8 @@ namespace Microsoft.AspNetCore.Certificates.Generation.Tests } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6721 public void EnsureCreateHttpsCertificate2_CreatesACertificate_WhenThereAreNoHttpsCertificates() { try diff --git a/src/Tools/FirstRunCertGenerator/test/Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj b/src/Tools/FirstRunCertGenerator/test/Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj index 68049992742c496dcfaf3527179d10df5c1ff765..2e164a495c782f409d4ac5a581dd81f8b50be2e3 100644 --- a/src/Tools/FirstRunCertGenerator/test/Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj +++ b/src/Tools/FirstRunCertGenerator/test/Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests.csproj @@ -6,6 +6,7 @@ <ItemGroup> <Reference Include="Microsoft.AspNetCore.DeveloperCertificates.XPlat" /> + <Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" /> </ItemGroup> </Project> diff --git a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj index 43054e27379f8132959db31816285a4ab2608912..c7414e6834be7620bb93c0ff695aaa769b0cf2af 100644 --- a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj +++ b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj @@ -5,6 +5,8 @@ <AssemblyName>Microsoft.DotNet.Watcher.Tools.Tests</AssemblyName> <DefaultItemExcludes>$(DefaultItemExcludes);TestProjects\**\*</DefaultItemExcludes> <TestGroupName>DotNetWatcherToolsTests</TestGroupName> + <!-- https://github.com/aspnet/AspNetCore/issues/6549 --> + <BuildHelixPayload>false</BuildHelixPayload> </PropertyGroup> <ItemGroup> diff --git a/test/helix.proj b/test/helix.proj new file mode 100644 index 0000000000000000000000000000000000000000..92f9360a167835e42c0f066d2d342b1ac9b44028 --- /dev/null +++ b/test/helix.proj @@ -0,0 +1,51 @@ +<Project DefaultTargets="Test"> + + <!-- Version included until we get global.json generation to support this SDK. --> + <Sdk Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19073.6" /> + + <Target Name="Gather" BeforeTargets="Test"> + <ItemGroup> + <ProjectsToTest Include="$(ProjectsToTest)" /> + </ItemGroup> + <MSBuild Projects="@(ProjectsToTest)" + Targets="CreateHelixPayload" + BuildInParallel="true"> + <Output TaskParameter="TargetOutputs" ItemName="HelixPayload" /> + </MSBuild> + <ItemGroup> + <HelixWorkItem Include="%(HelixPayload.TestName)"> + <Command>%(HelixPayload.Command)</Command> + <PayloadDirectory>%(HelixPayload.Identity)</PayloadDirectory> + <Timeout>%(HelixPayload.TestTimeout)</Timeout> + </HelixWorkItem> + </ItemGroup> + </Target> + + <PropertyGroup> + <!-- helix SDK issue https://github.com/dotnet/arcade/issues/1605 --> + <SkipInvalidConfigurations>true</SkipInvalidConfigurations> + <HelixSource>pr/aspnet/aspnetcore</HelixSource> + <HelixType>ci</HelixType> + <HelixBuild>private-$(USERNAME)</HelixBuild> + <HelixBuild Condition=" '$(USERNAME)' == '' ">private-$(USER)</HelixBuild> + <HelixBuild Condition=" '$(CI)' == 'true' ">$(BUILD_BUILDNUMBER)</HelixBuild> + <WaitForWorkItemCompletion>true</WaitForWorkItemCompletion> + <FailOnMissionControlTestFailure>true</FailOnMissionControlTestFailure> + <EnableAzurePipelinesReporter>false</EnableAzurePipelinesReporter> + <IsExternal>true</IsExternal> + <Creator>aspnetcore</Creator> + + <HelixTargetQueues> + Windows.10.Amd64.ClientRS4.VS2017.Open; + OSX.1012.Amd64.Open; + Ubuntu.1810.Amd64.Open; + Ubuntu.1604.Amd64.Open; + Centos.7.Amd64.Open; + Debian.8.Amd64.Open; + Debian.9.Amd64.Open; + Fedora.27.Amd64.Open; + Fedora.28.Amd64.Open; + Redhat.7.Amd64.Open; + </HelixTargetQueues> + </PropertyGroup> +</Project> diff --git a/test/vstest/runtests.cmd b/test/vstest/runtests.cmd new file mode 100644 index 0000000000000000000000000000000000000000..b8d87d105182653547fda32f85a0b245908e689c --- /dev/null +++ b/test/vstest/runtests.cmd @@ -0,0 +1,14 @@ +set target=%1 +set sdkVersion=%2 +set runtimeVersion=%3 +powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Version %sdkVersion% -InstallDir %HELIX_CORRELATION_PAYLOAD%\sdk" +powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Runtime dotnet -Version %runtimeVersion% -InstallDir %HELIX_CORRELATION_PAYLOAD%\sdk" +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +set DOTNET_ROOT="$HELIX_CORRELATION_PAYLOAD/sdk" +set PATH="$DOTNET_ROOT:$PATH" +set DOTNET_MULTILEVEL_LOOKUP=0 +set DOTNET_CLI_HOME="$HELIX_CORRELATION_PAYLOAD/home" +set helix=true +%HELIX_CORRELATION_PAYLOAD%\sdk\dotnet vstest %target% --logger:trx + + diff --git a/test/vstest/runtests.sh b/test/vstest/runtests.sh new file mode 100644 index 0000000000000000000000000000000000000000..cfaf84dc1a03bbe73434d3e2587f6ab08f2e5652 --- /dev/null +++ b/test/vstest/runtests.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +curl -o dotnet-install.sh -sSL https://dot.net/v1/dotnet-install.sh +if [ $? -ne 0 ]; then + download_retries=3 + while [ $download_retries -gt 0 ]; do + curl -sSL https://dot.net/v1/dotnet-install.sh + if [ $? -ne 0 ]; then + let download_retries=download_retries-1 + echo -e "${YELLOW}Failed to download dotnet-install.sh. Retries left: $download_retries.${RESET}" + else + download_retries=0 + fi + done +fi + +# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) +chmod +x "dotnet-install.sh"; sync + +./dotnet-install.sh --version $2 --install-dir $HELIX_CORRELATION_PAYLOAD/sdk +if [ $? -ne 0 ]; then + sdk_retries=3 + while [ $sdk_retries -gt 0 ]; do + ./dotnet-install.sh --version $2 --install-dir $HELIX_CORRELATION_PAYLOAD/sdk + if [ $? -ne 0 ]; then + let sdk_retries=sdk_retries-1 + echo -e "${YELLOW}Failed to install .NET Core SDK $version. Retries left: $sdk_retries.${RESET}" + else + sdk_retries=0 + fi + done +fi + +./dotnet-install.sh --runtime dotnet --version $3 --install-dir $HELIX_CORRELATION_PAYLOAD/sdk +if [ $? -ne 0 ]; then + runtime_retries=3 + while [ $runtime_retries -gt 0 ]; do + ./dotnet-install.sh --runtime dotnet --version $3 --install-dir $HELIX_CORRELATION_PAYLOAD/sdk + if [ $? -ne 0 ]; then + let runtime_retries=runtime_retries-1 + echo -e "${YELLOW}Failed to install .NET Core runtime $version. Retries left: $runtime_retries.${RESET}" + else + runtime_retries=0 + fi + done +fi + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + +# Ensures every invocation of dotnet apps uses the same dotnet.exe +export DOTNET_ROOT="$HELIX_CORRELATION_PAYLOAD/sdk" + +# Ensure dotnet comes first on PATH +export PATH="$DOTNET_ROOT:$PATH" + +# Prevent fallback to global .NET locations. This ensures our tests use the shared frameworks we specify and don't rollforward to something else that might be installed on the machine +export DOTNET_MULTILEVEL_LOOKUP=0 + +# Avoid contaminating userprofiles +export DOTNET_CLI_HOME="$HELIX_CORRELATION_PAYLOAD/home" + +export helix="true" + +$HELIX_CORRELATION_PAYLOAD/sdk/dotnet vstest $1 --logger:trx diff --git a/test/xunit/SkipOnHelixAttribute.cs b/test/xunit/SkipOnHelixAttribute.cs new file mode 100644 index 0000000000000000000000000000000000000000..144acece4e3445e6563d86a5b0fd5ae859e7cb79 --- /dev/null +++ b/test/xunit/SkipOnHelixAttribute.cs @@ -0,0 +1,31 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.AspNetCore.Testing.xunit +{ + /// <summary> + /// Skip test if a given environment variable is not enabled. To enable the test, set environment variable + /// to "true" for the test process. + /// </summary> + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class SkipOnHelixAttribute : Attribute, ITestCondition + { + public bool IsMet + { + get + { + return !string.Equals(Environment.GetEnvironmentVariable("helix"), "true", StringComparison.OrdinalIgnoreCase); + } + } + + public string SkipReason + { + get + { + return $"This test is skipped on helix"; + } + } + } +} diff --git a/test/xunit/runtests.cmd b/test/xunit/runtests.cmd new file mode 100644 index 0000000000000000000000000000000000000000..350399c1af5df05f26d258faf830ea883c69f40e --- /dev/null +++ b/test/xunit/runtests.cmd @@ -0,0 +1,3 @@ +set target=%1 +set helix=true +xunit.console.exe %target% -xml testResults.xml