Skip to content

Commit f09c5c4

Browse files
Surayya Huseyn ZadaSurayya Huseyn Zada
authored andcommitted
move DockerIsAvailableAndSupportsArchTheoryAttribute to its own file; rename DockerIsAvailableAndSupportsArchFactAttribute file
1 parent 0f5e6c8 commit f09c5c4

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/DockerSupportsArchFact.cs renamed to src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/DockerIsAvailableAndSupportsArchFact.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,3 @@ public DockerIsAvailableAndSupportsArchFactAttribute(string arch, bool checkCont
2121
}
2222
}
2323
}
24-
25-
public class DockerIsAvailableAndSupportsArchTheoryAttribute : TheoryAttribute
26-
{
27-
public DockerIsAvailableAndSupportsArchTheoryAttribute(string arch, bool checkContainerdStoreAvailability = false)
28-
{
29-
if (!DockerSupportsArchHelper.DaemonIsAvailable)
30-
{
31-
base.Skip = "Skipping test because Docker is not available on this host.";
32-
}
33-
else if (checkContainerdStoreAvailability && !DockerSupportsArchHelper.IsContainerdStoreEnabledForDocker)
34-
{
35-
base.Skip = "Skipping test because Docker daemon is not using containerd as the storage driver.";
36-
}
37-
else if (!DockerSupportsArchHelper.DaemonSupportsArch(arch))
38-
{
39-
base.Skip = $"Skipping test because Docker daemon does not support {arch}.";
40-
}
41-
}
42-
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.NET.Build.Containers.IntegrationTests;
5+
6+
public class DockerIsAvailableAndSupportsArchTheoryAttribute : TheoryAttribute
7+
{
8+
public DockerIsAvailableAndSupportsArchTheoryAttribute(string arch, bool checkContainerdStoreAvailability = false)
9+
{
10+
if (!DockerSupportsArchHelper.DaemonIsAvailable)
11+
{
12+
base.Skip = "Skipping test because Docker is not available on this host.";
13+
}
14+
else if (checkContainerdStoreAvailability && !DockerSupportsArchHelper.IsContainerdStoreEnabledForDocker)
15+
{
16+
base.Skip = "Skipping test because Docker daemon is not using containerd as the storage driver.";
17+
}
18+
else if (!DockerSupportsArchHelper.DaemonSupportsArch(arch))
19+
{
20+
base.Skip = $"Skipping test because Docker daemon does not support {arch}.";
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)