Skip to content

Commit 3269626

Browse files
committed
integration test
1 parent ab67b2b commit 3269626

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ jobs:
128128
podman build -t renci-ssh-tests-server-image -f test/Renci.SshNet.IntegrationTests/Dockerfile test/Renci.SshNet.IntegrationTests/
129129
podman run --rm -h renci-ssh-tests-server -d -p 2222:22 renci-ssh-tests-server-image
130130
131+
- name: Run Integration Tests .NET
132+
run:
133+
dotnet test `
134+
-f net9.0 `
135+
--logger "console;verbosity=normal" `
136+
--logger GitHubActions `
137+
--filter "Name~Curve25519|Name~X25519" `
138+
-p:CollectCoverage=true `
139+
-p:CoverletOutputFormat=cobertura `
140+
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_9_coverage.xml `
141+
test\Renci.SshNet.IntegrationTests\
142+
131143
- name: Run Integration Tests .NET Framework
132144
run:
133145
dotnet test `

test/Renci.SshNet.IntegrationTests/TestsFixtures/InfrastructureFixture.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using DotNet.Testcontainers.Builders;
1+
using System.Runtime.InteropServices;
2+
3+
using DotNet.Testcontainers.Builders;
24
using DotNet.Testcontainers.Containers;
35
using DotNet.Testcontainers.Images;
46

@@ -38,16 +40,17 @@ private InfrastructureFixture()
3840

3941
public async Task InitializeAsync()
4042
{
41-
// for the .NET Framework Tests in CI, the Container is set up in WSL2 with Podman
42-
#if NETFRAMEWORK
43-
if (Environment.GetEnvironmentVariable("CI") == "true")
43+
#pragma warning disable MA0144 // use System.OperatingSystem to check the current OS
44+
// for the Windows Tests in CI, the Container is set up in WSL2 with Podman
45+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
46+
Environment.GetEnvironmentVariable("CI") == "true")
47+
#pragma warning restore MA0144 // use System.OperatingSystem to check the current OS
4448
{
4549
SshServerPort = 2222;
4650
SshServerHostName = "localhost";
4751
await Task.Delay(1_000);
4852
return;
4953
}
50-
#endif
5154

5255
var containerLogger = _loggerFactory.CreateLogger("testcontainers");
5356

0 commit comments

Comments
 (0)