Skip to content

Commit

Permalink
Update Vestris.ResourceLib to v2.2.0 (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft authored Jul 2, 2024
1 parent 3d54dab commit 8725a01
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/WingetCreateCore/WingetCreateCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Octokit" Version="9.1.2" />
<PackageReference Include="Vestris.ResourceLib" Version="2.1.0" />
<PackageReference Include="Vestris.ResourceLib" Version="2.2.0" />
<PackageReference Include="WiX" Version="3.14.1" />
<PackageReference Include="YamlDotNet" Version="15.1.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Installers:
InstallerType: exe
InstallerSha256: A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC
ProductCode: FakeProductCode
PackageFamilyName: FakePackageFamilyName
PackageFamilyName: Fake.PackageFamilyName_8wekyb3d8bbwe
Platform:
- Windows.Desktop
PackageLocale: en-US
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,22 @@ public void TearDown()
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[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}");
}

/// <summary>
Expand Down Expand Up @@ -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.;");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@
<None Update="Resources\WingetCreateE2E.Yaml.MsiTest.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\TestPublisher.TestApp.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\TestPublisher.MultipleInstallerApp.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down

0 comments on commit 8725a01

Please sign in to comment.