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/CacheTests.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/CacheTests.cs')
-rw-r--r-- | src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs index 4d5fb811..6c8250d9 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs | |||
@@ -15,7 +15,7 @@ namespace WixToolsetTest.BurnE2E | |||
15 | { | 15 | { |
16 | public CacheTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | 16 | public CacheTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } |
17 | 17 | ||
18 | private bool Is5GBFileAvailable() | 18 | private void SkipIf5GBFileUnavailable() |
19 | { | 19 | { |
20 | // Recreate the 5GB payload to avoid having to copy it to the VM to run the tests. | 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; | 21 | const long FiveGB = 5_368_709_120; |
@@ -27,8 +27,7 @@ namespace WixToolsetTest.BurnE2E | |||
27 | var drive = new DriveInfo(targetFilePath.Substring(0, 1)); | 27 | var drive = new DriveInfo(targetFilePath.Substring(0, 1)); |
28 | if (drive.AvailableFreeSpace < FiveGB + OneGB) | 28 | if (drive.AvailableFreeSpace < FiveGB + OneGB) |
29 | { | 29 | { |
30 | Console.WriteLine($"Skipping {this.TestContext.TestName} because there is not enough disk space available to run the test."); | 30 | WixAssert.Skip($"Skipping {this.TestContext.TestName} because there is not enough disk space available to run the test."); |
31 | return false; | ||
32 | } | 31 | } |
33 | 32 | ||
34 | if (!File.Exists(targetFilePath)) | 33 | if (!File.Exists(targetFilePath)) |
@@ -40,17 +39,12 @@ namespace WixToolsetTest.BurnE2E | |||
40 | }; | 39 | }; |
41 | testTool.Run(true); | 40 | testTool.Run(true); |
42 | } | 41 | } |
43 | |||
44 | return true; | ||
45 | } | 42 | } |
46 | 43 | ||
47 | [Fact] | 44 | [LongRuntimeFact] |
48 | public void CanCache5GBFile() | 45 | public void CanCache5GBFile() |
49 | { | 46 | { |
50 | if (!this.Is5GBFileAvailable()) | 47 | this.SkipIf5GBFileUnavailable(); |
51 | { | ||
52 | return; | ||
53 | } | ||
54 | 48 | ||
55 | var packageA = this.CreatePackageInstaller("PackageA"); | 49 | var packageA = this.CreatePackageInstaller("PackageA"); |
56 | var bundleC = this.CreateBundleInstaller("BundleC"); | 50 | var bundleC = this.CreateBundleInstaller("BundleC"); |
@@ -65,10 +59,7 @@ namespace WixToolsetTest.BurnE2E | |||
65 | 59 | ||
66 | private string Cache5GBFileFromDownload(bool disableRangeRequests) | 60 | private string Cache5GBFileFromDownload(bool disableRangeRequests) |
67 | { | 61 | { |
68 | if (!this.Is5GBFileAvailable()) | 62 | this.SkipIf5GBFileUnavailable(); |
69 | { | ||
70 | return null; | ||
71 | } | ||
72 | 63 | ||
73 | var packageA = this.CreatePackageInstaller("PackageA"); | 64 | var packageA = this.CreatePackageInstaller("PackageA"); |
74 | var bundleC = this.CreateBundleInstaller("BundleC"); | 65 | var bundleC = this.CreateBundleInstaller("BundleC"); |
@@ -100,33 +91,25 @@ namespace WixToolsetTest.BurnE2E | |||
100 | return installLogPath; | 91 | return installLogPath; |
101 | } | 92 | } |
102 | 93 | ||
103 | [Fact] | 94 | [LongRuntimeFact] |
104 | public void CanCache5GBFileFromDownloadWithRangeRequestSupport() | 95 | public void CanCache5GBFileFromDownloadWithRangeRequestSupport() |
105 | { | 96 | { |
106 | var logPath = this.Cache5GBFileFromDownload(false); | 97 | var logPath = this.Cache5GBFileFromDownload(false); |
107 | if (logPath == null) | ||
108 | { | ||
109 | return; | ||
110 | } | ||
111 | 98 | ||
112 | Assert.False(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); | 99 | Assert.False(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); |
113 | Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned 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")); |
114 | } | 101 | } |
115 | 102 | ||
116 | [Fact] | 103 | [LongRuntimeFact] |
117 | public void CanCache5GBFileFromDownloadWithoutRangeRequestSupport() | 104 | public void CanCache5GBFileFromDownloadWithoutRangeRequestSupport() |
118 | { | 105 | { |
119 | var logPath = this.Cache5GBFileFromDownload(true); | 106 | var logPath = this.Cache5GBFileFromDownload(true); |
120 | if (logPath == null) | ||
121 | { | ||
122 | return; | ||
123 | } | ||
124 | 107 | ||
125 | Assert.True(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); | 108 | Assert.True(LogVerifier.MessageInLogFile(logPath, "Range request not supported for URL: http://localhost:9999/e2e/BundleC/fivegb.file")); |
126 | Assert.False(LogVerifier.MessageInLogFile(logPath, "Content-Length not returned 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")); |
127 | } | 110 | } |
128 | 111 | ||
129 | [Fact] | 112 | [RuntimeFact] |
130 | public void CanDownloadPayloadsFromMissingAttachedContainer() | 113 | public void CanDownloadPayloadsFromMissingAttachedContainer() |
131 | { | 114 | { |
132 | var packageA = this.CreatePackageInstaller("PackageA"); | 115 | var packageA = this.CreatePackageInstaller("PackageA"); |
@@ -178,7 +161,7 @@ namespace WixToolsetTest.BurnE2E | |||
178 | Assert.True(LogVerifier.MessageInLogFile(modifyLogPath, "Ignoring failure to get size and time for URL: http://localhost:9999/e2e/BundleA/PackageB.msi (error 0x80070002)")); | 161 | Assert.True(LogVerifier.MessageInLogFile(modifyLogPath, "Ignoring failure to get size and time for URL: http://localhost:9999/e2e/BundleA/PackageB.msi (error 0x80070002)")); |
179 | } | 162 | } |
180 | 163 | ||
181 | [Fact] | 164 | [RuntimeFact] |
182 | public void CanFindAttachedContainerFromRenamedBundle() | 165 | public void CanFindAttachedContainerFromRenamedBundle() |
183 | { | 166 | { |
184 | var packageA = this.CreatePackageInstaller("PackageA"); | 167 | var packageA = this.CreatePackageInstaller("PackageA"); |