diff --git a/.azure/pipelines/helix-test.yml b/.azure/pipelines/helix-test.yml new file mode 100644 index 000000000000..2bd5284917f8 --- /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 406abcec72bb..54df78b6795c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,4 @@ - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 1654fd256f7f..8cf7d9e01fbc 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -60,6 +60,8 @@ false $(MicrosoftNETCoreAppPackageVersion) + + true @@ -68,4 +70,96 @@ + + + + + + + + + + <_TargetFrameworks Remove="@(_TargetFrameworks)" /> + <_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" /> + + + + + + + + + + + + + + + + + + <_TargetFrameworks Remove="@(_TargetFrameworks)" /> + <_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" /> + + + + + + + + + + $([System.IO.Path]::GetDirectoryName($(XunitConsole472Path))) + + + + + + + + + + + + + + + + + + <_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.cmd" /> + + + + + <_CopyItems Include="$(MSBuildThisFileDirectory)test\xunit\runtests.cmd" /> + + + + + <_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.sh" /> + + + + + + + $(TargetFileName) + $(MSBuildProjectName)-$(TargetFramework) + runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion) + ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion) + 00:30:00 + + + diff --git a/NuGet.config b/NuGet.config index cec9479a72bf..1b75d58a6a0e 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 --> + diff --git a/build/repo.targets b/build/repo.targets index b076164fc812..846202e99d18 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -111,4 +111,30 @@ Properties="$(BuildProperties);__DummyTarget=GenerateBuildAssetManifest" /> + + + + + + + + + + + + + + + + + @(HelixTestProject) + + + diff --git a/eng/targets/CSharp.Common.targets b/eng/targets/CSharp.Common.targets index 8df4213c6295..4ed1d933eb10 100644 --- a/eng/targets/CSharp.Common.targets +++ b/eng/targets/CSharp.Common.targets @@ -5,7 +5,7 @@ net$(TargetFrameworkVersion.Substring(1).Replace('.','')) .NETFramework - + 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 ed2253ef1786..a5ad6b4adea7 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 @@ netcoreapp3.0 + + false 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 37a3d5ebb75f..23ffdf166d77 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 @@ + diff --git a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs index 4e880ee59fab..c7435cacdf66 100644 --- a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs +++ b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Microsoft.AspNetCore.Testing.xunit; using Xunit; using Xunit.Abstractions; @@ -19,7 +20,8 @@ public RuntimeDependenciesResolverTest(ITestOutputHelper output) _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 a4ea166fa2e8..e551455138a4 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 @@ netcoreapp3.0 + + false diff --git a/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj b/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj index da9688a6fbf0..5a886ef6359a 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 --> true + + false diff --git a/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs b/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs index a66ebec2e811..7bc096645e7a 100644 --- a/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs +++ b/src/DataProtection/Extensions/test/DataProtectionProviderTests.cs @@ -113,8 +113,9 @@ public void System_UsesProvidedDirectory_WithConfigurationCallback() }); } - [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 @@ public void System_UsesProvidedDirectoryAndCertificate() [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 1df9abdd1758..809684fa4003 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 @@ + 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 469f493fcc7a..bc1d97c7ccf8 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 @@ netcoreapp3.0 + + false diff --git a/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj b/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj index c2c50d92a28a..4a70294b6c0e 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 @@ + diff --git a/src/Hosting/Hosting/test/WebHostTests.cs b/src/Hosting/Hosting/test/WebHostTests.cs index 0bc568277c5a..ce22f0a375a3 100644 --- a/src/Hosting/Hosting/test/WebHostTests.cs +++ b/src/Hosting/Hosting/test/WebHostTests.cs @@ -14,6 +14,7 @@ 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 @@ public async Task WebHostShutsDownWhenTokenTriggers() } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() { var data = new Dictionary @@ -233,7 +235,8 @@ public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var data = new Dictionary @@ -308,7 +311,8 @@ public async Task WebHostStopAsyncCanBeCancelledEarly() } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291 public void WebHostApplicationLifetimeEventsOrderedCorrectlyDuringShutdown() { using (var host = CreateBuilder() @@ -1325,4 +1329,4 @@ public static IWebHostBuilder UseFakeServer(this IWebHostBuilder builder) return builder.ConfigureServices(services => services.AddSingleton()); } } -} \ No newline at end of file +} diff --git a/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj b/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj index 8aba2780e96e..f4f340b347f4 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 @@ netcoreapp3.0 + + false diff --git a/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs b/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs index d643372063cc..87893cc21be1 100644 --- a/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs +++ b/src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs @@ -173,17 +173,17 @@ public void AddressScheme_ThrowsExceptionForDuplicateEndpoints() var ex = Assert.Throws(() => 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 bcabc39d37db..14efa64d360a 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 @@ public void Write_ExcludeNonRouteEndpoint() 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 @@ public void Write_ExcludeRouteEndpointWithSuppressMatchingMetadata() 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 @@ public void Write_IncludeRouteEndpointWithPolicy() // 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 7c5bdbdd9595..9d67c126d698 100644 --- a/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs +++ b/src/Http/Routing/test/UnitTests/Matching/DefaultEndpointSelectorTest.cs @@ -167,10 +167,8 @@ public async Task SelectAsync_MultipleValidCandidatesInGroup_ReportsAmbiguity() // 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 @@ private static DefaultEndpointSelector CreateSelector() 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 450c59c8b409..40a22ff1a710 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/ConfigureSigningCredentialsTests.cs @@ -22,7 +22,8 @@ public class ConfigureSigningCredentialsTests 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 @@ public void Configure_AddsDevelopmentKeyFromConfiguration() } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public void Configure_LoadsPfxCertificateCredentialFromConfiguration() { // Arrange @@ -91,7 +93,8 @@ public void Configure_LoadsPfxCertificateCredentialFromConfiguration() 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 eb36e05ae7b5..8551f9ccae6d 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/test/Configuration/SigningKeysLoaderTests.cs @@ -58,7 +58,8 @@ public static void LoadFromStoreCert_ThrowsIfThereIsNoCertificateAvailable() 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 @@ public static void LoadFromStoreCert_SkipsCertificatesNotYetValid() } } - [Fact] + [ConditionalFact] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720 public static void LoadFromStoreCert_PrefersCertificatesCloserToExpirationDate() { try @@ -102,7 +104,8 @@ public static void LoadFromStoreCert_PrefersCertificatesCloserToExpirationDate() } } - [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 6edd688ee0a2..3aa92b508419 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 @@ + 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 80893bda8efa..eef6ae2c6c17 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 @@ netcoreapp3.0 + + false diff --git a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs index f18fde8e52b2..64fe82e866ac 100644 --- a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs +++ b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs @@ -11,6 +11,7 @@ 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 @@ public static IEnumerable ScriptWithIntegrityData } } - [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 @@ public static IEnumerable ScriptWithFallbackSrcData } } - [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 337f6d41bbf3..1f2466bd1526 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 @@ + diff --git a/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj b/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj index d59d1ff4cd78..4e7b9c97504f 100644 --- a/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj +++ b/src/Middleware/CORS/test/FunctionalTests/FunctionalTests.csproj @@ -4,6 +4,8 @@ netcoreapp3.0 Cors.FunctionalTests $(DefaultItemExcludes);node_modules\**\* + + false diff --git a/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj b/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj index d5a887ef27ca..8bb18b2095d2 100644 --- a/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj +++ b/src/MusicStore/test/MusicStore.E2ETests/MusicStore.E2ETests.csproj @@ -9,6 +9,8 @@ $(WarningsNotAsErrors);xUnit1004 $(NoWarn);NU1605 + + false 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 34afae6bb9b3..7381768d876b 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);__RemoveThisBitTo__GENERATE_BASELINES false + + false 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 9514be6a93a0..4f0353cd9581 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 @@ netcoreapp3.0 true Microsoft.AspNetCore.Mvc.Analyzers + + false 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 cd9bf7c9e4ba..e64d31125d56 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 @@ netcoreapp3.0 Microsoft.AspNetCore.Mvc.Api.Analyzers + + false diff --git a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj index 6e32f19f6957..831cf10690c1 100644 --- a/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj +++ b/src/ProjectTemplates/test/ProjectTemplates.Tests.csproj @@ -7,6 +7,8 @@ true + + false diff --git a/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj b/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj index fb386d335cd0..7625b71c87ea 100644 --- a/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj +++ b/src/Security/test/AuthSamples.FunctionalTests/AuthSamples.FunctionalTests.csproj @@ -4,6 +4,8 @@ netcoreapp3.0 false AnyCPU + + false 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 dd2bcc8e4587..8c1c804ec687 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 @@ True IISExpress.FunctionalTests true + + false diff --git a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs index f91bee1dd6e8..50f5a561ec47 100644 --- a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs @@ -5,13 +5,15 @@ 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().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 cc07e55027a0..c2c641e26f62 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 @@ + diff --git a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs index e8e989f1befc..88c37750f604 100644 --- a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs +++ b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs @@ -34,6 +34,7 @@ public class AddressRegistrationTests : TestApplicationErrorLoggerLoggedTest [ConditionalFact] [HostNameIsReachable] + [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7267 public async Task RegisterAddresses_HostName_Success() { var hostName = Dns.GetHostName(); @@ -332,6 +333,7 @@ public async Task ListenAnyIP_IPv6_Success() [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 293b468728b0..c2046f8cd88a 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 @@ netcoreapp3.0 true InMemory.FunctionalTests + + false diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index 9145d7a02775..87a201acbf95 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -25,6 +25,7 @@ public class H2SpecTests : LoggedTest { [ConditionalTheory(Skip = "Skipped while debugging https://github.com/aspnet/AspNetCore-Internal/issues/1720")] [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 cbc4c1fad4b0..765da9ed4de7 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 @@ + diff --git a/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj b/src/Servers/Kestrel/test/Libuv.BindTests/Libuv.BindTests.csproj index 690d9f5d9b2e..1c713c566d79 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 @@ + - + diff --git a/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj b/src/Servers/Kestrel/test/Sockets.BindTests/Sockets.BindTests.csproj index b0622e4eb3ad..7a2adf01b0ad 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 @@ + diff --git a/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj b/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj index 4163c6ddf8bc..791e6986277f 100644 --- a/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj +++ b/src/Servers/test/FunctionalTests/ServerComparison.FunctionalTests.csproj @@ -2,6 +2,7 @@ netcoreapp3.0 + false diff --git a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs index 52caae046d1a..5b770a4b04bd 100644 --- a/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs +++ b/src/Tools/FirstRunCertGenerator/test/CertificateManagerTests.cs @@ -8,6 +8,7 @@ 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 @@ public void EnsureCreateHttpsCertificate_CreatesACertificate_WhenThereAreNoHttps } } - [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 68049992742c..2e164a495c78 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 @@ + diff --git a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj index 43054e27379f..c7414e6834be 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 @@ Microsoft.DotNet.Watcher.Tools.Tests $(DefaultItemExcludes);TestProjects\**\* DotNetWatcherToolsTests + + false diff --git a/test/helix.proj b/test/helix.proj new file mode 100644 index 000000000000..92f9360a1678 --- /dev/null +++ b/test/helix.proj @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + %(HelixPayload.Command) + %(HelixPayload.Identity) + %(HelixPayload.TestTimeout) + + + + + + + true + pr/aspnet/aspnetcore + ci + private-$(USERNAME) + private-$(USER) + $(BUILD_BUILDNUMBER) + true + true + false + true + aspnetcore + + + 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; + + + diff --git a/test/vstest/runtests.cmd b/test/vstest/runtests.cmd new file mode 100644 index 000000000000..b8d87d105182 --- /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 000000000000..cfaf84dc1a03 --- /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 000000000000..144acece4e34 --- /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 +{ + /// + /// Skip test if a given environment variable is not enabled. To enable the test, set environment variable + /// to "true" for the test process. + /// + [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 000000000000..350399c1af5d --- /dev/null +++ b/test/xunit/runtests.cmd @@ -0,0 +1,3 @@ +set target=%1 +set helix=true +xunit.console.exe %target% -xml testResults.xml