From 59ffa86b7d62ddc52ec813fb65c47f812aeded66 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 6 Apr 2020 14:06:29 +1000 Subject: Try to fix build flakiness with Example.Extension. Add failing test for the TableDefinition overload of EnsureTable. --- .../WixToolsetTest.CoreIntegration/MsiFixture.cs | 36 ++++++++++++++++++++++ .../TestData/BadEnsureTable/BadEnsureTable.wxs | 11 +++++++ .../WixToolsetTest.CoreIntegration.csproj | 1 + 3 files changed, 48 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs (limited to 'src/test/WixToolsetTest.CoreIntegration') diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index 2141e68c..ad24f346 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs @@ -2,8 +2,10 @@ namespace WixToolsetTest.CoreIntegration { + using System; using System.IO; using System.Linq; + using Example.Extension; using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; @@ -882,5 +884,39 @@ namespace WixToolsetTest.CoreIntegration Assert.NotEmpty(output.SubStorages); } } + + [Fact(Skip = "Test demonstrates failure")] + public void FailsBuildAtLinkTimeForMissingEnsureTable() + { + var folder = TestData.Get(@"TestData"); + var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "BadEnsureTable", "BadEnsureTable.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), + Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), + "-ext", extensionPath, + "-bindpath", Path.Combine(folder, "SingleFile", "data"), + "-intermediateFolder", intermediateFolder, + "-o", msiPath + }); + Assert.Collection(result.Messages, + first => + { + Assert.Equal(MessageLevel.Error, first.Level); + Assert.Equal("The identifier 'WixCustomTable:TableDefinitionNotExposedByExtension' could not be found. Ensure you have typed the reference correctly and that all the necessary inputs are provided to the linker.", first.ToString()); + }); + + Assert.False(File.Exists(msiPath)); + } + } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs new file mode 100644 index 00000000..3caa20ff --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BadEnsureTable/BadEnsureTable.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 98402223..dbc9357c 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj @@ -21,6 +21,7 @@ + -- cgit v1.2.3-55-g6feb