Skip to content

Commit abc2d96

Browse files
author
nicrowe
committed
Drop support for EOL .NET versions, remove obsolete tests
and update test matrix. Dropping support from tests for versions of .NET that are now EOL. Removing tests that are rendered obsolete by recent changes. Updating the test matrix for the latest OS releases. Closes #76
1 parent c91e1c4 commit abc2d96

File tree

11 files changed

+69
-212
lines changed

11 files changed

+69
-212
lines changed

.github/workflows/ci.yml

+59-21
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,29 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
container_image:
17-
- quay.io/centos/centos:stream8
1817
- quay.io/centos/centos:stream9
19-
- registry.fedoraproject.org/fedora:37
20-
- registry.fedoraproject.org/fedora:38
18+
- quay.io/centos/centos:stream10-development
2119
- registry.fedoraproject.org/fedora:39
20+
- registry.fedoraproject.org/fedora:40
2221
- registry.fedoraproject.org/fedora:rawhide
2322
- registry.access.redhat.com/ubi8
2423
- registry.access.redhat.com/ubi9
2524
dotnet_version:
2625
- "6.0"
27-
- "7.0"
26+
- "8.0"
27+
exclude:
28+
- container_image: registry.fedoraproject.org/fedora:rawhide
29+
dotnet_version: "6.0"
30+
- container_image: quay.io/centos/centos:stream10-development
31+
dotnet_version: "6.0"
2832
include:
29-
- container_image: quay.io/centos/centos:stream9
30-
dotnet_version: "8.0"
33+
- container_image: registry.fedoraproject.org/fedora:40
34+
dotnet_version: "9.0"
35+
- container_image: registry.fedoraproject.org/fedora:rawhide
36+
dotnet_version: "9.0"
37+
- container_image: quay.io/centos/centos:stream10-development
38+
dotnet_version: "9.0"
39+
3140

3241
container:
3342
image: ${{ matrix.container_image }}
@@ -38,13 +47,22 @@ jobs:
3847
timeout-minutes: 5
3948
run: |
4049
set -euo pipefail
41-
if command -v dnf; then
42-
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
43-
elif command -v apk; then
44-
apk add bash curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ make zlib
45-
curl -sSLO https://dot.net/v1/dotnet-install.sh
46-
chmod +x ./dotnet-install.sh
47-
./dotnet-install.sh --channel ${{ matrix.dotnet_version }}
50+
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
51+
dnf install 'dnf-command(copr)' -y
52+
cat /etc/os-release
53+
if grep centos /etc/os-release ; then
54+
dnf copr enable @dotnet-sig/dotnet-preview centos-stream-10-x86_64 -y
55+
else
56+
dnf copr enable @dotnet-sig/dotnet-preview -y
57+
fi
58+
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
59+
fi
60+
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
61+
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
62+
dnf install -y \
63+
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
64+
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
65+
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
4866
fi
4967
5068
- uses: actions/checkout@v2
@@ -80,20 +98,26 @@ jobs:
8098
fail-fast: false
8199
matrix:
82100
container_image:
83-
- quay.io/centos/centos:stream8
84101
- quay.io/centos/centos:stream9
85-
- registry.fedoraproject.org/fedora:37
102+
- quay.io/centos/centos:stream10-development
86103
- registry.fedoraproject.org/fedora:38
87104
- registry.fedoraproject.org/fedora:39
105+
- registry.fedoraproject.org/fedora:40
88106
- registry.fedoraproject.org/fedora:rawhide
89107
- registry.access.redhat.com/ubi8
90108
- registry.access.redhat.com/ubi9
91109
dotnet_version:
92110
- "6.0"
93-
- "7.0"
111+
- "8.0"
112+
exclude:
113+
- container_image: registry.fedoraproject.org/fedora:rawhide
114+
- container_image: quay.io/centos/centos:stream10-development
115+
dotnet_version: "6.0"
94116
include:
95-
- container_image: quay.io/centos/centos:stream9
96-
dotnet_version: "8.0"
117+
- container_image: registry.fedoraproject.org/fedora:40
118+
- container_image: registry.fedoraproject.org/fedora:rawhide
119+
- container_image: quay.io/centos/centos:stream10-development
120+
dotnet_version: "9.0"
97121

98122

