From 031991f32f059b64374e6d257cbe573304dd577f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 13 May 2022 11:40:45 -0500 Subject: Add ability to skip tests at runtime, and skip long running cache tests 6665 --- .../msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs (limited to 'src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs') diff --git a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs b/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs deleted file mode 100644 index a7646568..00000000 --- a/src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.MsiE2E -{ - using System; - using System.Security.Principal; - - public class MsiE2EFixture - { - const string RequiredEnvironmentVariableName = "RuntimeTestsEnabled"; - - public MsiE2EFixture() - { - using var identity = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(identity); - if (!principal.IsInRole(WindowsBuiltInRole.Administrator)) - { - throw new InvalidOperationException("These tests must run elevated."); - } - - var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName); - if (!bool.TryParse(testsEnabledString, out var testsEnabled) || !testsEnabled) - { - throw new InvalidOperationException($"These tests affect machine state. Set the {RequiredEnvironmentVariableName} environment variable to true to accept the consequences."); - } - } - } -} -- cgit v1.2.3-55-g6feb