From e1f1b4d077e330212cc49570500f0fe1dac769d4 Mon Sep 17 00:00:00 2001 From: nicrowe Date: Tue, 4 Jun 2024 09:31:59 +0100 Subject: [PATCH] Removing .NET 7 from tests, removing outdated tests and increasing timeout-minutes Cleaning up tests by removing references to .NET 7 and removing tests made for older, now unsupported versions of .NET. Also increasing the timeout limit for install .NET and test dependencies due to frequent timeouts on Fedora. --- .github/workflows/ci.yml | 4 +- aspnetpatch-21/test.json | 11 --- aspnetpatch-21/test.sh | 141 ---------------------------- debugging-via-dotnet-dump/test.sh | 20 ++-- extract-bundle-dir/test.json | 11 --- extract-bundle-dir/test.sh | 45 --------- host-probes-rid-assets/test.json | 1 - managed-symbols-available/test.json | 1 - restore-with-rid/test.json | 2 - sha1-validation/test.json | 2 - 10 files changed, 11 insertions(+), 227 deletions(-) delete mode 100644 aspnetpatch-21/test.json delete mode 100755 aspnetpatch-21/test.sh delete mode 100644 extract-bundle-dir/test.json delete mode 100755 extract-bundle-dir/test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d6b7fe..eb3dcdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@v4 - name: Install .NET ${{ matrix.dotnet_version }} - timeout-minutes: 5 + timeout-minutes: 10 run: | set -euo pipefail cat /etc/os-release @@ -65,7 +65,7 @@ jobs: fi - name: Install Test dependencies - timeout-minutes: 2 + timeout-minutes: 5 run: | if grep fedora /etc/os-release ; then dnf install -y python3 wget $(grep '^Dependencies(dnf): ' README.md | cut -d: -f2-) --skip-broken diff --git a/aspnetpatch-21/test.json b/aspnetpatch-21/test.json deleted file mode 100644 index f948c55..0000000 --- a/aspnetpatch-21/test.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "aspnetpatch-21", - "enabled": false, - "requiresSdk": true, - "version": "2.1", - "versionSpecific": true, - "type": "bash", - "cleanup": true, - "ignoredRIDs":[ - ] -} diff --git a/aspnetpatch-21/test.sh b/aspnetpatch-21/test.sh deleted file mode 100755 index 330055a..0000000 --- a/aspnetpatch-21/test.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail -IFS=$'\n\t' -set -x - -# Ensure we have an up-to-date value for latest_aspnet_package. -dotnet_version=$(dotnet --version) -dotnet_version_patch=${dotnet_version##*.} -latest_known_patch=402 -if [[ "$dotnet_version_patch" -le "$latest_known_patch" ]]; then - latest_aspnet_package=2.1.4 -else - echo "Unknown dotnet version ($dotnet_version), please update latest_known_patch and latest_aspnet_package." - exit 1 -fi - -# On RHEL, older sdks are aware of the latest ASP.NET Core version -# by setting LatestPatchVersionForAspNetCore{App,All}2_1 in the scl. -# On other OSes, only the latest sdk is aware of the latest ASP.NET Core version. -sdks=$(dotnet --list-sdks | awk '{print $1}' | sort -ur) -if [[ `grep "Red Hat Enterprise Linux" /etc/redhat-release` ]]; then - if [ "$LatestPatchVersionForAspNetCoreApp2_1" != "$latest_aspnet_package" ]; then - echo "LatestPatchVersionForAspNetCoreApp2_1 is not set to the latest ASP.NET Core version." - exit 1 - fi - if [ "$LatestPatchVersionForAspNetCoreAll2_1" != "$latest_aspnet_package" ]; then - echo "LatestPatchVersionForAspNetCoreAll2_1 is not set to the latest ASP.NET Core version." - exit 1 - fi -else - sdks=(${sdks[0]}) -fi - -test_folder=testapp - -function create_project_for_sdk_and_package() -{ - local sdk=$1 - local package=$2 - - # create folder - rm -rf $test_folder - mkdir $test_folder - - # global.json file - cat >$test_folder/global.json <$test_folder/testapp.csproj < - - \$(TestTargetFramework) - - - - - -EOF - - # Program.cs file - cat >$test_folder/Program.cs < dump.out -# cat dump.out -# grep 'MethodTable:' dump.out | awk '{print $2}' -# string_method_table=$(grep 'MethodTable:' dump.out | awk '{print $2}') -# dump-analyze "dumpmt ${string_method_table}" > dump.out -# cat dump.out -# grep -E '^Name:[ \n\t]+System.String' dump.out -# grep -E "^File:[ \n\t]+${framework_dir}" dump.out - +heading "dumpmt" +dump-analyze 'name2ee *!System.String' > dump.out +cat dump.out +grep 'MethodTable:' dump.out | awk '{print $2}' +string_method_table=$(grep 'MethodTable:' dump.out | awk '{print $2}') +dump-analyze "dumpmt ${string_method_table}" > dump.out +cat dump.out +grep -E '^Name:[ \n\t]+System.String' dump.out +grep -E "^File:[ \n\t]+${framework_dir}" dump.out heading "dumpobj" dump-analyze 'dumpstackobjects' > dump.out diff --git a/extract-bundle-dir/test.json b/extract-bundle-dir/test.json deleted file mode 100644 index 0d36cd0..0000000 --- a/extract-bundle-dir/test.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "extract-bundle-dir", - "enabled": true, - "requiresSdk": true, - "version": "3.1", - "versionSpecific": true, - "type": "bash", - "cleanup": true, - "ignoredRIDs":[ - ] -} diff --git a/extract-bundle-dir/test.sh b/extract-bundle-dir/test.sh deleted file mode 100755 index 0ddc488..0000000 --- a/extract-bundle-dir/test.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -# The profile file sets DOTNET_BUNDLE_EXTRACT_BASE_DIR to avoid multi-user issues. -# see: https://bugzilla.redhat.com/show_bug.cgi?id=1752350. -if [ -f /etc/profile ]; then - source /etc/profile -fi - -set -euo pipefail -IFS=$'\n\t' - -# Verify DOTNET_BUNDLE_EXTRACT_BASE_DIR is set. -if [[ "${DOTNET_BUNDLE_EXTRACT_BASE_DIR:-}" != "$HOME/.cache/dotnet_bundle_extract" ]]; then - echo "error: DOTNET_BUNDLE_EXTRACT_BASE_DIR is '${DOTNET_BUNDLE_EXTRACT_BASE_DIR:-}', expected '${HOME:-}/.cache/dotnet_bundle_extract'" - echo "\$HOME: ${HOME:-}" - echo "\$PWD: ${PWD:-}" - echo "\$XDG_CACHE_HOME: ${XDG_CACHE_HOME:-}" - echo "\$DOTNET_BUNDLE_EXTRACT_BASE_DIR: ${DOTNET_BUNDLE_EXTRACT_BASE_DIR:-}" - exit 1 -else - echo "info: DOTNET_BUNDLE_EXTRACT_BASE_DIR is $DOTNET_BUNDLE_EXTRACT_BASE_DIR." -fi - -APP_NAME=extract-bundle-app -APP_EXTRACT_DIR=$DOTNET_BUNDLE_EXTRACT_BASE_DIR/$APP_NAME - -# Clean up the extract dir. -rm -rf $APP_EXTRACT_DIR - -# Create a single file executable. -dotnet new console -o $APP_NAME -sed -E -i '/Console.WriteLine/ a Console.WriteLine(AppContext.BaseDirectory);' $APP_NAME/Program.cs -dotnet publish -r $(../runtime-id --portable) /p:PublishSingleFile=true $APP_NAME -o published - -# Execute the single file, which will cause it to extract. -./published/$APP_NAME - -# Verify the single file exe was extracted. -if [ -d "$APP_EXTRACT_DIR" ]; then - echo "info: Application was extracted to expected location: $APP_EXTRACT_DIR" - rm -rf $APP_EXTRACT_DIR -else - echo "error: Application was not found at expected location: $APP_EXTRACT_DIR" - exit 1 -fi diff --git a/host-probes-rid-assets/test.json b/host-probes-rid-assets/test.json index 950884b..b8b1adc 100644 --- a/host-probes-rid-assets/test.json +++ b/host-probes-rid-assets/test.json @@ -8,7 +8,6 @@ "cleanup": true, "skipWhen": [ "os=alpine,version=6", // see https://github.com/redhat-developer/dotnet-regular-tests/pull/303#issuecomment-1755727884 - "os=alpine,version=7", ], "ignoredRIDs":[ ] diff --git a/managed-symbols-available/test.json b/managed-symbols-available/test.json index 28938da..1bc64ab 100644 --- a/managed-symbols-available/test.json +++ b/managed-symbols-available/test.json @@ -8,7 +8,6 @@ "cleanup": true, "skipWhen": [ "vmr-ci,version=6", // unpacking symbols is a hassle - "vmr-ci,version=7", "non-packaged", ], "ignoredRIDs":[ diff --git a/restore-with-rid/test.json b/restore-with-rid/test.json index 74caf9e..6b64842 100644 --- a/restore-with-rid/test.json +++ b/restore-with-rid/test.json @@ -8,8 +8,6 @@ "cleanup": true, "skipWhen":[ "version=6,arch=s390x", // no runtime pack available - "version=7,arch=s390x", - "version=7,arch=ppc64le" ], "ignoredRIDs":[ ] diff --git a/sha1-validation/test.json b/sha1-validation/test.json index b9718d9..025f572 100644 --- a/sha1-validation/test.json +++ b/sha1-validation/test.json @@ -7,8 +7,6 @@ "type": "bash", "cleanup": true, "skipWhen": [ - "os=rhel.9,version=7", // Test fails on RHEL9 with .NET 7: https://issues.redhat.com/browse/RHEL-25254 - "os=centos.9,version=7", // Test fails on RHEL9 with .NET 7: https://issues.redhat.com/browse/RHEL-25254 ], "ignoredRIDs":[ ]