Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## New in v1.29
## New in v1.30

Nothing yet.

## Bug Fixes

* Updated NUnit to v4
* Fixed a crash (`0x8000ffff`) when using `--disable-interactivity` with the Resume experimental feature enabled during install operations.
18 changes: 9 additions & 9 deletions src/AppInstallerCLIE2ETests/AppShutdownTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void RegisterApplicationTest()

// The ctrl-c command terminates the batch file before the exit code file gets created.
// Look for the output.
Assert.True(testCmdTask.Result.StdOut.Contains("Succeeded waiting for app shutdown event"));
Assert.That(testCmdTask.Result.StdOut, Does.Contain("Succeeded waiting for app shutdown event"));
}

/// <summary>
Expand All @@ -111,13 +111,13 @@ public void CanUnloadNowTest()

var lines = result.StdOut.Split('\n', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);

Assert.AreEqual(5, lines.Length);
Assert.True(lines[0].Contains("Internal objects:"));
Assert.False(lines[0].Contains("Internal objects: 0"));
Assert.True(lines[1].Contains("External objects: 0"));
Assert.True(lines[2].Contains("DllCanUnloadNow"));
Assert.True(lines[3].Contains("Internal objects: 0"));
Assert.True(lines[4].Contains("External objects: 0"));
Assert.That(lines.Length, Is.EqualTo(5));
Assert.That(lines[0], Does.Contain("Internal objects:"));
Assert.That(lines[0], Does.Not.Contain("Internal objects: 0"));
Assert.That(lines[1], Does.Contain("External objects: 0"));
Assert.That(lines[2], Does.Contain("DllCanUnloadNow"));
Assert.That(lines[3], Does.Contain("Internal objects: 0"));
Assert.That(lines[4], Does.Contain("External objects: 0"));
}

