mirror of
https://github.com/actions/runner.git
synced 2025-12-13 10:05:23 +00:00
remove test asserting thrown exception
This commit is contained in:
@@ -12,7 +12,6 @@ using System;
|
|||||||
namespace GitHub.Runner.Common.Tests.Worker
|
namespace GitHub.Runner.Common.Tests.Worker
|
||||||
{
|
{
|
||||||
|
|
||||||
[Collection("Sequential")]
|
|
||||||
public sealed class ContainerOperationProviderL0
|
public sealed class ContainerOperationProviderL0
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -29,20 +28,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
|
|
||||||
List<ContainerInfo> containers = new List<ContainerInfo>();
|
List<ContainerInfo> containers = new List<ContainerInfo>();
|
||||||
|
|
||||||
[Fact]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Worker")]
|
|
||||||
public async void RunServiceContainersHealthcheck_UnhealthyServiceContainer_AssertExceptionThrown()
|
|
||||||
{
|
|
||||||
//Arrange
|
|
||||||
Setup();
|
|
||||||
_dockerManager.Setup(x => x.DockerInspect(_ec.Object, It.IsAny<string>(), It.IsAny<string>())).Returns(Task.FromResult(unhealthyDockerStatus));
|
|
||||||
|
|
||||||
//Act and Assert
|
|
||||||
await Assert.ThrowsAsync<InvalidOperationException>(() => containerOperationProvider.RunContainersHealthcheck(_ec.Object, containers));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", "Worker")]
|
[Trait("Category", "Worker")]
|
||||||
@@ -58,11 +43,11 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
await containerOperationProvider.RunContainersHealthcheck(_ec.Object, containers);
|
await containerOperationProvider.RunContainersHealthcheck(_ec.Object, containers);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException) { }
|
catch (InvalidOperationException) {
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
Assert.Equal(TaskResult.Failed, _ec.Object.Result ?? TaskResult.Failed);
|
Assert.Equal(TaskResult.Failed, _ec.Object.Result ?? TaskResult.Failed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user