diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-13 11:40:45 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-13 12:35:15 -0500 |
commit | 031991f32f059b64374e6d257cbe573304dd577f (patch) | |
tree | 9d11ebb5d8595bf45c507f38d637b14915af7630 /src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs | |
parent | ad6d2636f60b04ee68656f99fb3bd56a86ba5983 (diff) | |
download | wix-031991f32f059b64374e6d257cbe573304dd577f.tar.gz wix-031991f32f059b64374e6d257cbe573304dd577f.tar.bz2 wix-031991f32f059b64374e6d257cbe573304dd577f.zip |
Add ability to skip tests at runtime, and skip long running cache tests
6665
Diffstat (limited to 'src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs')
-rw-r--r-- | src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs b/src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs deleted file mode 100644 index babfcbc3..00000000 --- a/src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolsetTest.BurnE2E | ||
4 | { | ||
5 | using System; | ||
6 | using System.Security.Principal; | ||
7 | |||
8 | public class BurnE2EFixture | ||
9 | { | ||
10 | const string RequiredEnvironmentVariableName = "RuntimeTestsEnabled"; | ||
11 | |||
12 | public BurnE2EFixture() | ||
13 | { | ||
14 | using var identity = WindowsIdentity.GetCurrent(); | ||
15 | var principal = new WindowsPrincipal(identity); | ||
16 | if (!principal.IsInRole(WindowsBuiltInRole.Administrator)) | ||
17 | { | ||
18 | throw new InvalidOperationException("These tests must run elevated."); | ||
19 | } | ||
20 | |||
21 | var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName); | ||
22 | if (!bool.TryParse(testsEnabledString, out var testsEnabled) || !testsEnabled) | ||
23 | { | ||
24 | throw new InvalidOperationException($"These tests affect machine state. Set the {RequiredEnvironmentVariableName} environment variable to true to accept the consequences."); | ||
25 | } | ||
26 | } | ||
27 | } | ||
28 | } | ||