99123
container:
@@ -105,7 +129,23 @@ jobs:
105129
timeout-minutes: 5
106130
run: |
107131
set -euo pipefail
132+
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
133+
dnf install 'dnf-command(copr)' -y
134+
cat /etc/os-release
135+
if grep centos /etc/os-release ; then
136+
dnf copr enable @dotnet-sig/dotnet-preview centos-stream-10-x86_64 -y
137+
else
138+
dnf copr enable @dotnet-sig/dotnet-preview -y
139+
fi
140+
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
141+
fi
108142
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
143+
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
144+
dnf install -y \
145+
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
146+
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
147+
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
148+
fi
109149
110150
# We need to fetch the tags, so 'git tag' in 'make publish' below works
111151
- uses: actions/checkout@v2
@@ -127,9 +167,7 @@ jobs:
127167
- name: Install Test dependencies
128168
timeout-minutes: 2
129169
run: |
130-
dnf install -y python3 wget \
131-
$(grep '^Dependencies(dnf): ' dotnet-regular-tests/README.md | cut -d: -f2-) \
132-
--skip-broken
170+
dnf install -y python3 wget $(grep '^Dependencies(dnf): ' README.md | cut -d: -f2-) --skip-broken
133171
134172
- name: Run reproducers
135173
run: |

Samples/BashTestSpecificToDotNet2x/test.json Samples/BashTestSpecificToDotNet6x/test.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "BashTestSpecificToDotNet2x",
2+
"name": "BashTestSpecificToDotNet6x",
33
"enabled": true,
44
"requiresSdk": true,
5-
"version": "2.x",
5+
"version": "6.x",
66
"versionSpecific": true,
77
"type": "bash",
88
"cleanup": true,

Turkey.Tests/CsprojCompatibilityPatcherTest.cs

-36
This file was deleted.

Turkey.Tests/SourceBuildTest.cs

-11
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage messag
4848
}
4949
}
5050

51-
[Fact]
52-
public async Task VerifyProdConFeedIsLookedUpAndThenTheFeedIsVerifiedToResolve()
53-
{
54-
var messageHandler = new ProdConHandler();
55-
var client = new HttpClient(messageHandler);
56-
var sourceBuild = new SourceBuild(client);
57-
58-
var feed = await sourceBuild.GetProdConFeedAsync(Version.Parse("3.1"));
59-
60-
Assert.Equal(FAKE_FEED, feed);
61-
}
6251

6352
[Fact]
6453
public async Task VerifyProdConFeedIsNotUsedForNewReleases()

