Skip to content

Commit 4bb250b

Browse files
author
Jason Zhai
committed
Enable test execution in a Debian container
1 parent e7403bf commit 4bb250b

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.vsts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extends:
6969
centosStream9:
7070
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
7171
debian12Amd64:
72-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64
72+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc15-amd64
7373
fedora39:
7474
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
7575
mariner20CrossArm:

.vsts-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ resources:
3232
- container: centosStream9
3333
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
3434
- container: debian12Amd64
35-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64
35+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc15-amd64
3636
- container: fedora39
3737
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
3838
- container: ubuntu2204DebPkg

eng/pipelines/templates/jobs/sdk-job-matrix.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ parameters:
5252
container: debian12Amd64
5353
helixTargetContainer: $(helixTargetContainerPrefix)debian-11-helix-amd64
5454
osProperties: /p:OSName=linux /p:BuildSdkDeb=true
55-
# Skipping all container-based testing for now.
56-
# See: https://github.com/dotnet/sdk/issues/40935
57-
runTests: false
55+
runTests: true
5856
- categoryName: ContainerBased
5957
container: alpine319WithNode
6058
helixTargetContainer: $(helixTargetContainerPrefix)alpine-3.18-helix-amd64

test/Microsoft.NET.TestFramework/EnvironmentInfo.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ public static bool SupportsTargetFramework(string targetFramework)
101101
return false;
102102
}
103103
}
104+
else if (osId.Equals("debian", StringComparison.OrdinalIgnoreCase))
105+
{
106+
if (nugetFramework.Version < new Version(2, 0, 0, 0))
107+
{
108+
return false;
109+
}
110+
}
104111
else if (Version.TryParse(versionString, out Version? osVersion))
105112
{
106113
if (osId.Equals("fedora", StringComparison.OrdinalIgnoreCase))

test/dotnet.Tests/CommandTests/Workload/Restore/GivenDotnetWorkloadRestore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ public void ProjectsThatDoNotSupportWorkloadsAndAreTransitivelyReferencedDoNotBr
6060

6161
private bool IsRunningInContainer()
6262
{
63-
return File.Exists("/.dockerenv") && RuntimeInformation.OSDescription.Contains("Ubuntu");
63+
return File.Exists("/.dockerenv") && (RuntimeInformation.OSDescription.Contains("Ubuntu") || RuntimeInformation.OSDescription.Contains("Debian"));
6464
}
6565
}

0 commit comments

Comments
 (0)