Add failing tests.
Sean Hall committed
Jan 2, 2021 at 23:20 UTC
d5e31dec3a753f98955f3cde3d49a653cfc4aed0
11 files changed
+273
-6
src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+4
-4
@@ -216,7 +216,7 @@ namespace WixToolsetTest.CoreIntegration
216
}
217
}
218
219
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/4628
219
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/4628")]
220
public void CantBuildWithDuplicateCacheIds()
221
{
222
var folder = TestData.Get(@"TestData");
@@ -242,7 +242,7 @@ namespace WixToolsetTest.CoreIntegration
242
}
243
}
244
245
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/4574
245
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/4574")]
246
public void CantBuildWithDuplicatePayloadNames()
247
{
248
var folder = TestData.Get(@"TestData");
@@ -268,7 +268,7 @@ namespace WixToolsetTest.CoreIntegration
268
}
269
}
270
271
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/6291
271
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6291")]
272
public void CantBuildWithUnscheduledPackage()
273
{
274
var folder = TestData.Get(@"TestData");
@@ -294,7 +294,7 @@ namespace WixToolsetTest.CoreIntegration
294
}
295
}
296
297
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/6291
297
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6291")]
298
public void CantBuildWithUnscheduledRollbackBoundary()
299
{
300
var folder = TestData.Get(@"TestData");
src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs
new
+140
@@ -0,0 +1,140 @@
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.CoreIntegration
4
+{
5
+ using System;
6
+ using System.Collections.Generic;
7
+ using System.IO;
8
+ using System.Linq;
9
+ using WixBuildTools.TestSupport;
10
+ using WixToolset.Core.TestPackage;
11
+ using WixToolset.Data;
12
+ using WixToolset.Data.Symbols;
13
+ using Xunit;
14
+
15
+ public class ContainerFixture
16
+ {
17
+ [Fact]
18
+ public void HarvestedPayloadsArePutInCorrectContainer()
19
+ {
20
+ var folder = TestData.Get(@"TestData");
21
+
22
+ using (var fs = new DisposableFileSystem())
23
+ {
24
+ var baseFolder = fs.GetFolder();
25
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
26
+ var binFolder = Path.Combine(baseFolder, "bin");
27
+ var bundlePath = Path.Combine(binFolder, "test.exe");
28
+ var baFolderPath = Path.Combine(baseFolder, "ba");
29
+ var extractFolderPath = Path.Combine(baseFolder, "extract");
30
+
31
+ var result = WixRunner.Execute(new[]
32
+ {
33
+ "build",
34
+ Path.Combine(folder, "MsiTransaction", "FirstX86.wxs"),
35
+ Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
36
+ Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
37
+ "-bindpath", Path.Combine(folder, "SingleFile", "data"),
38
+ "-intermediateFolder", intermediateFolder,
39
+ "-o", Path.Combine(binFolder, "FirstX86.msi"),
40
+ });
41
+
42
+ result.AssertSuccess();
43
+
44
+ result = WixRunner.Execute(new[]
45
+ {
46
+ "build",
47
+ Path.Combine(folder, "MsiTransaction", "FirstX64.wxs"),
48
+ Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
49
+ Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
50
+ "-bindpath", Path.Combine(folder, "SingleFile", "data"),
51
+ "-intermediateFolder", intermediateFolder,
52
+ "-o", Path.Combine(binFolder, "FirstX64.msi"),
53
+ });
54
+
55
+ result.AssertSuccess();
56
+
57
+ result = WixRunner.Execute(new[]
58
+ {
59
+ "build",
60
+ Path.Combine(folder, "Container", "HarvestIntoDetachedContainer.wxs"),
61
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
62
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
63
+ "-bindpath", binFolder,
64
+ "-intermediateFolder", intermediateFolder,
65
+ "-o", bundlePath
66
+ });
67
+
68
+ result.AssertSuccess();
69
+
70
+ Assert.True(File.Exists(bundlePath));
71
+
72
+ var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
73
+ extractResult.AssertSuccess();
74
+
75
+ var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload");
76
+ Assert.Equal(4, payloads.Count);
77
+ var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } };
78
+ Assert.Equal(@"<Payload Id='FirstX86.msi' FilePath='FirstX86.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='WixAttachedContainer' />", payloads[0].GetTestXml(ignoreAttributes));
79
+ Assert.Equal(@"<Payload Id='FirstX64.msi' FilePath='FirstX64.msi' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a1' Container='FirstX64' />", payloads[1].GetTestXml(ignoreAttributes));
80
+ Assert.Equal(@"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a2' Container='WixAttachedContainer' />", payloads[2].GetTestXml(ignoreAttributes));
81
+ Assert.Equal(@"<Payload Id='fC0n41rZK8oW3JK8LzHu6AT3CjdQ' FilePath='PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a3' Container='FirstX64' />", payloads[3].GetTestXml(ignoreAttributes));
82
+ }
83
+ }
84
+
85
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6144")]
86
+ public void MultipleAttachedContainersAreNotCurrentlySupported()
87
+ {
88
+ var folder = TestData.Get(@"TestData");
89
+
90
+ using (var fs = new DisposableFileSystem())
91
+ {
92
+ var baseFolder = fs.GetFolder();
93
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
94
+ var binFolder = Path.Combine(baseFolder, "bin");
95
+ var bundlePath = Path.Combine(binFolder, "test.exe");
96
+ var baFolderPath = Path.Combine(baseFolder, "ba");
97
+ var extractFolderPath = Path.Combine(baseFolder, "extract");
98
+
99
+ var result = WixRunner.Execute(new[]
100
+ {
101
+ "build",
102
+ Path.Combine(folder, "MsiTransaction", "FirstX86.wxs"),
103
+ Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
104
+ Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
105
+ "-bindpath", Path.Combine(folder, "SingleFile", "data"),
106
+ "-intermediateFolder", intermediateFolder,
107
+ "-o", Path.Combine(binFolder, "FirstX86.msi"),
108
+ });
109
+
110
+ result.AssertSuccess();
111
+
112
+ result = WixRunner.Execute(new[]
113
+ {
114
+ "build",
115
+ Path.Combine(folder, "MsiTransaction", "FirstX64.wxs"),
116
+ Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"),
117
+ Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
118
+ "-bindpath", Path.Combine(folder, "SingleFile", "data"),
119
+ "-intermediateFolder", intermediateFolder,
120
+ "-o", Path.Combine(binFolder, "FirstX64.msi"),
121
+ });
122
+
123
+ result.AssertSuccess();
124
+
125
+ result = WixRunner.Execute(new[]
126
+ {
127
+ "build",
128
+ Path.Combine(folder, "Container", "MultipleAttachedContainers.wxs"),
129
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
130
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
131
+ "-bindpath", binFolder,
132
+ "-intermediateFolder", intermediateFolder,
133
+ "-o", bundlePath
134
+ });
135
+
136
+ Assert.InRange(result.ExitCode, 2, Int32.MaxValue);
137
+ }
138
+ }
139
+ }
140
+}
src/test/WixToolsetTest.CoreIntegration/CustomActionFixture.cs
+1
-1
@@ -11,7 +11,7 @@ namespace WixToolsetTest.CoreIntegration
11
12
public class CustomActionFixture
13
{
14
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/6201
14
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6201")]
15
public void CanDetectCustomActionCycle()
16
{
17
var folder = TestData.Get(@"TestData");
src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs
+27
@@ -3,6 +3,7 @@
3
namespace WixToolsetTest.CoreIntegration
4
{
5
using System;
6
+ using System.Collections.Generic;
7
using System.IO;
8
using System.Linq;
9
using WixBuildTools.TestSupport;
@@ -114,5 +115,31 @@ namespace WixToolsetTest.CoreIntegration
115
Assert.Equal(expectedPayloadMustBeRelativeToCache, result.Messages.Where(m => m.Id == (int)ErrorMessages.Ids.PayloadMustBeRelativeToCache).Count());
116
}
117
}
118
+
119
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/5273")]
120
+ public void RejectsPayloadSharedBetweenPackageAndBA()
121
+ {
122
+ var folder = TestData.Get(@"TestData");
123
+
124
+ using (var fs = new DisposableFileSystem())
125
+ {
126
+ var baseFolder = fs.GetFolder();
127
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
128
+ var bundlePath = Path.Combine(baseFolder, @"bin\test.exe");
129
+
130
+ var result = WixRunner.Execute(new[]
131
+ {
132
+ "build",
133
+ Path.Combine(folder, "Payload", "SharedBAAndPackagePayloadBundle.wxs"),
134
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
135
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
136
+ "-bindpath", Path.Combine(folder, ".Data"),
137
+ "-intermediateFolder", intermediateFolder,
138
+ "-o", bundlePath,
139
+ });
140
+
141
+ Assert.InRange(result.ExitCode, 2, int.MaxValue);
142
+ }
143
+ }
144
}
145
}
src/test/WixToolsetTest.CoreIntegration/RegistryFixture.cs
+1
-1
@@ -111,7 +111,7 @@ namespace WixToolsetTest.CoreIntegration
111
}
112
}
113
114
- [Fact(Skip = "Test demonstrates failure")] //https://github.com/wixtoolset/issues/issues/4753
114
+ [Fact(Skip = "https://github.com/wixtoolset/issues/issues/4753")]
115
public void PopulatesRegistryTableWithoutExtraBackslash()
116
{
117
var folder = TestData.Get(@"TestData");
src/test/WixToolsetTest.CoreIntegration/RollbackBoundaryFixture.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 WixToolsetTest.CoreIntegration
4
+{
5
+ using System.IO;
6
+ using WixBuildTools.TestSupport;
7
+ using WixToolset.Core.TestPackage;
8
+ using Xunit;
9
+
10
+ public class RollbackBoundaryFixture
11
+ {
12
+ [Fact(Skip = "Test demonstrates failure")]
13
+ public void CanStartChainWithRollbackBoundary()
14
+ {
15
+ var folder = TestData.Get(@"TestData");
16
+
17
+ using (var fs = new DisposableFileSystem())
18
+ {
19
+ var baseFolder = fs.GetFolder();
20
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
21
+ var exePath = Path.Combine(baseFolder, @"bin\test.exe");
22
+
23
+ var result = WixRunner.Execute(new[]
24
+ {
25
+ "build",
26
+ Path.Combine(folder, "RollbackBoundary", "BeginningOfChain.wxs"),
27
+ Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
28
+ Path.Combine(folder, "BundleWithPackageGroupRef", "MinimalPackageGroup.wxs"),
29
+ "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
30
+ "-intermediateFolder", intermediateFolder,
31
+ "-o", exePath,
32
+ });
33
+
34
+ result.AssertSuccess();
35
+
36
+ Assert.True(File.Exists(exePath));
37
+ }
38
+ }
39
+
40
+ }
41
+}
src/test/WixToolsetTest.CoreIntegration/TestData/Container/HarvestIntoDetachedContainer.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <MsiPackage SourceFile="FirstX86.msi" />
6
+ <PackageGroupRef Id="FirstX64" />
7
+ </PackageGroup>
8
+ <PackageGroup Id="FirstX64">
9
+ <MsiPackage SourceFile="FirstX64.msi" />
10
+ </PackageGroup>
11
+ <Container Id="FirstX64" Name="FirstX64" Type="detached">
12
+ <PackageGroupRef Id="FirstX64" />
13
+ </Container>
14
+ </Fragment>
15
+</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/Container/MultipleAttachedContainers.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <MsiPackage SourceFile="FirstX86.msi" />
6
+ <PackageGroupRef Id="FirstX64" />
7
+ </PackageGroup>
8
+ <PackageGroup Id="FirstX64">
9
+ <MsiPackage SourceFile="FirstX64.msi" />
10
+ </PackageGroup>
11
+ <Container Id="FirstX64" Name="FirstX64" Type="attached">
12
+ <PackageGroupRef Id="FirstX64" />
13
+ </Container>
14
+ </Fragment>
15
+</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/Payload/SharedBAAndPackagePayloadBundle.wxs
new
+16
@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <ExePackage SourceFile="burn.exe">
6
+ <PayloadGroupRef Id="Shared" />
7
+ </ExePackage>
8
+ </PackageGroup>
9
+ <BootstrapperApplication>
10
+ <PayloadGroupRef Id="Shared" />
11
+ </BootstrapperApplication>
12
+ <PayloadGroup Id="Shared">
13
+ <Payload SourceFile="$(sys.SOURCEFILEPATH)" />
14
+ </PayloadGroup>
15
+ </Fragment>
16
+</Wix>
src/test/WixToolsetTest.CoreIntegration/TestData/RollbackBoundary/BeginningOfChain.wxs
new
+9
@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Fragment>
4
+ <PackageGroup Id="BundlePackages">
5
+ <RollbackBoundary Id="nonvital" Vital="no" />
6
+ <PackageGroupRef Id="MinimalPackageGroup" />
7
+ </PackageGroup>
8
+ </Fragment>
9
+</Wix>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+4
@@ -38,6 +38,8 @@
38
<Content Include="TestData\Class\DecompiledOldClassTableDef.wxs" CopyToOutputDirectory="PreserveNewest" />
39
<Content Include="TestData\Class\IconIndex0.wxs" CopyToOutputDirectory="PreserveNewest" />
40
<Content Include="TestData\Class\OldClassTableDef.msi" CopyToOutputDirectory="PreserveNewest" />
41
+ <Content Include="TestData\Container\HarvestIntoDetachedContainer.wxs" CopyToOutputDirectory="PreserveNewest" />
42
+ <Content Include="TestData\Container\MultipleAttachedContainers.wxs" CopyToOutputDirectory="PreserveNewest" />
43
<Content Include="TestData\CopyFile\CopyFile.wxs" CopyToOutputDirectory="PreserveNewest" />
44
<Content Include="TestData\CustomAction\SimpleCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" />
45
<Content Include="TestData\CustomAction\CustomActionCycle.wxs" CopyToOutputDirectory="PreserveNewest" />
@@ -72,6 +74,7 @@
74
<Content Include="TestData\MsiTransaction\X86AfterX64Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
75
<Content Include="TestData\Payload\AbsoluteName.wxs" CopyToOutputDirectory="PreserveNewest" />
76
<Content Include="TestData\Payload\CanonicalizeName.wxs" CopyToOutputDirectory="PreserveNewest" />
77
+ <Content Include="TestData\Payload\SharedBAAndPackagePayloadBundle.wxs" CopyToOutputDirectory="PreserveNewest" />
78
<Content Include="TestData\Payload\ValidName.wxs" CopyToOutputDirectory="PreserveNewest" />
79
<Content Include="TestData\PatchFamilyFilter\.data\Av1.0.0.txt" CopyToOutputDirectory="PreserveNewest" />
80
<Content Include="TestData\PatchFamilyFilter\.data\Av1.0.1.txt" CopyToOutputDirectory="PreserveNewest" />
@@ -187,6 +190,7 @@
190
<Content Include="TestData\OverridableActions\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
191
<Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" />
192
<Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" />
193
+ <Content Include="TestData\RollbackBoundary\BeginningOfChain.wxs" CopyToOutputDirectory="PreserveNewest" />
194
<Content Include="TestData\TextStyle\ColorNull.wxs" CopyToOutputDirectory="PreserveNewest" />
195
<Content Include="TestData\TextStyle\SizeLocalized.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
196
<Content Include="TestData\TextStyle\SizeLocalized.wxs" CopyToOutputDirectory="PreserveNewest" />