From 7d641f87969be1ce160a8f3f504e5a1d2fb512cb Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 30 Jul 2018 08:27:06 -0700 Subject: [PATCH] Skip VSTS attribute (#1115) --- .vsts-pipelines/templates/build-steps.yml | 2 ++ .../Common.FunctionalTests/SkipVSTSAttribute.cs | 17 +++++++++++++++++ .../Utilities/SkipIISAttribute.cs | 0 .../OutOfProcess/HttpsTest.cs | 1 + 4 files changed, 20 insertions(+) create mode 100644 test/Common.FunctionalTests/SkipVSTSAttribute.cs delete mode 100644 test/Common.FunctionalTests/Utilities/SkipIISAttribute.cs diff --git a/.vsts-pipelines/templates/build-steps.yml b/.vsts-pipelines/templates/build-steps.yml index 40843183ea..33d1e65180 100644 --- a/.vsts-pipelines/templates/build-steps.yml +++ b/.vsts-pipelines/templates/build-steps.yml @@ -3,6 +3,8 @@ phases: parameters: agentOs: Windows beforeBuild: + - powershell: "git submodule update --init" + displayName: Update submodules - powershell: "& ./tools/update_schema.ps1" displayName: Update ANCM schema - powershell: Restart-Service w3svc diff --git a/test/Common.FunctionalTests/SkipVSTSAttribute.cs b/test/Common.FunctionalTests/SkipVSTSAttribute.cs new file mode 100644 index 0000000000..8e88fc8c26 --- /dev/null +++ b/test/Common.FunctionalTests/SkipVSTSAttribute.cs @@ -0,0 +1,17 @@ +// 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 Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] + public sealed class SkipInVSTSAttribute : Attribute, ITestCondition + { + public bool IsMet => string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI")); + + public string SkipReason => "Running in VSTS"; + } +} diff --git a/test/Common.FunctionalTests/Utilities/SkipIISAttribute.cs b/test/Common.FunctionalTests/Utilities/SkipIISAttribute.cs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs index ff9996c851..4f0c93b400 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs @@ -18,6 +18,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests // So these tests always have to use ports in this range, and we can't rely on OS-allocated ports without a whole lot of ceremony around // creating self-signed certificates and registering SSL bindings with HTTP.sys // Test specific to IISExpress + [SkipInVSTS] public class HttpsTest : IISFunctionalTestBase { public HttpsTest(ITestOutputHelper output) : base(output)