Skip to content

Commit

Permalink
Remove expected failure check since restore uses correct RID
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Aug 19, 2024
1 parent df0c4fc commit 9da2829
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
11 changes: 6 additions & 5 deletions tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ public static IEnumerable<object[]> GetImageData()
public async void VerifyBlazorWasmScenario(ProductImageData imageData)
{
// Test will fail on main branch since `dotnet workload install` does not work with an empty NuGet config.
bool failureExpected = !Config.IsNightlyRepo;
// Skip test for now, re-enable when https://github.com/dotnet/dotnet-docker/issues/5787 is closed.
if (!Config.IsNightlyRepo)
{
return;
}

bool isAlpine = imageData.OS.StartsWith(OS.Alpine);

// Microsoft.NETCore.App.Runtime.Mono.linux-musl-arm* package does not exist
failureExpected |= isAlpine && imageData.IsArm;

bool useWasmTools = true;

// `wasm-tools` workload does not work on .NET 6 with CBL Mariner 2.0.
Expand All @@ -85,7 +86,7 @@ public async void VerifyBlazorWasmScenario(ProductImageData imageData)
}

using BlazorWasmScenario testScenario = new(imageData, DockerHelper, OutputHelper, useWasmTools);
await testScenario.ExecuteAsync(shouldThrow: failureExpected);
await testScenario.ExecuteAsync();
}

[LinuxImageTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.DotNet.Docker.Tests;

public class AspireDashboardBasicScenario : TestScenario
public class AspireDashboardBasicScenario : ITestScenario
{
private readonly DockerHelper _dockerHelper;

Expand All @@ -31,7 +31,7 @@ public AspireDashboardBasicScenario(
_imageTag = _imageData.GetImage(DotNetImageRepo.Aspire_Dashboard, _dockerHelper);
}

protected override async Task ExecuteInternalAsync()
public async Task ExecuteAsync()
{
string containerName = _imageData.GetIdentifier(nameof(AspireDashboardBasicScenario));

Expand Down
16 changes: 2 additions & 14 deletions tests/Microsoft.DotNet.Docker.Tests/TestScenarios/ITestScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,11 @@

#nullable enable

using System;
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.DotNet.Docker.Tests;

public abstract class TestScenario
public interface ITestScenario
{
public Task ExecuteAsync(bool shouldThrow = false)
{
if (shouldThrow)
{
return Assert.ThrowsAnyAsync<Exception>(ExecuteInternalAsync);
}

return ExecuteInternalAsync();
}

protected abstract Task ExecuteInternalAsync();
Task ExecuteAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Microsoft.DotNet.Docker.Tests;

public abstract class ProjectTemplateTestScenario : TestScenario, IDisposable
public abstract class ProjectTemplateTestScenario : ITestScenario, IDisposable
{
private bool _disposed;

Expand Down Expand Up @@ -113,7 +113,7 @@ protected string Build(string stageTarget, string[]? customBuildArgs)
return tag;
}

protected override async Task ExecuteInternalAsync()
public async Task ExecuteAsync()
{
List<string> tags = [];

Expand Down

0 comments on commit 9da2829

Please sign in to comment.