From f839dee6790b9af40dfb11060028df792ad0762a Mon Sep 17 00:00:00 2001 From: Ryan <69221034+ryfu-msft@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:02:06 -0700 Subject: [PATCH] Update Vestris.ResourceLib to v2.2.0 (#536) --- .../Resources/TestPublisher.SingleExe.yaml | 2 +- .../Resources/TestPublisher.TestApp.yaml | 30 -- .../UnitTests/UpdateCommandTests.cs | 14 +- .../WingetCreateTests.csproj | 343 +++++++++--------- 4 files changed, 180 insertions(+), 209 deletions(-) delete mode 100644 src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.TestApp.yaml diff --git a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.SingleExe.yaml b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.SingleExe.yaml index 15f60abb..77387f58 100644 --- a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.SingleExe.yaml +++ b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.SingleExe.yaml @@ -11,7 +11,7 @@ Installers: InstallerType: exe InstallerSha256: A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC ProductCode: FakeProductCode - PackageFamilyName: FakePackageFamilyName + PackageFamilyName: Fake.PackageFamilyName_8wekyb3d8bbwe Platform: - Windows.Desktop PackageLocale: en-US diff --git a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.TestApp.yaml b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.TestApp.yaml deleted file mode 100644 index 966ebde9..00000000 --- a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.TestApp.yaml +++ /dev/null @@ -1,30 +0,0 @@ -PackageIdentifier: TestPublisher.TestApp -PackageVersion: 0.1.2 -PackageName: Test app -Publisher: Test publisher -License: MIT -ShortDescription: A manifest used for testing. -Installers: -- Architecture: x86 - InstallerType: msix - InstallerUrl: https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - InstallerSha256: 02D5F4B5B74189BE631827FE201908F86ABCCAD788225D862F8E3388D9568645 - SignatureSha256: BB7EBF738006124F59709E33530DAF2E2005C45E8D45B6ED800FD5ACE1F2BD5A -- Architecture: x64 - InstallerType: msix - InstallerUrl: https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - InstallerSha256: 02D5F4B5B74189BE631827FE201908F86ABCCAD788225D862F8E3388D9568645 - SignatureSha256: BB7EBF738006124F59709E33530DAF2E2005C45E8D45B6ED800FD5ACE1F2BD5A -- Architecture: arm - InstallerType: msix - InstallerUrl: https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - InstallerSha256: 02D5F4B5B74189BE631827FE201908F86ABCCAD788225D862F8E3388D9568645 - SignatureSha256: BB7EBF738006124F59709E33530DAF2E2005C45E8D45B6ED800FD5ACE1F2BD5A -- Architecture: arm64 - InstallerType: msix - InstallerUrl: https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - InstallerSha256: 02D5F4B5B74189BE631827FE201908F86ABCCAD788225D862F8E3388D9568645 - SignatureSha256: BB7EBF738006124F59709E33530DAF2E2005C45E8D45B6ED800FD5ACE1F2BD5A -PackageLocale: en-US -ManifestType: singleton -ManifestVersion: 1.0.0 \ No newline at end of file diff --git a/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs b/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs index 3024d4ee..ad3d9cf5 100644 --- a/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs +++ b/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs @@ -67,18 +67,22 @@ public void TearDown() /// /// A representing the asynchronous unit test. [Test] - public async Task UpdateCommandGitHubManifestTest() + public async Task UpdateAndVerifyManifestsCreated() { + string installerUrl = $"https://fakedomain.com/{TestConstants.TestExeInstaller}"; + TestUtils.InitializeMockDownloads(TestConstants.TestExeInstaller); + + string packageIdentifier = "TestPublisher.SingleExe"; string version = "1.2.3.4"; - (UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData(TestConstants.TestPackageIdentifier, version, this.tempPath, null); + (UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData(packageIdentifier, version, this.tempPath, new[] { $"{installerUrl}" }); var updatedManifests = await command.ExecuteManifestUpdate(initialManifestContent, this.testCommandEvent); ClassicAssert.IsTrue(updatedManifests, "Command should have succeeded"); - string manifestDir = Utils.GetAppManifestDirPath(TestConstants.TestPackageIdentifier, version); + string manifestDir = Utils.GetAppManifestDirPath(packageIdentifier, version); var updatedManifestContents = Directory.GetFiles(Path.Combine(this.tempPath, manifestDir)).Select(f => File.ReadAllText(f)); ClassicAssert.IsTrue(updatedManifestContents.Any(), "Updated manifests were not created successfully"); Manifests manifestsToValidate = Serialization.DeserializeManifestContents(updatedManifestContents); - ClassicAssert.AreEqual(version, manifestsToValidate.VersionManifest.PackageVersion, $"Failed to update version of {TestConstants.TestPackageIdentifier}"); + ClassicAssert.AreEqual(version, manifestsToValidate.VersionManifest.PackageVersion, $"Failed to update version of {packageIdentifier}"); } /// @@ -598,7 +602,7 @@ public async Task UpdatePreservesExistingValues() ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); var updatedInstallerManifest = updatedManifests.InstallerManifest; ClassicAssert.AreEqual("FakeProductCode", updatedInstallerManifest.ProductCode, "Existing value for ProductCode was overwritten."); - ClassicAssert.AreEqual("FakePackageFamilyName", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten."); + ClassicAssert.AreEqual("Fake.PackageFamilyName_8wekyb3d8bbwe", updatedInstallerManifest.PackageFamilyName, "Existing value for PackageFamilyName was overwritten."); ClassicAssert.IsNotNull(updatedInstallerManifest.Platform, "Existing value for Platform was overwritten.;"); } diff --git a/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj b/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj index 3c864d20..90e0584a 100644 --- a/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj +++ b/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj @@ -26,177 +26,174 @@ - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + \ No newline at end of file