/// <summary>
Expand All @@ -127,7 +127,7 @@ public void CanUnloadNowTest()
public void TermSignalHandler()
{
var result = TestCommon.RunAICLICommand("test", "term-signal-handler --verbose");
Assert.True(result.StdOut.Contains("Got a window handle"));
Assert.That(result.StdOut, Does.Contain("Got a window handle"));
}
}
}
131 changes: 66 additions & 65 deletions src/AppInstallerCLIE2ETests/ConfigureCommand.cs

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions src/AppInstallerCLIE2ETests/ConfigureExportCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ public void ExportTestPackage()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--package-id AppInstallerTest.TestPackageExport -o {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
Assert.True(File.Exists(exportFile));
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(exportFile, Does.Exist);

// Check exported file is readable and validate content
var showResult = TestCommon.RunAICLICommand(ShowCommand, $"-f {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, showResult.ExitCode);
Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Source"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.True(showResult.StdOut.Contains($"type: {Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains($"argument: {Constants.TestSourceUrl}"));
Assert.True(showResult.StdOut.Contains($"name: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Package"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains("id: AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains($"source: {Constants.TestSourceName}"));
Assert.That(showResult.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Source"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.That(showResult.StdOut, Does.Contain($"type: {Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain($"argument: {Constants.TestSourceUrl}"));
Assert.That(showResult.StdOut, Does.Contain($"name: {Constants.TestSourceName}"));

Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Package"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain("id: AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain($"source: {Constants.TestSourceName}"));
}

/// <summary>
Expand All @@ -88,27 +88,27 @@ public void ExportTestPackageWithPackageSettings()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--package-id AppInstallerTest.TestPackageExport --module AppInstallerTest --resource TestResource -o {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
Assert.True(File.Exists(exportFile));
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(exportFile, Does.Exist);

// Check exported file is readable and validate content
var showResult = TestCommon.RunAICLICommand(ShowCommand, $"-f {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, showResult.ExitCode);
Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Source"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.True(showResult.StdOut.Contains($"type: {Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains($"argument: {Constants.TestSourceUrl}"));
Assert.True(showResult.StdOut.Contains($"name: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Package"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains("id: AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains($"source: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("AppInstallerTest/TestResource"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains("data: TestData"));
Assert.That(showResult.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Source"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.That(showResult.StdOut, Does.Contain($"type: {Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain($"argument: {Constants.TestSourceUrl}"));
Assert.That(showResult.StdOut, Does.Contain($"name: {Constants.TestSourceName}"));

Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Package"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain("id: AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain($"source: {Constants.TestSourceName}"));

Assert.That(showResult.StdOut, Does.Contain("AppInstallerTest/TestResource"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain("data: TestData"));
}

/// <summary>
Expand All @@ -120,24 +120,24 @@ public void ExportTestPackageWithVersion()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--package-id AppInstallerTest.TestPackageExport --include-versions -o {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
Assert.True(File.Exists(exportFile));
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(exportFile, Does.Exist);

// Check exported file is readable and validate content
var showResult = TestCommon.RunAICLICommand(ShowCommand, $"-f {exportFile}");
Assert.AreEqual(Constants.ErrorCode.S_OK, showResult.ExitCode);
Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Source"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.True(showResult.StdOut.Contains($"type: {Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains($"argument: {Constants.TestSourceUrl}"));
Assert.True(showResult.StdOut.Contains($"name: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Package"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains("id: AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains($"source: {Constants.TestSourceName}"));
Assert.True(showResult.StdOut.Contains("version: 1.0.0.0"));
Assert.That(showResult.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Source"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.That(showResult.StdOut, Does.Contain($"type: {Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain($"argument: {Constants.TestSourceUrl}"));
Assert.That(showResult.StdOut, Does.Contain($"name: {Constants.TestSourceName}"));

Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Package"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain("id: AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain($"source: {Constants.TestSourceName}"));
Assert.That(showResult.StdOut, Does.Contain("version: 1.0.0.0"));
}

/// <summary>
Expand All @@ -150,38 +150,38 @@ public void ExportAll()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--all --verbose -o {exportFile}", timeOut: 1200000);
Assert.AreEqual(Constants.ErrorCode.S_OK, result.ExitCode);
Assert.True(File.Exists(exportFile));
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));
Assert.That(exportFile, Does.Exist);

// Check exported file is readable and validate content
var showResult = TestCommon.RunAICLICommand(ShowCommand, $"-f {exportFile}", timeOut: 1200000);
Assert.AreEqual(Constants.ErrorCode.S_OK, showResult.ExitCode);
Assert.That(showResult.ExitCode, Is.EqualTo(Constants.ErrorCode.S_OK));

Assert.True(showResult.StdOut.Contains("Microsoft.PowerShell"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.PowerShell"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/UserSettingsFile"));
Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/AdminSettings"));
Assert.True(showResult.StdOut.Contains("Microsoft.Windows.Settings/WindowsSettings"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/UserSettingsFile"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/AdminSettings"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.Windows.Settings/WindowsSettings"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Source"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.True(showResult.StdOut.Contains($"type: {Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains($"argument: {Constants.TestSourceUrl}"));
Assert.True(showResult.StdOut.Contains($"name: {Constants.TestSourceName}"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Source"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_{Constants.TestSourceType}]"));
Assert.That(showResult.StdOut, Does.Contain($"type: {Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain($"argument: {Constants.TestSourceUrl}"));
Assert.That(showResult.StdOut, Does.Contain($"name: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("Microsoft.WinGet.Dev/Package"));
Assert.True(showResult.StdOut.Contains($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.True(showResult.StdOut.Contains("id: AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains($"source: {Constants.TestSourceName}"));
Assert.That(showResult.StdOut, Does.Contain("Microsoft.WinGet.Dev/Package"));
Assert.That(showResult.StdOut, Does.Contain($"[{Constants.TestSourceName}_AppInstallerTest.TestPackageExport]"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_{Constants.TestSourceType}"));
Assert.That(showResult.StdOut, Does.Contain("id: AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain($"source: {Constants.TestSourceName}"));

Assert.True(showResult.StdOut.Contains("AppInstallerTest/TestResource"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains("data: TestData"));
Assert.That(showResult.StdOut, Does.Contain("AppInstallerTest/TestResource"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain("data: TestData"));

Assert.True(showResult.StdOut.Contains("AppInstallerTest/TestResource_SubDirectory"));
Assert.True(showResult.StdOut.Contains($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.True(showResult.StdOut.Contains("data: TestData"));
Assert.That(showResult.StdOut, Does.Contain("AppInstallerTest/TestResource_SubDirectory"));
Assert.That(showResult.StdOut, Does.Contain($"Dependencies: {Constants.TestSourceName}_AppInstallerTest.TestPackageExport"));
Assert.That(showResult.StdOut, Does.Contain("data: TestData"));
}

/// <summary>
Expand All @@ -193,7 +193,7 @@ public void ExportFailedWithNotFoundPackage()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--package-id NotFound.NotFound -o {exportFile}");
Assert.AreEqual(Constants.ErrorCode.ERROR_NO_APPLICATIONS_FOUND, result.ExitCode);
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.ERROR_NO_APPLICATIONS_FOUND));
}

/// <summary>
Expand All @@ -205,7 +205,7 @@ public void ExportFailedWithAllAndSpecificPackage()
var exportDir = TestCommon.GetRandomTestDir();
var exportFile = Path.Combine(exportDir, "exported.yml");
var result = TestCommon.RunAICLICommand(Command, $"--all --package-id AppInstallerTest.TestPackageExport -o {exportFile}");
Assert.AreEqual(Constants.ErrorCode.ERROR_INVALID_CL_ARGUMENTS, result.ExitCode);
Assert.That(result.ExitCode, Is.EqualTo(Constants.ErrorCode.ERROR_INVALID_CL_ARGUMENTS));
}
}
}
Loading
Loading