Add ability to skip tests at runtime, and skip long running cache tests
6665
Sean Hall committed
May 13, 2022 at 11:40 UTC
031991f32f059b64374e6d257cbe573304dd577f
38 files changed
+423
-194
src/internal/WixBuildTools.TestSupport/WixBuildTools.TestSupport.csproj
+1
-1
@@ -21,6 +21,6 @@
21
</ItemGroup>
22
23
<ItemGroup>
24
- <PackageReference Include="xunit.assert" />
24
+ <PackageReference Include="xunit" />
25
</ItemGroup>
26
</Project>
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkipTestException.cs
new
+15
@@ -0,0 +1,15 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System;
6
+
7
+ public class SkipTestException : Exception
8
+ {
9
+ public SkipTestException(string reason)
10
+ : base(reason)
11
+ {
12
+
13
+ }
14
+ }
15
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactAttribute.cs
new
+13
@@ -0,0 +1,13 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using Xunit;
6
+ using Xunit.Sdk;
7
+
8
+ // https://github.com/xunit/samples.xunit/blob/5dc1d35a63c3394a8678ac466b882576a70f56f6/DynamicSkipExample
9
+ [XunitTestCaseDiscoverer("WixBuildTools.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixBuildTools.TestSupport")]
10
+ public class SkippableFactAttribute : FactAttribute
11
+ {
12
+ }
13
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactDiscoverer.cs
new
+23
@@ -0,0 +1,23 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System.Collections.Generic;
6
+ using Xunit.Abstractions;
7
+ using Xunit.Sdk;
8
+
9
+ public class SkippableFactDiscoverer : IXunitTestCaseDiscoverer
10
+ {
11
+ private IMessageSink DiagnosticMessageSink { get; }
12
+
13
+ public SkippableFactDiscoverer(IMessageSink diagnosticMessageSink)
14
+ {
15
+ this.DiagnosticMessageSink = diagnosticMessageSink;
16
+ }
17
+
18
+ public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
19
+ {
20
+ yield return new SkippableFactTestCase(this.DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), discoveryOptions.MethodDisplayOptionsOrDefault(), testMethod);
21
+ }
22
+ }
23
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactMessageBus.cs
new
+40
@@ -0,0 +1,40 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System.Linq;
6
+ using Xunit.Abstractions;
7
+ using Xunit.Sdk;
8
+
9
+ public class SkippableFactMessageBus : IMessageBus
10
+ {
11
+ private IMessageBus InnerBus { get; }
12
+
13
+ public SkippableFactMessageBus(IMessageBus innerBus)
14
+ {
15
+ this.InnerBus = innerBus;
16
+ }
17
+
18
+ public int DynamicallySkippedTestCount { get; private set; }
19
+
20
+ public void Dispose()
21
+ {
22
+ }
23
+
24
+ public bool QueueMessage(IMessageSinkMessage message)
25
+ {
26
+ if (message is ITestFailed testFailed)
27
+ {
28
+ var exceptionType = testFailed.ExceptionTypes.FirstOrDefault();
29
+ if (exceptionType == typeof(SkipTestException).FullName)
30
+ {
31
+ ++this.DynamicallySkippedTestCount;
32
+ return this.InnerBus.QueueMessage(new TestSkipped(testFailed.Test, testFailed.Messages.FirstOrDefault()));
33
+ }
34
+ }
35
+
36
+ // Nothing we care about, send it on its way
37
+ return this.InnerBus.QueueMessage(message);
38
+ }
39
+ }
40
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableFactTestCase.cs
new
+40
@@ -0,0 +1,40 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System;
6
+ using System.ComponentModel;
7
+ using System.Threading;
8
+ using System.Threading.Tasks;
9
+ using Xunit.Abstractions;
10
+ using Xunit.Sdk;
11
+
12
+ public class SkippableFactTestCase : XunitTestCase
13
+ {
14
+ [EditorBrowsable(EditorBrowsableState.Never)]
15
+ [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")]
16
+ public SkippableFactTestCase() { }
17
+
18
+ public SkippableFactTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, object[] testMethodArguments = null)
19
+ : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod, testMethodArguments)
20
+ {
21
+ }
22
+
23
+ public override async Task<RunSummary> RunAsync(IMessageSink diagnosticMessageSink,
24
+ IMessageBus messageBus,
25
+ object[] constructorArguments,
26
+ ExceptionAggregator aggregator,
27
+ CancellationTokenSource cancellationTokenSource)
28
+ {
29
+ var skipMessageBus = new SkippableFactMessageBus(messageBus);
30
+ var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource);
31
+ if (skipMessageBus.DynamicallySkippedTestCount > 0)
32
+ {
33
+ result.Failed -= skipMessageBus.DynamicallySkippedTestCount;
34
+ result.Skipped += skipMessageBus.DynamicallySkippedTestCount;
35
+ }
36
+
37
+ return result;
38
+ }
39
+ }
40
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryAttribute.cs
new
+12
@@ -0,0 +1,12 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using Xunit;
6
+ using Xunit.Sdk;
7
+
8
+ [XunitTestCaseDiscoverer("WixBuildTools.TestSupport.XunitExtensions.SkippableFactDiscoverer", "WixBuildTools.TestSupport")]
9
+ public class SkippableTheoryAttribute : TheoryAttribute
10
+ {
11
+ }
12
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryDiscoverer.cs
new
+41
@@ -0,0 +1,41 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System.Collections.Generic;
6
+ using Xunit.Abstractions;
7
+ using Xunit.Sdk;
8
+
9
+ public class SkippableTheoryDiscoverer : IXunitTestCaseDiscoverer
10
+ {
11
+ private IMessageSink DiagnosticMessageSink { get; }
12
+ private TheoryDiscoverer TheoryDiscoverer { get; }
13
+
14
+ public SkippableTheoryDiscoverer(IMessageSink diagnosticMessageSink)
15
+ {
16
+ this.DiagnosticMessageSink = diagnosticMessageSink;
17
+
18
+ this.TheoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink);
19
+ }
20
+
21
+ public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
22
+ {
23
+ var defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault();
24
+ var defaultMethodDisplayOptions = discoveryOptions.MethodDisplayOptionsOrDefault();
25
+
26
+ // Unlike fact discovery, the underlying algorithm for theories is complex, so we let the theory discoverer
27
+ // do its work, and do a little on-the-fly conversion into our own test cases.
28
+ foreach (var testCase in this.TheoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute))
29
+ {
30
+ if (testCase is XunitTheoryTestCase)
31
+ {
32
+ yield return new SkippableTheoryTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod);
33
+ }
34
+ else
35
+ {
36
+ yield return new SkippableFactTestCase(this.DiagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testCase.TestMethod, testCase.TestMethodArguments);
37
+ }
38
+ }
39
+ }
40
+ }
41
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SkippableTheoryTestCase.cs
new
+41
@@ -0,0 +1,41 @@
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 WixBuildTools.TestSupport.XunitExtensions
4
+{
5
+ using System;
6
+ using System.ComponentModel;
7
+ using System.Threading;
8
+ using System.Threading.Tasks;
9
+ using Xunit.Abstractions;
10
+ using Xunit.Sdk;
11
+
12
+ public class SkippableTheoryTestCase : XunitTheoryTestCase
13
+ {
14
+ [EditorBrowsable(EditorBrowsableState.Never)]
15
+ [Obsolete("Called by the de-serializer; should only be called by deriving classes for de-serialization purposes")]
16
+ public SkippableTheoryTestCase() { }
17
+
18
+ public SkippableTheoryTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod)
19
+ : base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod)
20
+ {
21
+ }
22
+
23
+ public override async Task<RunSummary> RunAsync(IMessageSink diagnosticMessageSink,
24
+ IMessageBus messageBus,
25
+ object[] constructorArguments,
26
+ ExceptionAggregator aggregator,
27
+ CancellationTokenSource cancellationTokenSource)
28
+ {
29
+ // Duplicated code from SkippableFactTestCase. I'm sure we could find a way to de-dup with some thought.
30
+ var skipMessageBus = new SkippableFactMessageBus(messageBus);
31
+ var result = await base.RunAsync(diagnosticMessageSink, skipMessageBus, constructorArguments, aggregator, cancellationTokenSource);
32
+ if (skipMessageBus.DynamicallySkippedTestCount > 0)
33
+ {
34
+ result.Failed -= skipMessageBus.DynamicallySkippedTestCount;
35
+ result.Skipped += skipMessageBus.DynamicallySkippedTestCount;
36
+ }
37
+
38
+ return result;
39
+ }
40
+ }
41
+}
src/internal/WixBuildTools.TestSupport/XunitExtensions/SucceededException.cs
renamed
src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs
renamed
+11
@@ -6,6 +6,7 @@ namespace WixBuildTools.TestSupport
6
using System.Collections.Generic;
7
using System.Linq;
8
using System.Xml.Linq;
9
+ using WixBuildTools.TestSupport.XunitExtensions;
10
using Xunit;
11
12
public class WixAssert : Assert
@@ -41,6 +42,16 @@ namespace WixBuildTools.TestSupport
42
CompareXml(expectedDoc, actualDoc);
43
}
44
45
+ /// <summary>
46
+ /// Dynamically skips the test.
47
+ /// Requires that the test was marked with a fact attribute derived from <see cref="WixBuildTools.TestSupport.XunitExtensions.SkippableFactAttribute" />
48
+ /// or <see cref="WixBuildTools.TestSupport.XunitExtensions.SkippableTheoryAttribute" />
49
+ /// </summary>
50
+ public static void Skip(string message)
51
+ {
52
+ throw new SkipTestException(message);
53
+ }
54
+
55
public static void Succeeded(int hr, string format, params object[] formatArgs)
56
{
57
if (0 > hr)
src/test/burn/WixTestTools/LongRuntimeFactAttribute.cs
new
+27
@@ -0,0 +1,27 @@
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 WixTestTools
4
+{
5
+ using System;
6
+
7
+ public class LongRuntimeFactAttribute : RuntimeFactAttribute
8
+ {
9
+ const string RequiredEnvironmentVariableName = "LongRuntimeTestsEnabled";
10
+
11
+ public static bool LongRuntimeTestsEnabled { get; }
12
+
13
+ static LongRuntimeFactAttribute()
14
+ {
15
+ var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName);
16
+ LongRuntimeTestsEnabled = Boolean.TryParse(testsEnabledString, out var testsEnabled) && testsEnabled;
17
+ }
18
+
19
+ public LongRuntimeFactAttribute()
20
+ {
21
+ if (!LongRuntimeTestsEnabled)
22
+ {
23
+ this.Skip = $"These tests take a long time to run, so the {RequiredEnvironmentVariableName} environment variable must be set to true.";
24
+ }
25
+ }
26
+ }
27
+}
src/test/burn/WixTestTools/RuntimeFactAttribute.cs
new
+34
@@ -0,0 +1,34 @@
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 WixTestTools
4
+{
5
+ using System;
6
+ using System.Security.Principal;
7
+ using WixBuildTools.TestSupport.XunitExtensions;
8
+
9
+ public class RuntimeFactAttribute : SkippableFactAttribute
10
+ {
11
+ const string RequiredEnvironmentVariableName = "RuntimeTestsEnabled";
12
+
13
+ public static bool RuntimeTestsEnabled { get; }
14
+ public static bool RunningAsAdministrator { get; }
15
+
16
+ static RuntimeFactAttribute()
17
+ {
18
+ using var identity = WindowsIdentity.GetCurrent();
19
+ var principal = new WindowsPrincipal(identity);
20
+ RunningAsAdministrator = principal.IsInRole(WindowsBuiltInRole.Administrator);
21
+
22
+ var testsEnabledString = Environment.GetEnvironmentVariable(RequiredEnvironmentVariableName);
23
+ RuntimeTestsEnabled = Boolean.TryParse(testsEnabledString, out var testsEnabled) && testsEnabled;
24
+ }
25
+
26
+ public RuntimeFactAttribute()
27
+ {
28
+ if (!RuntimeTestsEnabled || !RunningAsAdministrator)
29
+ {
30
+ this.Skip = $"These tests must run elevated ({(RunningAsAdministrator ? "passed" : "failed")}). These tests affect machine state. To accept the consequences, set the {RequiredEnvironmentVariableName} environment variable to true ({(RuntimeTestsEnabled ? "passed" : "failed")}).";
31
+ }
32
+ }
33
+ }
34
+}
src/test/burn/WixToolsetTest.BurnE2E/BasicFunctionalityTests.cs
+11
-10
@@ -4,6 +4,7 @@ namespace WixToolsetTest.BurnE2E
4
{
5
using System;
6
using System.IO;
7
+ using WixTestTools;
8
using Xunit;
9
using Xunit.Abstractions;
10
@@ -11,59 +12,59 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public BasicFunctionalityTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
14
- [Fact]
15
+ [RuntimeFact]
16
public void CanInstallAndUninstallSimpleBundle_x86_wixstdba()
17
{
18
this.CanInstallAndUninstallSimpleBundle("PackageA", "BundleA");
19
}
20
20
- [Fact]
21
+ [RuntimeFact]
22
public void CanInstallAndUninstallSimpleBundle_x86_testba()
23
{
24
this.CanInstallAndUninstallSimpleBundle("PackageA", "BundleB");
25
}
26
26
- [Fact]
27
+ [RuntimeFact]
28
public void CanInstallAndUninstallSimpleBundle_x86_dnctestba()
29
{
30
this.CanInstallAndUninstallSimpleBundle("PackageA", "BundleC");
31
}
32
32
- [Fact]
33
+ [RuntimeFact]
34
public void CanInstallAndUninstallSimpleBundle_x86_wixba()
35
{
36
this.CanInstallAndUninstallSimpleBundle("PackageA", "BundleD");
37
}
38
38
- [Fact]
39
+ [RuntimeFact]
40
public void CanInstallAndUninstallSimpleBundle_x64_wixstdba()
41
{
42
this.CanInstallAndUninstallSimpleBundle("PackageA_x64", "BundleA_x64");
43
}
44
45
#if DEBUG
45
- [Fact(Skip = "0xc0000005 during shutdown from tiptsf.dll")]
46
+ [RuntimeFact(Skip = "0xc0000005 during shutdown from tiptsf.dll")]
47
#else
47
- [Fact]
48
+ [RuntimeFact]
49
#endif
50
public void CanInstallAndUninstallSimplePerUserBundle_x64_wixstdba()
51
{
52
this.CanInstallAndUninstallSimpleBundle("PackageApu_x64", "BundleApu_x64", "PackagePerUser.wxs");
53
}
54
54
- [Fact]
55
+ [RuntimeFact]
56
public void CanInstallAndUninstallSimpleBundle_x64_testba()
57
{
58
this.CanInstallAndUninstallSimpleBundle("PackageA_x64", "BundleB_x64");
59
}
60
60
- [Fact]
61
+ [RuntimeFact]
62
public void CanInstallAndUninstallSimpleBundle_x64_dnctestba()
63
{
64
this.CanInstallAndUninstallSimpleBundle("PackageA_x64", "BundleC_x64");
65
}
66
66
- [Fact]
67
+ [RuntimeFact]
68
public void CanInstallAndUninstallSimpleBundle_x64_dncwixba()
69
{
70
this.CanInstallAndUninstallSimpleBundle("PackageA_x64", "BundleD_x64");
src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs
+6
-6
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public BundlePackageTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
- [Fact]
15
+ [RuntimeFact]
16
public void CanInstallAndUninstallBundlePackages()
17
{
18
var packageA = this.CreatePackageInstaller(@"..\BasicFunctionalityTests\PackageA");
@@ -49,7 +49,7 @@ namespace WixToolsetTest.BurnE2E
49
Assert.False(File.Exists(packageA64SourceCodeFilePath), $"PackageA_x64 payload should have been removed by uninstall from: {packageA64SourceCodeFilePath}");
50
}
51
52
- [Fact]
52
+ [RuntimeFact]
53
public void CanInstallUpgradeBundlePackage()
54
{
55
var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1");
@@ -65,7 +65,7 @@ namespace WixToolsetTest.BurnE2E
65
bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache();
66
}
67
68
- [Fact]
68
+ [RuntimeFact]
69
public void CanInstallV3BundlePackage()
70
{
71
var v3BundleId = "{215a70db-ab35-48c7-be51-d66eaac87177}";
@@ -85,7 +85,7 @@ namespace WixToolsetTest.BurnE2E
85
Assert.Null(v3Registration.SystemComponent);
86
}
87
88
- [Fact]
88
+ [RuntimeFact]
89
public void CanLeaveBundlePackageVisible()
90
{
91
var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1");
@@ -103,7 +103,7 @@ namespace WixToolsetTest.BurnE2E
103
bundleAv1.VerifyRegisteredAndInPackageCache();
104
}
105
106
- [Fact]
106
+ [RuntimeFact]
107
public void CanReferenceCountBundlePackage()
108
{
109
var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1");
@@ -123,7 +123,7 @@ namespace WixToolsetTest.BurnE2E
123
bundleAv1.VerifyRegisteredAndInPackageCache();
124
}
125
126
- [Fact]
126
+ [RuntimeFact]
127
public void CanSkipObsoleteBundlePackage()
128
{
129
var bundleAv1 = this.CreateBundleInstaller(@"..\UpgradeRelatedBundleTests\BundleAv1");
src/test/burn/WixToolsetTest.BurnE2E/BurnE2EFixture.cs
deleted
-28
@@ -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
-}
src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs
+1
-1
@@ -73,7 +73,7 @@ namespace WixToolsetTest.BurnE2E
73
}
74
75
[CollectionDefinition("BurnE2E", DisableParallelization = true)]
76
- public class BurnE2ECollectionDefinition : ICollectionFixture<BurnE2EFixture>
76
+ public class BurnE2ECollectionDefinition
77
{
78
}
79
}
src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
+9
-26
@@ -15,7 +15,7 @@ namespace WixToolsetTest.BurnE2E
15
{
16
public CacheTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
17
18
- private bool Is5GBFileAvailable()
18
+ private void SkipIf5GBFileUnavailable()
19
{
20
// Recreate the 5GB payload to avoid having to copy it to the VM to run the tests.
21
const long FiveGB = 5_368_709_120;
@@ -27,8 +27,7 @@ namespace WixToolsetTest.BurnE2E
27
var drive = new DriveInfo(targetFilePath.Substring(0, 1));
28
if (drive.AvailableFreeSpace < FiveGB + OneGB)
29
{
30
- Console.WriteLine($"Skipping {this.TestContext.TestName} because there is not enough disk space available to run the test.");
31
- return false;
30
+ WixAssert.Skip($"Skipping {this.TestContext.TestName} because there is not enough disk space available to run the test.");
31
}
32
33
if (!File.Exists(targetFilePath))
@@ -40,17 +39,12 @@ namespace WixToolsetTest.BurnE2E
39
};
40
testTool.Run(true);
41
}
43
-
44
- return true;
42
}
43
47
- [Fact]
44
+ [LongRuntimeFact]
45
public void CanCache5GBFile()
46
{
50
- if (!this.Is5GBFileAvailable())
51
- {
52
- return;
53
- }
47
+ this.SkipIf5GBFileUnavailable();
48
49
var packageA = this.CreatePackageInstaller("PackageA");
50
var bundleC = this.CreateBundleInstaller("BundleC");
@@ -65,10 +59,7 @@ namespace WixToolsetTest.BurnE2E
59
60
private string Cache5GBFileFromDownload(bool disableRangeRequests)
61
{
68
- if (!this.Is5GBFileAvailable())
69
- {
70
- return null;
71
- }
62
+ this.SkipIf5GBFileUnavailable();
63
64
var packageA = this.CreatePackageInstaller("PackageA");
65
var bundleC = this.CreateBundleInstaller("BundleC");
@@ -100,33 +91,25 @@ namespace WixToolsetTest.BurnE2E
91
return installLogPath;
92
}
93
103
- [Fact]
94
+ [LongRuntimeFact]
95
public void CanCache5GBFileFromDownloadWithRangeRequestSupport()
96
{
97
var logPath = this.Cache5GBFileFromDownload(false);
107
- if (logPath == null)
108
- {
109
- return;
110
- }
98
99
Assert.False(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
100
Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
101
}
102
116
- [Fact]
103
+ [LongRuntimeFact]
104
public void CanCache5GBFileFromDownloadWithoutRangeRequestSupport()
105
{
106
var logPath = this.Cache5GBFileFromDownload(true);
120
- if (logPath == null)
121
- {
122
- return;
123
- }
107
108
Assert.True(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
109
Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned for URL: http://localhost:9999/e2e/BundleC/fivegb.file"));
110
}
111
129
- [Fact]
112
+ [RuntimeFact]
113
public void CanDownloadPayloadsFromMissingAttachedContainer()
114
{
115
var packageA = this.CreatePackageInstaller("PackageA");
@@ -178,7 +161,7 @@ namespace WixToolsetTest.BurnE2E
161
Assert.True(LogVerifier.MessageInLogFile(modifyLogPath, "Ignoring failure to get size and time for URL: http://localhost:9999/e2e/BundleA/PackageB.msi (error 0x80070002)"));
162
}
163
181
- [Fact]
164
+ [RuntimeFact]
165
public void CanFindAttachedContainerFromRenamedBundle()
166
{
167
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/ContainerTests.cs
+2
-2
@@ -2,14 +2,14 @@
2
3
namespace WixToolsetTest.BurnE2E
4
{
5
- using Xunit;
5
+ using WixTestTools;
6
using Xunit.Abstractions;
7
8
public class ContainerTests : BurnE2ETests
9
{
10
public ContainerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
11
12
- [Fact]
12
+ [RuntimeFact]
13
public void CanSupportMultipleAttachedContainers()
14
{
15
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs
+22
-22
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public DependencyTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
- [Fact]
15
+ [RuntimeFact]
16
public void CanKeepSameExactPackageAfterUpgradingBundle()
17
{
18
var packageFv1 = this.CreatePackageInstaller("PackageFv1");
@@ -40,7 +40,7 @@ namespace WixToolsetTest.BurnE2E
40
packageFv1.VerifyInstalled(false);
41
}
42
43
- [Fact (Skip = "https://github.com/wixtoolset/issues/issues/6401")]
43
+ [RuntimeFact (Skip = "https://github.com/wixtoolset/issues/issues/6401")]
44
public void CanKeepSameExactPackageAfterUpgradingBundleWithSlipstreamedPatch()
45
{
46
var originalVersion = "1.0.0.0";
@@ -79,7 +79,7 @@ namespace WixToolsetTest.BurnE2E
79
packageA.VerifyInstalled(false);
80
}
81
82
- [Fact]
82
+ [RuntimeFact]
83
public void CanKeepUpgradedPackageAfterUninstallUpgradedBundle()
84
{
85
var testRegistryValueExe = "ExeA";
@@ -123,7 +123,7 @@ namespace WixToolsetTest.BurnE2E
123
bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.1.0");
124
}
125
126
- [Fact]
126
+ [RuntimeFact]
127
public void UninstallsOrphanCompatiblePackages()
128
{
129
var testRegistryValueExe = "ExeA";
@@ -181,7 +181,7 @@ namespace WixToolsetTest.BurnE2E
181
bundleAv1.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
182
}
183
184
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
184
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
185
public void CanMinorUpgradeDependencyPackageFromPatchBundle()
186
{
187
var originalVersion = "1.0.0.0";
@@ -231,7 +231,7 @@ namespace WixToolsetTest.BurnE2E
231
}
232
}
233
234
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
234
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
235
public void CanMinorUpgradeDependencyPackageFromPatchBundleThenUninstallToRestoreBase()
236
{
237
var originalVersion = "1.0.0.0";
@@ -291,7 +291,7 @@ namespace WixToolsetTest.BurnE2E
291
}
292
}
293
294
- [Fact]
294
+ [RuntimeFact]
295
public void CanUninstallBaseWithAddOnsWhenAllSharePackages()
296
{
297
var testRegistryValueExe = "ExeA";
@@ -347,7 +347,7 @@ namespace WixToolsetTest.BurnE2E
347
}
348
}
349
350
- [Fact]
350
+ [RuntimeFact]
351
public void CanUpgradeBaseWithAddOns()
352
{
353
var testRegistryValueExe = "ExeA";
@@ -405,7 +405,7 @@ namespace WixToolsetTest.BurnE2E
405
}
406
}
407
408
- [Fact]
408
+ [RuntimeFact]
409
public void CanUninstallDependencyPackagesWithBundlesUninstalledInFifoOrder()
410
{
411
var testRegistryValueExe = "ExeA";
@@ -446,7 +446,7 @@ namespace WixToolsetTest.BurnE2E
446
packageB.VerifyInstalled(false);
447
}
448
449
- [Fact]
449
+ [RuntimeFact]
450
public void CanUninstallDependencyPackagesWithBundlesUninstalledInReverseOrder()
451
{
452
var packageA = this.CreatePackageInstaller("PackageAv1");
@@ -480,7 +480,7 @@ namespace WixToolsetTest.BurnE2E
480
packageB.VerifyInstalled(false);
481
}
482
483
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
483
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6401")]
484
public void CanUpgradePatchBundleWithAdditionalPatch()
485
{
486
var originalVersion = "1.0.0.0";
@@ -539,7 +539,7 @@ namespace WixToolsetTest.BurnE2E
539
}
540
}
541
542
- [Fact]
542
+ [RuntimeFact]
543
public void DoesntLoseDependenciesOnFailedMajorUpgradeBundleFromMajorUpdateMsiFifo()
544
{
545
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -611,7 +611,7 @@ namespace WixToolsetTest.BurnE2E
611
packageGv2.VerifyInstalled(false);
612
}
613
614
- [Fact]
614
+ [RuntimeFact]
615
public void DoesntLoseDependenciesOnFailedMajorUpgradeBundleFromMajorUpdateMsiLifo()
616
{
617
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -683,7 +683,7 @@ namespace WixToolsetTest.BurnE2E
683
packageGv2.VerifyInstalled(false);
684
}
685
686
- [Fact]
686
+ [RuntimeFact]
687
public void DoesntLoseDependenciesOnFailedMajorUpgradeBundleFromMinorUpdateMsiFifo()
688
{
689
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -756,7 +756,7 @@ namespace WixToolsetTest.BurnE2E
756
packageGv101.VerifyInstalledWithVersion(false);
757
}
758
759
- [Fact]
759
+ [RuntimeFact]
760
public void DoesntLoseDependenciesOnFailedMajorUpgradeBundleFromMinorUpdateMsiLifo()
761
{
762
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -829,7 +829,7 @@ namespace WixToolsetTest.BurnE2E
829
packageGv101.VerifyInstalledWithVersion(false);
830
}
831
832
- [Fact]
832
+ [RuntimeFact]
833
public void DoesntRegisterDependencyOnPackageNotSelectedForInstall()
834
{
835
var testRegistryValueExe = "ExeA";
@@ -878,7 +878,7 @@ namespace WixToolsetTest.BurnE2E
878
packageB.VerifyInstalled(false);
879
}
880
881
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/3516")]
881
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/3516")]
882
public void DoesntRollbackPackageInstallIfPreexistingDependents()
883
{
884
var packageA = this.CreatePackageInstaller("PackageAv1");
@@ -918,7 +918,7 @@ namespace WixToolsetTest.BurnE2E
918
packageC.VerifyInstalled(false);
919
}
920
921
- [Fact]
921
+ [RuntimeFact]
922
public void RegistersDependencyOnFailedNonVitalPackages()
923
{
924
var packageA = this.CreatePackageInstaller("PackageAv1");
@@ -969,7 +969,7 @@ namespace WixToolsetTest.BurnE2E
969
packageC.VerifyInstalled(false);
970
}
971
972
- [Fact]
972
+ [RuntimeFact]
973
public void RemovesDependencyDuringUpgradeRollback()
974
{
975
var testRegistryValueExe = "ExeA";
@@ -1001,7 +1001,7 @@ namespace WixToolsetTest.BurnE2E
1001
bundleA.VerifyExeTestRegistryRootDeleted(testRegistryValueExe);
1002
}
1003
1004
- [Fact]
1004
+ [RuntimeFact]
1005
public void RemovesDependencyProviderFromUpgradedPackageDuringUninstall()
1006
{
1007
var packageC = this.CreatePackageInstaller("PackageC");
@@ -1044,7 +1044,7 @@ namespace WixToolsetTest.BurnE2E
1044
bundleNv1.VerifyPackageProviderRemoved("PackageG");
1045
}
1046
1047
- [Fact]
1047
+ [RuntimeFact]
1048
public void SkipsCrossScopeDependencyRegistration()
1049
{
1050
var packageA = this.CreatePackageInstaller("PackageAv1");
@@ -1087,7 +1087,7 @@ namespace WixToolsetTest.BurnE2E
1087
packageA.VerifyInstalled(false);
1088
}
1089
1090
- [Fact]
1090
+ [RuntimeFact]
1091
public void CannotInstallWhenDependencyUnsatisfied()
1092
{
1093
var packageA = this.CreatePackageInstaller("PackageAv1");
src/test/burn/WixToolsetTest.BurnE2E/ElevationTests.cs
+2
-2
@@ -2,7 +2,7 @@
2
3
namespace WixToolsetTest.BurnE2E
4
{
5
- using Xunit;
5
+ using WixTestTools;
6
using Xunit.Abstractions;
7
8
public class ElevationTests : BurnE2ETests
@@ -13,7 +13,7 @@ namespace WixToolsetTest.BurnE2E
13
/// This test calls Elevate after Detect, and then calls Plan in OnElevateBegin.
14
/// After calling Plan, it pumps some messages to simulate UI like the UAC callback.
15
/// </summary>
16
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6349")] // CAUTION: this test currently hangs because the Plan request gets dropped.
16
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6349")] // CAUTION: this test currently hangs because the Plan request gets dropped.
17
public void CanExplicitlyElevateAndPlanFromOnElevateBegin()
18
{
19
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/FailureTests.cs
+7
-7
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public FailureTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
- [Fact]
15
+ [RuntimeFact]
16
public void CanCancelExePackageAndAbandonIt()
17
{
18
var bundleD = this.CreateBundleInstaller("BundleD");
@@ -29,7 +29,7 @@ namespace WixToolsetTest.BurnE2E
29
Assert.False(LogVerifier.MessageInLogFile(logPath, "TestRegistryValue: Rollback, ExeA, Version"));
30
}
31
32
- [Fact]
32
+ [RuntimeFact]
33
public void CanCancelExePackageAndWaitUntilItCompletes()
34
{
35
var bundleD = this.CreateBundleInstaller("BundleD");
@@ -50,7 +50,7 @@ namespace WixToolsetTest.BurnE2E
50
bundleD.VerifyExeTestRegistryRootDeleted("ExeA");
51
}
52
53
- [Fact]
53
+ [RuntimeFact]
54
public void CanCancelMsiPackageVeryEarly()
55
{
56
var packageA = this.CreatePackageInstaller("PackageA");
@@ -68,7 +68,7 @@ namespace WixToolsetTest.BurnE2E
68
packageB.VerifyInstalled(false);
69
}
70
71
- [Fact]
71
+ [RuntimeFact]
72
public void CanCancelMsiPackageVeryLate()
73
{
74
var packageA = this.CreatePackageInstaller("PackageA");
@@ -86,7 +86,7 @@ namespace WixToolsetTest.BurnE2E
86
packageB.VerifyInstalled(false);
87
}
88
89
- [Fact]
89
+ [RuntimeFact]
90
public void CanCancelMsiPackageInOnProgress()
91
{
92
var packageA = this.CreatePackageInstaller("PackageA");
@@ -104,7 +104,7 @@ namespace WixToolsetTest.BurnE2E
104
packageB.VerifyInstalled(false);
105
}
106
107
- [Fact]
107
+ [RuntimeFact]
108
public void CanCancelExecuteWhileCaching()
109
{
110
var packageA = this.CreatePackageInstaller("PackageA");
@@ -128,7 +128,7 @@ namespace WixToolsetTest.BurnE2E
128
/// PackageA is not compressed in the bundle and has a Name different from the source file. The Name points to a file that does not exist.
129
/// BundleC should be able to install successfully by ignoring the missing PackageA and installing PackageB.
130
/// </summary>
131
- [Fact]
131
+ [RuntimeFact]
132
public void CanInstallWhenMissingNonVitalPackage()
133
{
134
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/FilesInUseTests.cs
+1
-2
@@ -4,14 +4,13 @@ namespace WixToolsetTest.BurnE2E
4
{
5
using System.IO;
6
using WixTestTools;
7
- using Xunit;
7
using Xunit.Abstractions;
8
9
public class FilesInUseTests : BurnE2ETests
10
{
11
public FilesInUseTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
12
14
- [Fact]
13
+ [RuntimeFact]
14
public void CanCancelInstallAfterRetryingLockedFile()
15
{
16
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/ForwardCompatibleBundleTests.cs
+8
-8
@@ -17,7 +17,7 @@ namespace WixToolsetTest.BurnE2E
17
private const string V100 = "1.0.0.0";
18
private const string V200 = "2.0.0.0";
19
20
- [Fact]
20
+ [RuntimeFact]
21
public void CanIgnoreBundleDependentForUnsafeUninstall()
22
{
23
string providerId = BundleAProviderId;
@@ -49,7 +49,7 @@ namespace WixToolsetTest.BurnE2E
49
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
50
}
51
52
- [Fact]
52
+ [RuntimeFact]
53
public void CanTrack1ForwardCompatibleDependentThroughMajorUpgrade()
54
{
55
string providerId = BundleAProviderId;
@@ -105,7 +105,7 @@ namespace WixToolsetTest.BurnE2E
105
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
106
}
107
108
- [Fact]
108
+ [RuntimeFact]
109
public void CanTrack1ForwardCompatibleDependentThroughMajorUpgradeWithParentNone()
110
{
111
string providerId = BundleAProviderId;
@@ -151,7 +151,7 @@ namespace WixToolsetTest.BurnE2E
151
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
152
}
153
154
- [Fact]
154
+ [RuntimeFact]
155
public void CanTrack2ForwardCompatibleDependentsThroughMajorUpgrade()
156
{
157
string providerId = BundleAProviderId;
@@ -233,7 +233,7 @@ namespace WixToolsetTest.BurnE2E
233
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
234
}
235
236
- [Fact]
236
+ [RuntimeFact]
237
public void CanTrack2ForwardCompatibleDependentsThroughMajorUpgradePerUser()
238
{
239
string providerId = BundleCProviderId;
@@ -315,7 +315,7 @@ namespace WixToolsetTest.BurnE2E
315
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
316
}
317
318
- [Fact]
318
+ [RuntimeFact]
319
public void CanTrack2ForwardCompatibleDependentsThroughMajorUpgradeWithParent()
320
{
321
string providerId = BundleAProviderId;
@@ -401,7 +401,7 @@ namespace WixToolsetTest.BurnE2E
401
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
402
}
403
404
- [Fact]
404
+ [RuntimeFact]
405
public void CanUninstallForwardCompatibleWithBundlesUninstalledInFifoOrder()
406
{
407
string providerId = BundleAProviderId;
@@ -449,7 +449,7 @@ namespace WixToolsetTest.BurnE2E
449
Assert.False(BundleRegistration.TryGetDependencyProviderValue(providerId, "Version", out _));
450
}
451
452
- [Fact]
452
+ [RuntimeFact]
453
public void CanUninstallForwardCompatibleWithBundlesUninstalledInReverseOrder()
454
{
455
string providerId = BundleAProviderId;
src/test/burn/WixToolsetTest.BurnE2E/LayoutTests.cs
+3
-2
@@ -5,6 +5,7 @@ namespace WixToolsetTest.BurnE2E
5
using System.Collections.Generic;
6
using System.IO;
7
using WixBuildTools.TestSupport;
8
+ using WixTestTools;
9
using Xunit;
10
using Xunit.Abstractions;
11
@@ -12,7 +13,7 @@ namespace WixToolsetTest.BurnE2E
13
{
14
public LayoutTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
15
15
- [Fact]
16
+ [RuntimeFact]
17
public void CanLayoutBundleInPlaceWithMissingPayloads()
18
{
19
var bundleA = this.CreateBundleInstaller("BundleA");
@@ -41,7 +42,7 @@ namespace WixToolsetTest.BurnE2E
42
Assert.True(File.Exists(Path.Combine(layoutDirectory, "BundleA.wxs")));
43
}
44
44
- [Fact]
45
+ [RuntimeFact]
46
public void CanLayoutBundleToNewDirectory()
47
{
48
var bundleA = this.CreateBundleInstaller("BundleA");
src/test/burn/WixToolsetTest.BurnE2E/MsiTransactionTests.cs
+2
-2
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public MsiTransactionTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
- [Fact]
15
+ [RuntimeFact]
16
public void CanUpgradeBundleWithMsiTransaction()
17
{
18
var packageA = this.CreatePackageInstaller("PackageA");
@@ -82,7 +82,7 @@ namespace WixToolsetTest.BurnE2E
82
/// package F fails
83
/// Thus, rolling back the transaction should reinstall package Bv1
84
/// </summary>
85
- [Fact]
85
+ [RuntimeFact]
86
public void CanRelyOnMsiTransactionRollback()
87
{
88
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/PatchTests.cs
+5
-4
@@ -5,6 +5,7 @@ namespace WixToolsetTest.BurnE2E
5
using System;
6
using System.IO;
7
using System.Xml;
8
+ using WixTestTools;
9
using Xunit;
10
using Xunit.Abstractions;
11
@@ -12,7 +13,7 @@ namespace WixToolsetTest.BurnE2E
13
{
14
public PatchTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
15
15
- [Fact]
16
+ [RuntimeFact]
17
public void CanRunDetectMultipleTimesWithPatches()
18
{
19
var testBAController = this.CreateTestBAController();
@@ -21,7 +22,7 @@ namespace WixToolsetTest.BurnE2E
22
this.CanInstallBundleWithPatchThenRemoveIt();
23
}
24
24
- [Fact]
25
+ [RuntimeFact]
26
public void CanInstallBundleWithPatchThenRemoveIt()
27
{
28
var originalVersion = "1.0.0.0";
@@ -55,7 +56,7 @@ namespace WixToolsetTest.BurnE2E
56
packageAv1.VerifyTestRegistryRootDeleted();
57
}
58
58
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6675")]
59
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6675")]
60
public void CanPatchSwidTag()
61
{
62
var originalVersion = "1.0.0.0";
@@ -84,7 +85,7 @@ namespace WixToolsetTest.BurnE2E
85
VerifySwidTagVersion(packageTagName, null);
86
}
87
87
- [Fact]
88
+ [RuntimeFact]
89
public void CanInstallBundleWithPatchesTargetingSingleProductThenRemoveIt()
90
{
91
var originalVersion = "1.0.0.0";
src/test/burn/WixToolsetTest.BurnE2E/PrereqBaTests.cs
+3
-2
@@ -4,6 +4,7 @@ namespace WixToolsetTest.BurnE2E
4
{
5
using System;
6
using System.IO;
7
+ using WixTestTools;
8
using Xunit;
9
using Xunit.Abstractions;
10
@@ -18,7 +19,7 @@ namespace WixToolsetTest.BurnE2E
19
/// The preqba doesn't infinitely reload itself after failing to load the managed BA.
20
/// The engine automatically uninstalls the bundle since only permanent packages were installed.
21
/// </summary>
21
- [Fact]
22
+ [RuntimeFact]
23
public void DncPreqBaDetectsInfiniteLoop()
24
{
25
var packageA = this.CreatePackageInstaller("PackageA");
@@ -49,7 +50,7 @@ namespace WixToolsetTest.BurnE2E
50
/// The preqba doesn't infinitely reload itself after failing to load the managed BA.
51
/// The engine automatically uninstalls the bundle since only permanent packages were installed.
52
/// </summary>
52
- [Fact]
53
+ [RuntimeFact]
54
public void MbaPreqBaDetectsInfiniteLoop()
55
{
56
var packageB = this.CreatePackageInstaller("PackageB");
src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
+6
-5
@@ -3,6 +3,7 @@
3
namespace WixToolsetTest.BurnE2E
4
{
5
using System;
6
+ using WixTestTools;
7
using WixToolset.Mba.Core;
8
using Xunit;
9
using Xunit.Abstractions;
@@ -11,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public RegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
14
- [Fact]
15
+ [RuntimeFact]
16
public void AllowsBAToKeepRegistration()
17
{
18
this.CreatePackageInstaller("PackageA");
@@ -37,7 +38,7 @@ namespace WixToolsetTest.BurnE2E
38
Assert.InRange(finalRegistration.EstimatedSize.Value, initialRegistration.EstimatedSize.Value + 1, Int32.MaxValue);
39
}
40
40
- [Fact]
41
+ [RuntimeFact]
42
public void AutomaticallyUncachesBundleWhenNotInstalled()
43
{
44
this.CreatePackageInstaller("PackageA");
@@ -53,19 +54,19 @@ namespace WixToolsetTest.BurnE2E
54
bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
55
}
56
56
- [Fact]
57
+ [RuntimeFact]
58
public void AutomaticallyUninstallsBundleWithoutBADoingApply()
59
{
60
this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(true);
61
}
62
62
- [Fact]
63
+ [RuntimeFact]
64
public void AutomaticallyUninstallsBundleWithoutBADoingDetect()
65
{
66
this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(false);
67
}
68
68
- [Fact]
69
+ [RuntimeFact]
70
public void RegistersInARPIfPrecached()
71
{
72
this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/RollbackBoundaryTests.cs
+2
-1
@@ -4,6 +4,7 @@ namespace WixToolsetTest.BurnE2E
4
{
5
using System;
6
using System.IO;
7
+ using WixTestTools;
8
using Xunit;
9
using Xunit.Abstractions;
10
@@ -22,7 +23,7 @@ namespace WixToolsetTest.BurnE2E
23
/// install package B
24
/// unregister since no non-permanent packages should be installed or cached.
25
/// </summary>
25
- [Fact]
26
+ [RuntimeFact]
27
public void NonVitalRollbackBoundarySkipsToNextRollbackBoundary()
28
{
29
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs
+12
-12
@@ -17,7 +17,7 @@ namespace WixToolsetTest.BurnE2E
17
private const string V100 = "1.0.0.0";
18
private const string V101 = "1.0.1.0";
19
20
- [Fact]
20
+ [RuntimeFact]
21
public void CanInstallBundleWithSlipstreamedPatchThenRemoveIt()
22
{
23
var testRegistryValue = "PackageA";
@@ -45,7 +45,7 @@ namespace WixToolsetTest.BurnE2E
45
/// BundleOnlyPatchA in uninstalled which should do nothing since BundleA has a dependency on it.
46
/// Bundle is installed which should remove everything.
47
/// </summary>
48
- [Fact]
48
+ [RuntimeFact]
49
public void ReferenceCountsSlipstreamedPatch()
50
{
51
var testRegistryValue = "PackageA";
@@ -78,13 +78,13 @@ namespace WixToolsetTest.BurnE2E
78
packageAv1.VerifyTestRegistryRootDeleted();
79
}
80
81
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6350")]
81
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6350")]
82
public void CanInstallBundleWithSlipstreamedPatchThenRepairIt()
83
{
84
this.InstallBundleWithSlipstreamedPatchThenRepairIt(false);
85
}
86
87
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6350")]
87
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6350")]
88
public void CanInstallReversedBundleWithSlipstreamedPatchThenRepairIt()
89
{
90
this.InstallBundleWithSlipstreamedPatchThenRepairIt(true);
@@ -121,13 +121,13 @@ namespace WixToolsetTest.BurnE2E
121
packageAv1.VerifyTestRegistryRootDeleted();
122
}
123
124
- [Fact]
124
+ [RuntimeFact]
125
public void CanInstallSlipstreamedPatchThroughForcedRepair()
126
{
127
this.InstallSlipstreamedPatchThroughForcedRepair(false);
128
}
129
130
- [Fact]
130
+ [RuntimeFact]
131
public void CanInstallSlipstreamedPatchThroughReversedForcedRepair()
132
{
133
this.InstallSlipstreamedPatchThroughForcedRepair(true);
@@ -177,7 +177,7 @@ namespace WixToolsetTest.BurnE2E
177
packageAv1.VerifyTestRegistryRootDeleted();
178
}
179
180
- [Fact]
180
+ [RuntimeFact]
181
public void CanUninstallSlipstreamedPatchAlone()
182
{
183
var testRegistryValue = "PackageA";
@@ -207,7 +207,7 @@ namespace WixToolsetTest.BurnE2E
207
packageAv1.VerifyTestRegistryRootDeleted();
208
}
209
210
- [Fact]
210
+ [RuntimeFact]
211
public void CanModifyToUninstallPackageWithSlipstreamedPatch()
212
{
213
var testRegistryValue = "PackageA";
@@ -244,7 +244,7 @@ namespace WixToolsetTest.BurnE2E
244
packageBv1.VerifyTestRegistryRootDeleted();
245
}
246
247
- [Fact]
247
+ [RuntimeFact]
248
public void UninstallsPackageWithSlipstreamedPatchDuringRollback()
249
{
250
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -266,7 +266,7 @@ namespace WixToolsetTest.BurnE2E
266
packageBv1.VerifyTestRegistryRootDeleted();
267
}
268
269
- [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6402")]
269
+ [RuntimeFact(Skip = "https://github.com/wixtoolset/issues/issues/6402")]
270
public void CanAutomaticallyPredetermineSlipstreamPatchesAtBuildTime()
271
{
272
var testRegistryValueA = "PackageA";
@@ -300,7 +300,7 @@ namespace WixToolsetTest.BurnE2E
300
packageAv1.VerifyTestRegistryRootDeleted();
301
}
302
303
- [Fact]
303
+ [RuntimeFact]
304
public void CanInstallSlipstreamedPatchWithPackageDuringMajorUpgrade()
305
{
306
var testRegistryValue = "PackageA";
@@ -327,7 +327,7 @@ namespace WixToolsetTest.BurnE2E
327
packageAv1.VerifyTestRegistryRootDeleted();
328
}
329
330
- [Fact]
330
+ [RuntimeFact]
331
public void RespectsSlipstreamedPatchInstallCondition()
332
{
333
var testRegistryValue = "PackageA";
src/test/burn/WixToolsetTest.BurnE2E/UpdateBundleTests.cs
+8
-7
@@ -6,6 +6,7 @@ namespace WixToolsetTest.BurnE2E
6
using System.Collections.Generic;
7
using System.Diagnostics;
8
using System.IO;
9
+ using WixTestTools;
10
using Xunit;
11
using Xunit.Abstractions;
12
@@ -13,7 +14,7 @@ namespace WixToolsetTest.BurnE2E
14
{
15
public UpdateBundleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
16
16
- [Fact]
17
+ [RuntimeFact]
18
public void CanLaunchUpdateBundleFromLocalSourceInsteadOfInstall()
19
{
20
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -39,7 +40,7 @@ namespace WixToolsetTest.BurnE2E
40
packageAv2.VerifyInstalled(false);
41
}
42
42
- [Fact]
43
+ [RuntimeFact]
44
public void CanLaunchUpdateBundleFromLocalSourceInsteadOfModify()
45
{
46
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -71,7 +72,7 @@ namespace WixToolsetTest.BurnE2E
72
packageAv2.VerifyInstalled(false);
73
}
74
74
- [Fact]
75
+ [RuntimeFact]
76
public void ForwardsArgumentsToUpdateBundle()
77
{
78
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -107,7 +108,7 @@ namespace WixToolsetTest.BurnE2E
108
}
109
110
// Installs bundle Bv1.0 then tries to update to latest version during modify (but no server exists).
110
- [Fact]
111
+ [RuntimeFact]
112
public void CanCheckUpdateServerDuringModifyAndDoNothingWhenServerIsntResponsive()
113
{
114
var packageB = this.CreatePackageInstaller("PackageBv1");
@@ -133,7 +134,7 @@ namespace WixToolsetTest.BurnE2E
134
}
135
136
// Installs bundle Bv1.0 then tries to update to latest version during modify (server exists, no feed).
136
- [Fact]
137
+ [RuntimeFact]
138
public void CanCheckUpdateServerDuringModifyAndDoNothingWhenFeedIsMissing()
139
{
140
var packageB = this.CreatePackageInstaller("PackageBv1");
@@ -162,7 +163,7 @@ namespace WixToolsetTest.BurnE2E
163
}
164
165
// Installs bundle Bv1.0 then tries to update to latest version during modify (server exists, v1.0 feed).
165
- [Fact]
166
+ [RuntimeFact]
167
public void CanCheckUpdateServerDuringModifyAndDoNothingWhenAlreadyLatestVersion()
168
{
169
var packageB = this.CreatePackageInstaller("PackageBv1");
@@ -195,7 +196,7 @@ namespace WixToolsetTest.BurnE2E
196
}
197
198
// Installs bundle Bv1.0 then does an update to bundle Bv2.0 during modify (server exists, v2.0 feed).
198
- [Fact]
199
+ [RuntimeFact]
200
public void CanLaunchUpdateBundleFromDownloadInsteadOfModify()
201
{
202
var packageBv1 = this.CreatePackageInstaller("PackageBv1");
src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs
+4
-4
@@ -12,7 +12,7 @@ namespace WixToolsetTest.BurnE2E
12
{
13
public UpgradeRelatedBundleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
14
15
- [Fact]
15
+ [RuntimeFact]
16
public void ReinstallsOlderBundleAfterFailure()
17
{
18
var packageAv2 = this.CreatePackageInstaller("PackageAv2");
@@ -39,7 +39,7 @@ namespace WixToolsetTest.BurnE2E
39
packageAv3.VerifyInstalled(false);
40
}
41
42
- [Fact]
42
+ [RuntimeFact]
43
public void ReportsRelatedBundleMissingFromCache()
44
{
45
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -60,7 +60,7 @@ namespace WixToolsetTest.BurnE2E
60
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerMachine, version: 1\.0\.0\.0, cached: No"));
61
}
62
63
- [Fact]
63
+ [RuntimeFact]
64
public void Bundle64UpgradesBundle32()
65
{
66
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
@@ -79,7 +79,7 @@ namespace WixToolsetTest.BurnE2E
79
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2x64InstallLogFilePath, @"Detected related package: \{[0-9A-Za-z\-]{36}\}, scope: PerMachine, version: 1.0.0.0, language: 1033 operation: MajorUpgrade"));
80
}
81
82
- [Fact]
82
+ [RuntimeFact]
83
public void Bundle32UpgradesBundle64()
84
{
85
var packageAv1 = this.CreatePackageInstaller("PackageAv1");
src/test/burn/WixToolsetTest.BurnE2E/VariableTests.cs
+2
-2
@@ -14,7 +14,7 @@ namespace WixToolsetTest.BurnE2E
14
{
15
public VariableTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
16
17
- [Fact]
17
+ [RuntimeFact]
18
public void CanHideHiddenVariables()
19
{
20
var packageA = this.CreatePackageInstaller("PackageA");
@@ -32,7 +32,7 @@ namespace WixToolsetTest.BurnE2E
32
Assert.False(LogVerifier.MessageInLogFile(logFilePath, "supersecretkey"));
33
}
34
35
- [Fact]
35
+ [RuntimeFact]
36
public void CanSupportCaseSensitiveVariables()
37
{
38
var packageA = this.CreatePackageInstaller("PackageA");
src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
+2
-3
@@ -3,14 +3,13 @@
3
namespace WixToolsetTest.BurnE2E
4
{
5
using WixTestTools;
6
- using Xunit;
6
using Xunit.Abstractions;
7
8
public class WixStdBaTests : BurnE2ETests
9
{
10
public WixStdBaTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
11
13
- [Fact]
12
+ [RuntimeFact]
13
public void ExitsWithErrorWhenDowngradingWithoutSuppression()
14
{
15
var packageA = this.CreatePackageInstaller("PackageA");
@@ -31,7 +30,7 @@ namespace WixToolsetTest.BurnE2E
30
packageA.VerifyInstalled(true);
31
}
32
34
- [Fact]
33
+ [RuntimeFact]
34
public void ExitsWithoutErrorWhenDowngradingWithSuppression()
35
{
36
var packageA = this.CreatePackageInstaller("PackageA");
src/test/msi/WixToolsetTest.MsiE2E/MsiE2EFixture.cs
deleted
-28
@@ -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.MsiE2E
4
-{
5
- using System;
6
- using System.Security.Principal;
7
-
8
- public class MsiE2EFixture
9
- {
10
- const string RequiredEnvironmentVariableName = "RuntimeTestsEnabled";
11
-
12
- public MsiE2EFixture()
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
-}
src/test/msi/WixToolsetTest.MsiE2E/MsiE2ETests.cs
+1
-1
@@ -38,7 +38,7 @@ namespace WixToolsetTest.MsiE2E
38
}
39
40
[CollectionDefinition("MsiE2E", DisableParallelization = true)]
41
- public class MsiE2ECollectionDefinition : ICollectionFixture<MsiE2EFixture>
41
+ public class MsiE2ECollectionDefinition
42
{
43
}
44
}
src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionUserTests.cs
+6
-6
@@ -15,7 +15,7 @@ namespace WixToolsetTest.MsiE2E
15
const string TempUsername = "USERNAME";
16
17
// Verify that the users specified in the authoring are created as expected.
18
- [Fact]
18
+ [RuntimeFact]
19
public void CanInstallAndUninstallUsers()
20
{
21
var arguments = new string[]
@@ -49,7 +49,7 @@ namespace WixToolsetTest.MsiE2E
49
}
50
51
// Verify the rollback action reverts all Users changes.
52
- [Fact]
52
+ [RuntimeFact]
53
public void CanRollbackUsers()
54
{
55
var arguments = new string[]
@@ -74,7 +74,7 @@ namespace WixToolsetTest.MsiE2E
74
}
75
76
// Verify that the users specified in the authoring are created as expected on repair.
77
- [Fact(Skip = "Test demonstrates failure")]
77
+ [RuntimeFact(Skip = "Test demonstrates failure")]
78
public void CanRepairUsers()
79
{
80
var arguments = new string[]
@@ -113,7 +113,7 @@ namespace WixToolsetTest.MsiE2E
113
}
114
115
// Verify that Installation fails if FailIfExisits is set.
116
- [Fact]
116
+ [RuntimeFact]
117
public void FailsIfUserExists()
118
{
119
var productFailIfExists = this.CreatePackageInstaller("ProductFailIfExists");
@@ -139,7 +139,7 @@ namespace WixToolsetTest.MsiE2E
139
}
140
141
// Verify that a user cannot be created on a domain on which you dont have create user permission.
142
- [Fact]
142
+ [RuntimeFact]
143
public void FailsIfRestrictedDomain()
144
{
145
var productRestrictedDomain = this.CreatePackageInstaller("ProductRestrictedDomain");
@@ -151,7 +151,7 @@ namespace WixToolsetTest.MsiE2E
151
}
152
153
// Verify that adding a user to a non-existent group does not fail the install when non-vital.
154
- [Fact]
154
+ [RuntimeFact]
155
public void IgnoresMissingGroupWhenNonVital()
156
{
157
var productNonVitalGroup = this.CreatePackageInstaller("ProductNonVitalUserGroup");