aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-12-02 22:17:50 -0800
committerRob Mensching <rob@firegiant.com>2021-12-03 07:48:37 -0800
commit70db45771d19126cdc85bcdc08cbcf36e002e2b5 (patch)
tree445f89f05efded0709fc391c1824f99394e12fcf
parentfd5138896d596a6f3226a5c9438e456d4c8c2068 (diff)
downloadwix-70db45771d19126cdc85bcdc08cbcf36e002e2b5.tar.gz
wix-70db45771d19126cdc85bcdc08cbcf36e002e2b5.tar.bz2
wix-70db45771d19126cdc85bcdc08cbcf36e002e2b5.zip
If there isn't enough disk space, skip the 5GB test
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
index e8d37aef..953aed2e 100644
--- a/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
+++ b/src/test/burn/WixToolsetTest.BurnE2E/CacheTests.cs
@@ -2,6 +2,7 @@
2 2
3namespace WixToolsetTest.BurnE2E 3namespace WixToolsetTest.BurnE2E
4{ 4{
5 using System;
5 using System.Collections.Generic; 6 using System.Collections.Generic;
6 using System.IO; 7 using System.IO;
7 using WixBuildTools.TestSupport; 8 using WixBuildTools.TestSupport;
@@ -17,23 +18,35 @@ namespace WixToolsetTest.BurnE2E
17 [Fact] 18 [Fact]
18 public void CanCache5GBFile() 19 public void CanCache5GBFile()
19 { 20 {
20 var packageA = this.CreatePackageInstaller("PackageA");
21 var bundleC = this.CreateBundleInstaller("BundleC");
22
23 packageA.VerifyInstalled(false);
24
25 // Recreate the 5GB payload to avoid having to copy it to the VM to run the tests. 21 // Recreate the 5GB payload to avoid having to copy it to the VM to run the tests.
22 const long FiveGB = 5_368_709_120;
23 const long OneGB = 1_073_741_824;
26 var targetFilePath = Path.Combine(this.TestContext.TestDataFolder, "fivegb.file"); 24 var targetFilePath = Path.Combine(this.TestContext.TestDataFolder, "fivegb.file");
25
26 // If the drive has less than 5GB (for the test file) plus 1GB (for working space), then
27 // skip the test.
28 var drive = new DriveInfo(targetFilePath.Substring(0, 1));
29 if (drive.AvailableFreeSpace < FiveGB + OneGB)
30 {
31 Console.WriteLine("Skipping CanCache5GBFile() test because there is not enough disk space available to run the test.");
32 return;
33 }
34
27 if (!File.Exists(targetFilePath)) 35 if (!File.Exists(targetFilePath))
28 { 36 {
29 var testTool = new TestTool(Path.Combine(TestData.Get(), "win-x86", "TestExe.exe")) 37 var testTool = new TestTool(Path.Combine(TestData.Get(), "win-x86", "TestExe.exe"))
30 { 38 {
31 Arguments = "/lf \"" + targetFilePath + "|5368709120\"", 39 Arguments = "/lf \"" + targetFilePath + $"|{FiveGB}\"",
32 ExpectedExitCode = 0, 40 ExpectedExitCode = 0,
33 }; 41 };
34 testTool.Run(true); 42 testTool.Run(true);
35 } 43 }
36 44
45 var packageA = this.CreatePackageInstaller("PackageA");
46 var bundleC = this.CreateBundleInstaller("BundleC");
47
48 packageA.VerifyInstalled(false);
49
37 bundleC.Install(); 50 bundleC.Install();
38 bundleC.VerifyRegisteredAndInPackageCache(); 51 bundleC.VerifyRegisteredAndInPackageCache();
39 52