From fa239f20a52defa06029f6a316846d6e190e05bb Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Sun, 5 May 2019 22:15:10 -0700 Subject: [PATCH] EnableAzurePipelinesReporter for helix (#8094) * EnableAzurePipelinesReporter for helix * Update Helix SDK * Revert a fix that broke things even more * Try publishing test assets * Try fixing Kestrel tests on Helix * Try a temp file in the working directory * Skip Http2Spec tests on Debian 8 * Missed update * Try a different format * Disable failing test on Fedora * Mark flaky test --- .azure/pipelines/helix-test.yml | 2 ++ build/repo.targets | 2 +- eng/Version.Details.xml | 4 +-- eng/helix/helix.proj | 2 +- eng/helix/vstest/runtests.cmd | 4 +-- eng/helix/vstest/runtests.sh | 1 - eng/targets/Helix.targets | 2 +- global.json | 2 +- src/Servers/Kestrel/Directory.Build.props | 1 + .../Kestrel/test/GeneratedCodeTests.cs | 10 +++--- ...oft.AspNetCore.Server.Kestrel.Tests.csproj | 6 +++- .../FunctionalTests/Http2/HandshakeTests.cs | 1 + .../FunctionalTests/Http2/ShutdownTests.cs | 3 ++ .../Interop.FunctionalTests/H2SpecCommands.cs | 35 +++++++++++++++++-- .../Interop.FunctionalTests/H2SpecTests.cs | 1 + .../Sockets.FunctionalTests.csproj | 1 + .../test/dotnet-watch.Tests.csproj | 8 ++++- 17 files changed, 66 insertions(+), 19 deletions(-) diff --git a/.azure/pipelines/helix-test.yml b/.azure/pipelines/helix-test.yml index b3173e456b..629ce969cf 100644 --- a/.azure/pipelines/helix-test.yml +++ b/.azure/pipelines/helix-test.yml @@ -17,6 +17,8 @@ jobs: steps: - script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\logs\SendToHelix.binlog displayName: Run build.cmd helix target + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops artifacts: - name: Helix_logs path: artifacts/logs/ diff --git a/build/repo.targets b/build/repo.targets index 5dac6efd13..1528a91ec7 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -151,7 +151,7 @@ Properties="$(BuildProperties);__DummyTarget=GenerateBuildAssetManifest" /> - + https://github.com/dotnet/arcade ed63a7faf2d119829dd971be91bb46b6ebaa1dd2 - + https://github.com/dotnet/arcade - ed63a7faf2d119829dd971be91bb46b6ebaa1dd2 + e31dd0f6fd12a136a2310a308d235c360703b221 https://github.com/aspnet/Extensions diff --git a/eng/helix/helix.proj b/eng/helix/helix.proj index 9e27f2ac56..128356cb03 100644 --- a/eng/helix/helix.proj +++ b/eng/helix/helix.proj @@ -15,7 +15,7 @@ $(BUILD_BUILDNUMBER) false false - false + true true aspnetcore true diff --git a/eng/helix/vstest/runtests.cmd b/eng/helix/vstest/runtests.cmd index 802297f4a8..647e482027 100644 --- a/eng/helix/vstest/runtests.cmd +++ b/eng/helix/vstest/runtests.cmd @@ -36,7 +36,7 @@ REM only puts the explicit filter traits the user provided in REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md set NONFLAKY_FILTER="Flaky:All!=true&Flaky:Helix:All!=true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue:%HELIX%!=true" echo Running non-flaky tests. -%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --logger:console;verbosity=normal --TestCaseFilter:%NONFLAKY_FILTER% +%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --TestCaseFilter:%NONFLAKY_FILTER% if errorlevel 1 ( echo Failure in non-flaky test 1>&2 set exit_code=1 @@ -45,7 +45,7 @@ if errorlevel 1 ( set FLAKY_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:%HELIX%=true" echo Running known-flaky tests. -%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --logger:console;verbosity=normal --TestCaseFilter:%FLAKY_FILTER% +%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --TestCaseFilter:%FLAKY_FILTER% if errorlevel 1 ( echo Failure in flaky test 1>&2 REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1 diff --git a/eng/helix/vstest/runtests.sh b/eng/helix/vstest/runtests.sh index b7b9b812d7..ce34df6222 100644 --- a/eng/helix/vstest/runtests.sh +++ b/eng/helix/vstest/runtests.sh @@ -79,7 +79,6 @@ if [ $nonflaky_exitcode != 0 ]; then echo "Non-flaky tests failed!" 1>&2 # DO NOT EXIT fi - FLAKY_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:$HELIX=true" echo "Running known-flaky tests." $DOTNET_ROOT/dotnet vstest $1 --logger:trx --TestCaseFilter:"$FLAKY_FILTER" diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 40887fadd7..2768e42a85 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -52,7 +52,7 @@ - + diff --git a/global.json b/global.json index 6f3d1c6843..b68e6e23da 100644 --- a/global.json +++ b/global.json @@ -4,6 +4,6 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.13.0", - "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19252.2" + "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19253.2" } } diff --git a/src/Servers/Kestrel/Directory.Build.props b/src/Servers/Kestrel/Directory.Build.props index 0063803868..05b71894da 100644 --- a/src/Servers/Kestrel/Directory.Build.props +++ b/src/Servers/Kestrel/Directory.Build.props @@ -6,6 +6,7 @@ + $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)shared\ diff --git a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs index 9c53407be9..3177677b01 100644 --- a/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs +++ b/src/Servers/Kestrel/Kestrel/test/GeneratedCodeTests.cs @@ -17,12 +17,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2223", FlakyOn.Helix.All)] public void GeneratedCodeIsUpToDate() { - var repositoryRoot = typeof(GeneratedCodeTests).Assembly.GetCustomAttributes().First(f => string.Equals(f.Key, "RepositoryRoot", StringComparison.OrdinalIgnoreCase)).Value; - - var httpHeadersGeneratedPath = Path.Combine(repositoryRoot, "src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs"); - var httpProtocolGeneratedPath = Path.Combine(repositoryRoot, "src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.Generated.cs"); - var httpUtilitiesGeneratedPath = Path.Combine(repositoryRoot, "src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.Generated.cs"); - var transportConnectionGeneratedPath = Path.Combine(repositoryRoot, "src/Servers/Kestrel/Transport.Abstractions/src/Internal/TransportConnection.Generated.cs"); + var httpHeadersGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "HttpHeaders.Generated.cs"); + var httpProtocolGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "HttpProtocol.Generated.cs"); + var httpUtilitiesGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "HttpUtilities.Generated.cs"); + var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory,"shared", "GeneratedContent", "TransportConnection.Generated.cs"); var testHttpHeadersGeneratedPath = Path.GetTempFileName(); var testHttpProtocolGeneratedPath = Path.GetTempFileName(); 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 18e0e3ae9c..c17725d54b 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 @@ -1,4 +1,4 @@ - + netcoreapp3.0 @@ -9,6 +9,10 @@ + + + + <_Parameter1>RepositoryRoot diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs index af802990cb..3c392b00ce 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/HandshakeTests.cs @@ -20,6 +20,7 @@ using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 { [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] + [SkipOnHelix(Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)] public class HandshakeTests : LoggedTest { diff --git a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs index c7a0a89af6..3bb34f025d 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/Http2/ShutdownTests.cs @@ -23,6 +23,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 { [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win10)] + [SkipOnHelix(Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 public class ShutdownTests : TestApplicationErrorLoggerLoggedTest { private static X509Certificate2 _x509Certificate2 = TestResources.GetTestCertificate(); @@ -42,6 +43,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.Http2 } [ConditionalFact] + [SkipOnHelix(Queues = "Fedora.28.Amd64.Open")] // https://github.com/aspnet/AspNetCore/issues/9985 + [Flaky("https://github.com/aspnet/AspNetCore/issues/9985", FlakyOn.Helix.All)] public async Task GracefulShutdownWaitsForRequestsToFinish() { var requestStarted = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecCommands.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecCommands.cs index 1d545e84e2..43dbd581ea 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecCommands.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecCommands.cs @@ -16,6 +16,33 @@ namespace Interop.FunctionalTests { public static class H2SpecCommands { + #region chmod + // user permissions + const int S_IRUSR = 0x100; + const int S_IWUSR = 0x80; + const int S_IXUSR = 0x40; + + // group permission + const int S_IRGRP = 0x20; + const int S_IWGRP = 0x10; + const int S_IXGRP = 0x8; + + // other permissions + const int S_IROTH = 0x4; + const int S_IWOTH = 0x2; + const int S_IXOTH = 0x1; + + const int _0755 = + S_IRUSR | S_IXUSR | S_IWUSR + | S_IRGRP | S_IXGRP + | S_IROTH | S_IXOTH; + + [DllImport("libc", SetLastError = true)] + private static extern int chmod(string pathname, int mode); + + private static int chmod755(string pathname) => chmod(pathname, _0755); + #endregion + private const int TimeoutSeconds = 15; private static string GetToolLocation() @@ -27,11 +54,15 @@ namespace Interop.FunctionalTests } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - return Path.Combine(root, "linux", "h2spec"); + var toolPath = Path.Combine(root, "linux", "h2spec"); + chmod755(toolPath); + return toolPath; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - return Path.Combine(root, "darwin", "h2spec"); + var toolPath = Path.Combine(root, "darwin", "h2spec"); + chmod755(toolPath); + return toolPath; } throw new NotImplementedException("Invalid OS"); } diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index dc0fce4e87..3e1636490a 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -21,6 +21,7 @@ namespace Interop.FunctionalTests [OSSkipCondition(OperatingSystems.MacOSX, SkipReason = "Missing SslStream ALPN support: https://github.com/dotnet/corefx/issues/30492")] [MinimumOSVersion(OperatingSystems.Windows, WindowsVersions.Win81, SkipReason = "Missing Windows ALPN support: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation#Support")] + [SkipOnHelix(Queues = "Debian.8.Amd64.Open")] // Debian 8 uses OpenSSL 1.0.1 which does not support HTTP/2 public class H2SpecTests : LoggedTest { [ConditionalTheory] diff --git a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj index 1576d542e1..98752a3776 100644 --- a/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj +++ b/src/Servers/Kestrel/test/Sockets.FunctionalTests/Sockets.FunctionalTests.csproj @@ -10,6 +10,7 @@ + diff --git a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj index faab2020b0..69d005efeb 100644 --- a/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj +++ b/src/Tools/dotnet-watch/test/dotnet-watch.Tests.csproj @@ -32,10 +32,16 @@ - + + + + +