Turkey/CsprojCompatibilityPatcher.cs

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,8 @@ public string Patch(string originalCsprojContents, Version newRuntime)
1414
{
1515
var pattern = @"<TargetFramework>net(?:coreapp)?\d\.\d+</TargetFramework>";
1616
var versionString = newRuntime.MajorMinor;
17-
string replacement = null;
18-
if (newRuntime.Major < 4)
19-
{
20-
replacement = $"<TargetFramework>netcoreapp{versionString}</TargetFramework>";
21-
}
22-
else
23-
{
24-
replacement = $"<TargetFramework>net{versionString}</TargetFramework>";
25-
}
17+
var replacement = $"<TargetFramework>net{versionString}</TargetFramework>";
18+
2619
var output = Regex.Replace(originalCsprojContents, pattern, replacement);
2720

2821
return output;

Turkey/Program.cs

-30
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,6 @@ public static async Task<string> GenerateNuGetConfigIfNeededAsync(string additio
152152
var nuget = new NuGet(client);
153153
var sourceBuild = new SourceBuild(client);
154154

155-
if (netCoreAppVersion.Major < 4)
156-
{
157-
try
158-
{
159-
var prodConUrl = await GetProdConFeedUrlIfNeededAsync(nuget, sourceBuild, netCoreAppVersion);
160-
if (!string.IsNullOrEmpty(prodConUrl))
161-
{
162-
prodConUrl = prodConUrl.Trim();
163-
Console.WriteLine($"Packages are not live on nuget.org; using {prodConUrl} as additional package source");
164-
urls.Add(prodConUrl);
165-
}
166-
}
167-
catch (HttpRequestException exception)
168-
{
169-
Console.WriteLine("WARNING: failed to get ProdCon url. Ignoring Exception:");
170-
Console.WriteLine(exception.ToString());
171-
}
172-
}
173-
174155
string nugetConfig = null;
175156
if (useSourceBuildNuGetConfig)
176157
{
@@ -233,17 +214,6 @@ public static IReadOnlySet<string> CreateTraits(Version runtimeVersion, Version
233214
return traits;
234215
}
235216

236-
public static async Task<string> GetProdConFeedUrlIfNeededAsync(NuGet nuget, SourceBuild sourceBuild, Version netCoreAppVersion)
237-
{
238-
bool live = await nuget.IsPackageLiveAsync("runtime.linux-x64.Microsoft.NetCore.DotNetAppHost", netCoreAppVersion);
239-
if (!live)
240-
{
241-
return await sourceBuild.GetProdConFeedAsync(netCoreAppVersion);
242-
}
243-
244-
return null;
245-
}
246-
247217
static async Task<int> Main(string[] args)
248218
{
249219
var rootCommand = new RootCommand(description: "A test runner for running standalone bash-based or xunit tests");

Turkey/SourceBuild.cs

+2-12
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,8 @@ public SourceBuild(HttpClient client)
1818

1919
public string GetBranchContentUrl(Version version)
2020
{
21-
string url;
22-
if (version.Major <= 3)
23-
{
24-
var branchName = "release/" + version.MajorMinor;
25-
url = $"https://raw.githubusercontent.com/dotnet/source-build/{branchName}/";
26-
}
27-
else
28-
{
29-
var branchName = "release/" + version.MajorMinor + ".1xx";
30-
url = $"https://raw.githubusercontent.com/dotnet/installer/{branchName}/";
31-
}
32-
21+
var branchName = "release/" + version.MajorMinor + ".1xx";
22+
var url = $"https://raw.githubusercontent.com/dotnet/installer/{branchName}/";
3323
return url;
3424
}
3525

Turkey/Test.cs

+4-37
Original file line numberDiff line numberDiff line change
@@ -75,45 +75,12 @@ public async Task<TestResult> RunAsync(Action<string> logger, CancellationToken
7575

7676
private void UpdateProjectFilesIfPresent()
7777
{
78-
if (SystemUnderTest.RuntimeVersion < Version.Parse("2.0"))
78+
var csprojFile = $"{Directory.Name}.csproj";
79+
var csprojPath = Path.Combine(this.Directory.FullName, csprojFile);
80+
if (File.Exists(csprojPath))
7981
{
80-
var projectJsonPath = Path.Combine(this.Directory.FullName, "project.json");
81-
if (File.Exists(projectJsonPath))
82-
{
83-
CopyProjectJsonFile();
84-
}
85-
}
86-
else
87-
{
88-
var csprojFile = $"{Directory.Name}.csproj";
89-
var csprojPath = Path.Combine(this.Directory.FullName, csprojFile);
90-
if (File.Exists(csprojPath))
91-
{
92-
UpdateCsprojVersion(csprojPath);
93-
}
94-
}
95-
}
96-
97-
private void CopyProjectJsonFile()
98-
{
99-
string majorMinor = "" + SystemUnderTest.RuntimeVersion.Major + SystemUnderTest.RuntimeVersion.Minor;
100-
var fileName = $"resources/project{majorMinor}xunit.json";
101-
var resourceLocation = FindResourceFile(fileName);
102-
var source = resourceLocation;
103-
var dest = Path.Combine(this.Directory.FullName, "project.json");
104-
File.Copy(source, dest);
105-
}
106-
107-
private static string FindResourceFile(string name)
108-
{
109-
var assemblyLocation = Assembly.GetExecutingAssembly().Location;
110-
var dir = Path.GetDirectoryName(assemblyLocation);
111-
var resourceLocation = Path.Combine(dir, name);
112-
if (!File.Exists(resourceLocation))
113-
{
114-
throw new Exception($"Resource {name} at location {resourceLocation} does not exist");
82+
UpdateCsprojVersion(csprojPath);
11583
}
116-
return resourceLocation;
11784
}
11885

11986
private void UpdateCsprojVersion(string csprojPath)

Turkey/resources/project10xunit.json

-27
This file was deleted.

Turkey/resources/project11xunit.json

-27
This file was deleted.

0 commit comments

Comments
 (0)