Skip to content

Commit e78bbc7

Browse files
committed
Allow empty TestData for repos that aren't in the manifest
1 parent ecaa5c4 commit e78bbc7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/Microsoft.DotNet.Docker.Tests/TestDataTests.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ public class TestDataTests(ITestOutputHelper outputHelper)
3131
[MemberData(nameof(ImageRepos))]
3232
public void VerifyTestData(DotNetImageRepo imageRepo)
3333
{
34+
var testData = GetTestData(imageRepo);
35+
3436
string repoName = ImageData.GetRepoName(ProductImageData.GetDotNetImageRepoName(imageRepo));
37+
Repo? manifestRepo = _manifest.Repos.FirstOrDefault(r => r.Name == repoName);
3538

36-
Repo manifestRepo = _manifest.Repos.First(r => r.Name == repoName);
39+
if (manifestRepo == null)
40+
{
41+
testData.ShouldBeEmpty($"Expected TestData to be empty because repo {repoName} is not in the manifest.");
42+
return;
43+
}
3744

3845
List<string> testDataTags =
39-
GetTestData(imageRepo)
46+
testData
4047
.Select(productImageData =>
4148
productImageData
4249
.GetImage(imageRepo, _dockerHelper, skipPull: true)

0 commit comments

Comments
 (0)