Skip to content

Commit

Permalink
Use lowercase manifest ID for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Oct 5, 2023
1 parent ccc71f2 commit 985930f
Showing 1 changed file with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public WorkloadGarbageCollectionTests(ITestOutputHelper log) : base(log)
[Fact]
public void GivenManagedInstallItCanGarbageCollect()
{
CreateMockManifest("TestManifest", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("TestManifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");
CreateMockManifest("testmanifest", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("testmanifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");

var (installer, getResolver) = GetTestInstaller();
var packsToKeep = new PackInfo[]
Expand Down Expand Up @@ -80,7 +80,7 @@ public void GivenManagedInstallItCanGarbageCollect()
[Fact]
public void GivenManagedInstallItCanGarbageCollectPacksMissingFromManifest()
{
CreateMockManifest("TestManifest", "1.0.0");
CreateMockManifest("testmanifest", "1.0.0");
var (installer, getResolver) = GetTestInstaller();
// Define packs that don't show up in the manifest
var packs = new PackInfo[]
Expand Down Expand Up @@ -114,13 +114,13 @@ public void GivenManagedInstallItCanGarbageCollectPacksMissingFromManifest()
[Fact]
public void GarbageCollectManifests()
{
CreateMockManifest("TestManifest", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("TestManifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");
CreateMockManifest("TestManifest", "3.0.0", "6.0.300", sourceManifestName: @"Sample2_v3.json");
CreateMockManifest("testm ", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("testmanifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");
CreateMockManifest("testmanifest", "3.0.0", "6.0.300", sourceManifestName: @"Sample2_v3.json");

CreateManifestRecord("TestManifest", "1.0.0", "6.0.100", "6.0.300");
CreateManifestRecord("TestManifest", "2.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("TestManifest", "3.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("testmanifest", "1.0.0", "6.0.100", "6.0.300");
CreateManifestRecord("testmanifest", "2.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("testmanifest", "3.0.0", "6.0.300", "6.0.300");

var (installer, getResolver) = GetTestInstaller("6.0.300");

Expand Down Expand Up @@ -160,31 +160,31 @@ public void GarbageCollectManifests()
PackRecord(pack, "6.0.300").Should().Exist();
}

ManifestRecord("TestManifest", "1.0.0", "6.0.100", "6.0.300").Should().NotExist();
ManifestRecord("TestManifest", "2.0.0", "6.0.300", "6.0.300").Should().NotExist();
ManifestRecord("TestManifest", "3.0.0", "6.0.300", "6.0.300").Should().Exist();
ManifestRecord("testmanifest", "1.0.0", "6.0.100", "6.0.300").Should().NotExist();
ManifestRecord("testmanifest", "2.0.0", "6.0.300", "6.0.300").Should().NotExist();
ManifestRecord("testmanifest", "3.0.0", "6.0.300", "6.0.300").Should().Exist();

new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "TestManifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "TestManifest", "2.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "TestManifest", "3.0.0", "WorkloadManifest.json")).Should().Exist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "testmanifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "2.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "3.0.0", "WorkloadManifest.json")).Should().Exist();
}

[Fact]
public void GarbageCollectManifestsWithInstallState()
{
CreateMockManifest("TestManifest", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("TestManifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");
CreateMockManifest("TestManifest", "3.0.0", "6.0.300", sourceManifestName: @"Sample2_v3.json");
CreateMockManifest("testmanifest", "1.0.0", "6.0.100", sourceManifestName: @"Sample2.json");
CreateMockManifest("testmanifest", "2.0.0", "6.0.300", sourceManifestName: @"Sample2_v2.json");
CreateMockManifest("testmanifest", "3.0.0", "6.0.300", sourceManifestName: @"Sample2_v3.json");

CreateManifestRecord("TestManifest", "1.0.0", "6.0.100", "6.0.300");
CreateManifestRecord("TestManifest", "2.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("TestManifest", "3.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("testmanifest", "1.0.0", "6.0.100", "6.0.300");
CreateManifestRecord("testmanifest", "2.0.0", "6.0.300", "6.0.300");
CreateManifestRecord("testmanifest", "3.0.0", "6.0.300", "6.0.300");

CreateInstallState("6.0.300",
"""
{
"manifests": {
"TestManifest": "2.0.0/6.0.300",
"testmanifest": "2.0.0/6.0.300",
}
}
""");
Expand Down Expand Up @@ -227,13 +227,13 @@ public void GarbageCollectManifestsWithInstallState()
PackRecord(pack, "6.0.300").Should().Exist();
}

ManifestRecord("TestManifest", "1.0.0", "6.0.100", "6.0.300").Should().NotExist();
ManifestRecord("TestManifest", "2.0.0", "6.0.300", "6.0.300").Should().Exist();
ManifestRecord("TestManifest", "3.0.0", "6.0.300", "6.0.300").Should().NotExist();
ManifestRecord("testmanifest", "1.0.0", "6.0.100", "6.0.300").Should().NotExist();
ManifestRecord("testmanifest", "2.0.0", "6.0.300", "6.0.300").Should().Exist();
ManifestRecord("testmanifest", "3.0.0", "6.0.300", "6.0.300").Should().NotExist();

new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "TestManifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "TestManifest", "2.0.0", "WorkloadManifest.json")).Should().Exist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "TestManifest", "3.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "testmanifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "2.0.0", "WorkloadManifest.json")).Should().Exist();
new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "3.0.0", "WorkloadManifest.json")).Should().NotExist();
}

// Additional scenarios to add tests for once workload sets are added:
Expand Down

0 comments on commit 985930f

Please sign in to comment.