Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for EOL .NET versions, remove obsolete tests #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 62 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,11 @@ jobs:
fail-fast: false
matrix:
container_image:
- quay.io/centos/centos:stream8
- quay.io/centos/centos:stream9
- registry.fedoraproject.org/fedora:37
- registry.fedoraproject.org/fedora:38
- registry.fedoraproject.org/fedora:39
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
- registry.access.redhat.com/ubi9
- docker.io/library/alpine:latest
- docker.io/library/alpine:edge
dotnet_version:
- "6.0"
- "7.0"
include:
- container_image: quay.io/centos/centos:stream9
dotnet_version: "8.0"
- "8.0"

container:
image: ${{ matrix.container_image }}
Expand All @@ -38,13 +29,31 @@ jobs:
timeout-minutes: 5
run: |
set -euo pipefail
if command -v dnf; then
cat /etc/os-release
if grep fedora /etc/os-release; then
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
dnf install 'dnf-command(copr)' -y
dnf copr enable @dotnet-sig/dotnet-preview -y
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
fi
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
elif command -v apk; then
apk add bash curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ make zlib
curl -sSLO https://dot.net/v1/dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel ${{ matrix.dotnet_version }}
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
dnf install -y \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
elif grep alpine /etc/os-release; then
if grep edge /etc/os-release; then
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
fi
apk add dotnet-sdk-${{ matrix.dotnet_version }} dotnet-doc git make
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
apk add \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
fi

- uses: actions/checkout@v2
Expand Down Expand Up @@ -80,20 +89,11 @@ jobs:
fail-fast: false
matrix:
container_image:
- quay.io/centos/centos:stream8
- quay.io/centos/centos:stream9
- registry.fedoraproject.org/fedora:37
- registry.fedoraproject.org/fedora:38
- registry.fedoraproject.org/fedora:39
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
- registry.access.redhat.com/ubi9
- docker.io/library/alpine:latest
- docker.io/library/alpine:edge
dotnet_version:
- "6.0"
- "7.0"
include:
- container_image: quay.io/centos/centos:stream9
dotnet_version: "8.0"
- "8.0"


container:
Expand All @@ -105,7 +105,32 @@ jobs:
timeout-minutes: 5
run: |
set -euo pipefail
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
cat /etc/os-release
if grep fedora /etc/os-release ; then
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
dnf install 'dnf-command(copr)' -y
dnf copr enable @dotnet-sig/dotnet-preview -y
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
fi
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
dnf install -y \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
elif grep alpine /etc/os-release; then
if grep edge /etc/os-release; then
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
fi
apk add dotnet-sdk-${{ matrix.dotnet_version }} dotnet-doc git make
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
apk add \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
fi

# We need to fetch the tags, so 'git tag' in 'make publish' below works
- uses: actions/checkout@v2
Expand All @@ -127,9 +152,12 @@ jobs:
- name: Install Test dependencies
timeout-minutes: 2
run: |
dnf install -y python3 wget \
$(grep '^Dependencies(dnf): ' dotnet-regular-tests/README.md | cut -d: -f2-) \
--skip-broken
if grep fedora /etc/os-release ; then
dnf install -y python3 wget $(grep '^Dependencies(dnf): ' README.md | cut -d: -f2-) --skip-broken
elif grep alpine /etc/os-release; then
apk add python3 wget curl $(grep '^Dependencies(apk): ' README.md | cut -d: -f2-)
echo -e '[PostgreSQL]\nDescription=PostgreSQL Unicode\nDriver=/usr/lib/psqlodbcw.so\nUsageCount=1' > /etc/odbcinst.ini
fi

- name: Run reproducers
run: |
Expand Down
12 changes: 0 additions & 12 deletions Samples/BashTestSpecificToDotNet2x/test.json

This file was deleted.

3 changes: 0 additions & 3 deletions Samples/BashTestSpecificToDotNet2x/test.sh

This file was deleted.

12 changes: 0 additions & 12 deletions Samples/BashTestSpecificToDotNet50/test.json

This file was deleted.

3 changes: 0 additions & 3 deletions Samples/BashTestSpecificToDotNet50/test.sh

This file was deleted.

36 changes: 0 additions & 36 deletions Turkey.Tests/CsprojCompatibilityPatcherTest.cs

This file was deleted.

9 changes: 6 additions & 3 deletions Turkey.Tests/ProcessExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ public async Task WaitForExitAsync_DoesNotHangForOrphanedGrandChildren()
const int GrandChildAgeSeconds = 3 * WaitTimeoutSeconds;

string filename = Path.GetTempFileName();
File.Copy(filename, "test.tmp");
string path = "test.tmp";
try
{
// This script creates a 'sleep' grandchild that outlives its parent.
File.WriteAllText(filename,
File.WriteAllText(path,
$@"#!/bin/bash

sleep {GrandChildAgeSeconds} &
");
Process chmodProcess = Process.Start("chmod", $"+x {filename}");
Process chmodProcess = Process.Start("chmod", $"+x {path}");
chmodProcess.WaitForExit();
Assert.Equal(0, chmodProcess.ExitCode);

var psi = new ProcessStartInfo()
{
FileName = filename,
FileName = path,
RedirectStandardOutput = true,
RedirectStandardError = true,
};
Expand All @@ -44,6 +46,7 @@ public async Task WaitForExitAsync_DoesNotHangForOrphanedGrandChildren()
}
finally
{
File.Delete(path);
File.Delete(filename);
}
}
Expand Down
11 changes: 0 additions & 11 deletions Turkey.Tests/SourceBuildTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage messag
}
}

