From c5d1901cccf64abaec71a3228882b1d543ddc1be Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 08:07:17 +0000 Subject: [PATCH 1/7] Dotnet EOL 6.0 changes --- src/dotnet/devcontainer-feature.json | 3 +-- test/dotnet/scenarios.json | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dotnet/devcontainer-feature.json b/src/dotnet/devcontainer-feature.json index f6e0c39ab..b678b1303 100644 --- a/src/dotnet/devcontainer-feature.json +++ b/src/dotnet/devcontainer-feature.json @@ -12,8 +12,7 @@ "lts", "none", "8.0", - "7.0", - "6.0" + "7.0" ], "default": "latest", "description": "Select or enter a .NET SDK version. Use 'latest' for the latest version, 'lts' for the latest LTS version, 'X.Y' or 'X.Y.Z' for a specific version." diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json index 2fd74f587..6f4b4732f 100644 --- a/test/dotnet/scenarios.json +++ b/test/dotnet/scenarios.json @@ -13,7 +13,7 @@ "remoteUser": "vscode", "features": { "dotnet": { - "version": "3.1" + "version": "8.0" } } }, @@ -22,7 +22,7 @@ "remoteUser": "vscode", "features": { "dotnet": { - "version": "5.0.3xx" + "version": "8.0.0xx" } } }, @@ -42,8 +42,7 @@ "dotnet": { "version": "8.0.100-preview.6.23330.14", "additionalVersions": [ - "7.0", - "6.0" + "7.0" ] } } From 064b8066f57aa3599ff70cf8ad3b180c6f2eaf12 Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 08:22:38 +0000 Subject: [PATCH 2/7] Changing the dotnet version in test --- test/dotnet/scenarios.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json index 6f4b4732f..a87528010 100644 --- a/test/dotnet/scenarios.json +++ b/test/dotnet/scenarios.json @@ -22,7 +22,7 @@ "remoteUser": "vscode", "features": { "dotnet": { - "version": "8.0.0xx" + "version": "8.0.100-preview.6.23330.14" } } }, From 675952b16d872e054c00029b0644938303686201 Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 08:29:02 +0000 Subject: [PATCH 3/7] Reverting back some test changes --- test/dotnet/scenarios.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet/scenarios.json b/test/dotnet/scenarios.json index a87528010..fb0b4ce0b 100644 --- a/test/dotnet/scenarios.json +++ b/test/dotnet/scenarios.json @@ -13,7 +13,7 @@ "remoteUser": "vscode", "features": { "dotnet": { - "version": "8.0" + "version": "3.1" } } }, From e01c9adebc0986033c92dbe003e026471ff7af3c Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 08:53:22 +0000 Subject: [PATCH 4/7] To check tests --- test/dotnet/install_dotnet_exact_version.sh | 2 +- ...all_dotnet_latest_when_version_is_empty.sh | 2 +- test/dotnet/install_dotnet_lts.sh | 2 +- .../install_dotnet_multiple_versions.sh | 3 -- ...otnet_specific_release_and_feature_band.sh | 8 ++--- test/dotnet/projects/net9.0/Program.cs | 32 +++++++++++++++++++ .../projects/net9.0/example_project.csproj | 14 ++++++++ test/dotnet/test.sh | 2 +- 8 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 test/dotnet/projects/net9.0/Program.cs create mode 100644 test/dotnet/projects/net9.0/example_project.csproj mode change 100644 => 100755 test/dotnet/test.sh diff --git a/test/dotnet/install_dotnet_exact_version.sh b/test/dotnet/install_dotnet_exact_version.sh index ec89f3b8d..1fd49a14f 100644 --- a/test/dotnet/install_dotnet_exact_version.sh +++ b/test/dotnet/install_dotnet_exact_version.sh @@ -17,7 +17,7 @@ check ".NET SDK 8.0.100-preview.6.23330.14 installed" \ is_dotnet_sdk_version_installed "8.0.100-preview.6.23330.14" check "Build and run example project" \ -dotnet run --project projects/net8.0 +dotnet run --project projects/net9.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_latest_when_version_is_empty.sh b/test/dotnet/install_dotnet_latest_when_version_is_empty.sh index cd23edcf1..320a08b5b 100644 --- a/test/dotnet/install_dotnet_latest_when_version_is_empty.sh +++ b/test/dotnet/install_dotnet_latest_when_version_is_empty.sh @@ -19,7 +19,7 @@ check "Latest .NET SDK version installed" \ is_dotnet_sdk_version_installed "$expected" check "Build and run example project" \ -dotnet run --project projects/net8.0 +dotnet run --project projects/net9.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_lts.sh b/test/dotnet/install_dotnet_lts.sh index bc2d40782..1568fdf30 100644 --- a/test/dotnet/install_dotnet_lts.sh +++ b/test/dotnet/install_dotnet_lts.sh @@ -19,7 +19,7 @@ check "Latest LTS version installed" \ is_dotnet_sdk_version_installed "$expected" check "Build and run example project" \ -dotnet run --project projects/net8.0 +dotnet run --project projects/net9.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_multiple_versions.sh b/test/dotnet/install_dotnet_multiple_versions.sh index 5f0f12533..e25123339 100644 --- a/test/dotnet/install_dotnet_multiple_versions.sh +++ b/test/dotnet/install_dotnet_multiple_versions.sh @@ -19,9 +19,6 @@ is_dotnet_sdk_version_installed "8.0" check ".NET SDK 7.0 installed" \ is_dotnet_sdk_version_installed "7.0" -check ".NET SDK 6.0 installed" \ -is_dotnet_sdk_version_installed "6.0" - check "Build example class library" \ dotnet build projects/multitargeting diff --git a/test/dotnet/install_dotnet_specific_release_and_feature_band.sh b/test/dotnet/install_dotnet_specific_release_and_feature_band.sh index 51f5c582b..5262c529d 100644 --- a/test/dotnet/install_dotnet_specific_release_and_feature_band.sh +++ b/test/dotnet/install_dotnet_specific_release_and_feature_band.sh @@ -13,11 +13,11 @@ source dev-container-features-test-lib source dotnet_env.sh source dotnet_helpers.sh -check ".NET SDK 5.0.3xx installed" \ -is_dotnet_sdk_version_installed "5.0.3" +#check ".NET SDK 5.0.3xx installed" \ +#is_dotnet_sdk_version_installed "5.0.3" -check "Build and run example project" \ -dotnet run --project projects/net5.0 +#check "Build and run example project" \ +#dotnet run --project projects/net5.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/projects/net9.0/Program.cs b/test/dotnet/projects/net9.0/Program.cs new file mode 100644 index 000000000..690a54eef --- /dev/null +++ b/test/dotnet/projects/net9.0/Program.cs @@ -0,0 +1,32 @@ +using Newtonsoft.Json; + +string json = """ +{ + "Name": "Inception", + "ReleaseDate": "2010-07-08T00:00:00", + "Genres": [ + "Action", + "Thriller" + ] +} +"""; + +Movie? m = JsonConvert.DeserializeObject(json); + +if (m == default) +{ + Console.WriteLine("Decoding failed!"); +} +else +{ + Console.WriteLine($"Movie name: {m.Name}"); + Console.WriteLine($"Release Date: {m.ReleaseDate}"); + Console.WriteLine($"Genres: {string.Join(", ", m.Genres)}"); +} + +class Movie +{ + public string Name { get; set; } = "Default Name"; + public DateTime ReleaseDate { get; set; } + public List Genres { get; set; } = new List(); +} diff --git a/test/dotnet/projects/net9.0/example_project.csproj b/test/dotnet/projects/net9.0/example_project.csproj new file mode 100644 index 000000000..5f6bba784 --- /dev/null +++ b/test/dotnet/projects/net9.0/example_project.csproj @@ -0,0 +1,14 @@ + + + + Exe + net9.0 + enable + enable + + + + + + + \ No newline at end of file diff --git a/test/dotnet/test.sh b/test/dotnet/test.sh old mode 100644 new mode 100755 index 50d79941f..12edf4ba1 --- a/test/dotnet/test.sh +++ b/test/dotnet/test.sh @@ -25,7 +25,7 @@ check "Latest .NET SDK version installed" \ is_dotnet_sdk_version_installed "$expected" check "Build and run example project" \ -dotnet run --project projects/net8.0 +dotnet run --project projects/net9.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. From b4eae7e6c457289b4c996b2f0aa1c532786a6adb Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 09:04:27 +0000 Subject: [PATCH 5/7] Reverting some test changes --- test/dotnet/install_dotnet_exact_version.sh | 2 +- test/dotnet/install_dotnet_lts.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dotnet/install_dotnet_exact_version.sh b/test/dotnet/install_dotnet_exact_version.sh index 1fd49a14f..ec89f3b8d 100644 --- a/test/dotnet/install_dotnet_exact_version.sh +++ b/test/dotnet/install_dotnet_exact_version.sh @@ -17,7 +17,7 @@ check ".NET SDK 8.0.100-preview.6.23330.14 installed" \ is_dotnet_sdk_version_installed "8.0.100-preview.6.23330.14" check "Build and run example project" \ -dotnet run --project projects/net9.0 +dotnet run --project projects/net8.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/test/dotnet/install_dotnet_lts.sh b/test/dotnet/install_dotnet_lts.sh index 1568fdf30..bc2d40782 100644 --- a/test/dotnet/install_dotnet_lts.sh +++ b/test/dotnet/install_dotnet_lts.sh @@ -19,7 +19,7 @@ check "Latest LTS version installed" \ is_dotnet_sdk_version_installed "$expected" check "Build and run example project" \ -dotnet run --project projects/net9.0 +dotnet run --project projects/net8.0 # Report results # If any of the checks above exited with a non-zero exit code, the test will fail. From 68ae7cb8c9c820c5ab519b039d14ced7bfc4103d Mon Sep 17 00:00:00 2001 From: Kaniska244 Date: Tue, 17 Dec 2024 10:19:28 +0000 Subject: [PATCH 6/7] Added test to see if dotnet 6.0 still works --- .../install_dotnet_multiple_versions.sh | 3 +++ test/dotnet/install_dotnet_six.sh | 27 +++++++++++++++++++ test/dotnet/scenarios.json | 12 ++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/dotnet/install_dotnet_six.sh diff --git a/test/dotnet/install_dotnet_multiple_versions.sh b/test/dotnet/install_dotnet_multiple_versions.sh index e25123339..5f0f12533 100644 --- a/test/dotnet/install_dotnet_multiple_versions.sh +++ b/test/dotnet/install_dotnet_multiple_versions.sh @@ -19,6 +19,9 @@ is_dotnet_sdk_version_installed "8.0" check ".NET SDK 7.0 installed" \ is_dotnet_sdk_version_installed "7.0" +check ".NET SDK 6.0 installed" \ +is_dotnet_sdk_version_installed "6.0" + check "Build example class library" \ dotnet build projects/multitargeting diff --git a/test/dotnet/install_dotnet_six.sh b/test/dotnet/install_dotnet_six.sh new file mode 100644 index 000000000..225cc7c1b --- /dev/null +++ b/test/dotnet/install_dotnet_six.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib +# Provides the 'check' and 'reportResults' commands. +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. Syntax is... +# check