[Fact]
public async Task VerifyProdConFeedIsLookedUpAndThenTheFeedIsVerifiedToResolve()
{
var messageHandler = new ProdConHandler();
var client = new HttpClient(messageHandler);
var sourceBuild = new SourceBuild(client);

var feed = await sourceBuild.GetProdConFeedAsync(Version.Parse("3.1"));

Assert.Equal(FAKE_FEED, feed);
}

[Fact]
public async Task VerifyProdConFeedIsNotUsedForNewReleases()
Expand Down
11 changes: 2 additions & 9 deletions Turkey/CsprojCompatibilityPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ public string Patch(string originalCsprojContents, Version newRuntime)
{
var pattern = @"<TargetFramework>net(?:coreapp)?\d\.\d+</TargetFramework>";
var versionString = newRuntime.MajorMinor;
string replacement = null;
if (newRuntime.Major < 4)
{
replacement = $"<TargetFramework>netcoreapp{versionString}</TargetFramework>";
}
else
{
replacement = $"<TargetFramework>net{versionString}</TargetFramework>";
}
var replacement = $"<TargetFramework>net{versionString}</TargetFramework>";

var output = Regex.Replace(originalCsprojContents, pattern, replacement);

return output;
Expand Down
30 changes: 0 additions & 30 deletions Turkey/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,6 @@ public static async Task<string> GenerateNuGetConfigIfNeededAsync(string additio
var nuget = new NuGet(client);
var sourceBuild = new SourceBuild(client);

if (netCoreAppVersion.Major < 4)
{
try
{
var prodConUrl = await GetProdConFeedUrlIfNeededAsync(nuget, sourceBuild, netCoreAppVersion);
if (!string.IsNullOrEmpty(prodConUrl))
{
prodConUrl = prodConUrl.Trim();
Console.WriteLine($"Packages are not live on nuget.org; using {prodConUrl} as additional package source");
urls.Add(prodConUrl);
}
}
catch (HttpRequestException exception)
{
Console.WriteLine("WARNING: failed to get ProdCon url. Ignoring Exception:");
Console.WriteLine(exception.ToString());
}
}

string nugetConfig = null;
if (useSourceBuildNuGetConfig)
{
Expand Down Expand Up @@ -233,17 +214,6 @@ public static IReadOnlySet<string> CreateTraits(Version runtimeVersion, Version
return traits;
}

public static async Task<string> GetProdConFeedUrlIfNeededAsync(NuGet nuget, SourceBuild sourceBuild, Version netCoreAppVersion)
{
bool live = await nuget.IsPackageLiveAsync("runtime.linux-x64.Microsoft.NetCore.DotNetAppHost", netCoreAppVersion);
if (!live)
{
return await sourceBuild.GetProdConFeedAsync(netCoreAppVersion);
}

return null;
}

static async Task<int> Main(string[] args)
{
var rootCommand = new RootCommand(description: "A test runner for running standalone bash-based or xunit tests");
Expand Down
14 changes: 2 additions & 12 deletions Turkey/SourceBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@ public SourceBuild(HttpClient client)

public string GetBranchContentUrl(Version version)
{
string url;
if (version.Major <= 3)
{
var branchName = "release/" + version.MajorMinor;
url = $"https://raw.githubusercontent.com/dotnet/source-build/{branchName}/";
}
else
{
var branchName = "release/" + version.MajorMinor + ".1xx";
url = $"https://raw.githubusercontent.com/dotnet/installer/{branchName}/";
}

var branchName = "release/" + version.MajorMinor + ".1xx";
var url = $"https://raw.githubusercontent.com/dotnet/installer/{branchName}/";
return url;
}

Expand Down
19 changes: 4 additions & 15 deletions Turkey/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,11 @@ public async Task<TestResult> RunAsync(Action<string> logger, CancellationToken

private void UpdateProjectFilesIfPresent()
{
if (SystemUnderTest.RuntimeVersion < Version.Parse("2.0"))
var csprojFile = $"{Directory.Name}.csproj";
var csprojPath = Path.Combine(this.Directory.FullName, csprojFile);
if (File.Exists(csprojPath))
{
var projectJsonPath = Path.Combine(this.Directory.FullName, "project.json");
if (File.Exists(projectJsonPath))
{
CopyProjectJsonFile();
}
}
else
{
var csprojFile = $"{Directory.Name}.csproj";
var csprojPath = Path.Combine(this.Directory.FullName, csprojFile);
if (File.Exists(csprojPath))
{
UpdateCsprojVersion(csprojPath);
}
UpdateCsprojVersion(csprojPath);
}
}

Expand Down
Loading