From cfacdf592475f30d264e44e57f2ab527376d8b9b Mon Sep 17 00:00:00 2001 From: Mohamed Elasmar <71043312+moelasmar@users.noreply.github.com> Date: Wed, 21 Jun 2023 14:10:47 -0700 Subject: [PATCH] chore: remove deprecated runtime dotnetcore3.1 (#5091) * chore: remove deprecated runtime dotnetcore3.1 * apply pr comments --- .gitignore | 6 --- designs/build_debug_artifacts.md | 2 +- designs/sam_build_cmd.md | 2 +- samcli/commands/build/command.py | 2 +- samcli/commands/init/init_templates.py | 8 ++-- samcli/lib/build/constants.py | 1 + samcli/lib/build/workflow_config.py | 1 - samcli/lib/init/local_manifest.json | 2 +- .../cookiecutter.json | 2 +- .../src/HelloWorld/HelloWorld.csproj | 4 -- .../HelloWorld/aws-lambda-tools-defaults.json | 3 -- .../template.yaml | 4 +- .../HelloWorld.Test/HelloWorld.Tests.csproj | 4 +- samcli/lib/utils/architecture.py | 1 - samcli/local/common/runtime_template.py | 8 ++-- samcli/local/docker/lambda_debug_settings.py | 4 -- samcli/local/docker/lambda_image.py | 3 +- tests/integration/buildcmd/test_build_cmd.py | 35 ++------------- .../buildcmd/Dotnetcore3.1/HelloWorld.csproj | 16 ------- .../buildcmd/Dotnetcore3.1/Program.cs | 44 ------------------- .../aws-lambda-tools-defaults.json | 19 -------- .../inprocess/dotnet/STS/STS.csproj | 2 +- .../credential_tests/inprocess/template.yaml | 2 +- tests/unit/commands/init/test_cli.py | 12 +++-- tests/unit/commands/init/test_manifest.json | 4 +- .../unit/lib/build_module/test_app_builder.py | 4 +- .../lib/build_module/test_build_strategy.py | 2 +- .../lib/build_module/test_workflow_config.py | 2 +- tests/unit/lib/utils/test_architecture.py | 2 +- .../local/docker/test_lambda_container.py | 3 +- .../docker/test_lambda_debug_settings.py | 1 - tests/unit/local/docker/test_lambda_image.py | 1 - 32 files changed, 37 insertions(+), 169 deletions(-) delete mode 100644 tests/integration/testdata/buildcmd/Dotnetcore3.1/HelloWorld.csproj delete mode 100644 tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs delete mode 100644 tests/integration/testdata/buildcmd/Dotnetcore3.1/aws-lambda-tools-defaults.json diff --git a/.gitignore b/.gitignore index 05b0da72bd..6b3c26c6e5 100644 --- a/.gitignore +++ b/.gitignore @@ -412,12 +412,6 @@ coverage.xml # Temporary scratch directory used by the tests tests/integration/buildcmd/scratch -tests/integration/testdata/buildcmd/Dotnetcore2.0/bin -tests/integration/testdata/buildcmd/Dotnetcore2.0/obj -tests/integration/testdata/buildcmd/Dotnetcore2.1/bin -tests/integration/testdata/buildcmd/Dotnetcore2.1/obj -tests/integration/testdata/buildcmd/Dotnetcore3.1/bin -tests/integration/testdata/buildcmd/Dotnetcore3.1/obj tests/integration/testdata/buildcmd/Dotnet6/bin tests/integration/testdata/buildcmd/Dotnet6/obj tests/integration/testdata/buildcmd/Dotnet7/bin diff --git a/designs/build_debug_artifacts.md b/designs/build_debug_artifacts.md index 01ba532f9e..b839ba6be2 100644 --- a/designs/build_debug_artifacts.md +++ b/designs/build_debug_artifacts.md @@ -16,7 +16,7 @@ We will introduce a way in `sam build` to produce these debuggable artifacts for Success criteria for the change ------------------------------- -1. Artifacts generated will be debuggable for runtimes DotNetCore 2.0 and above. +1. Artifacts generated will be debuggable for runtimes DotNet 6.0 and above. Out-of-Scope ------------ diff --git a/designs/sam_build_cmd.md b/designs/sam_build_cmd.md index bb6c7cbacb..cb288ddf44 100644 --- a/designs/sam_build_cmd.md +++ b/designs/sam_build_cmd.md @@ -494,7 +494,7 @@ build actions. This section will look like: "build": { "actions": { "java8": "gradle build", - "dotnetcore2.1": "./build.sh" + "dotnet6": "./build.sh" } } } diff --git a/samcli/commands/build/command.py b/samcli/commands/build/command.py index b8ba89052a..92a2c6578c 100644 --- a/samcli/commands/build/command.py +++ b/samcli/commands/build/command.py @@ -54,7 +54,7 @@ 2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n 3. Ruby 2.7, 3.2 using Bundler\n 4. Java 8, Java 11, Java 17 using Gradle and Maven\n - 5. Dotnetcore 3.1, Dotnet6 using Dotnet CLI (without --use-container)\n + 5. Dotnet6 using Dotnet CLI (without --use-container)\n 6. Go 1.x using Go Modules (without --use-container)\n """ diff --git a/samcli/commands/init/init_templates.py b/samcli/commands/init/init_templates.py index 9452faaa4d..c11998c543 100644 --- a/samcli/commands/init/init_templates.py +++ b/samcli/commands/init/init_templates.py @@ -211,17 +211,17 @@ def get_preprocessed_manifest( """ This method get the manifest cloned from the git repo and preprocessed it. Below is the link to manifest: - https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest.json + https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest-v2.json The structure of the manifest is shown below: { - "dotnetcore3.1": [ + "dotnet6": [ { - "directory": "dotnetcore3.1/cookiecutter-aws-sam-hello-dotnet", + "directory": "dotnet6/hello", "displayName": "Hello World Example", "dependencyManager": "cli-package", "appTemplate": "hello-world", "packageType": "Zip", - "useCaseName": "Serverless API" + "useCaseName": "Hello World Example" }, ] } diff --git a/samcli/lib/build/constants.py b/samcli/lib/build/constants.py index 77869c27cf..c7c4a3b94d 100644 --- a/samcli/lib/build/constants.py +++ b/samcli/lib/build/constants.py @@ -10,6 +10,7 @@ "nodejs10.x", "dotnetcore2.0", "dotnetcore2.1", + "dotnetcore3.1", "python2.7", "python3.6", "ruby2.5", diff --git a/samcli/lib/build/workflow_config.py b/samcli/lib/build/workflow_config.py index 39ea1acad7..b9ac751aed 100644 --- a/samcli/lib/build/workflow_config.py +++ b/samcli/lib/build/workflow_config.py @@ -161,7 +161,6 @@ def get_workflow_config( "nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG), "ruby2.7": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG), "ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG), - "dotnetcore3.1": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG), "dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG), "go1.x": BasicWorkflowSelector(GO_MOD_CONFIG), # When Maven builder exists, add to this list so we can automatically choose a builder based on the supported diff --git a/samcli/lib/init/local_manifest.json b/samcli/lib/init/local_manifest.json index 38b95dc3be..462d8d4a8f 100644 --- a/samcli/lib/init/local_manifest.json +++ b/samcli/lib/init/local_manifest.json @@ -1,5 +1,5 @@ { - "dotnetcore3.1": [ + "dotnet6": [ { "directory": "template/cookiecutter-aws-sam-hello-dotnet", "displayName": "Hello World Example", diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/cookiecutter.json b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/cookiecutter.json index 9bf09d0306..19b21add11 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/cookiecutter.json +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": "dotnetcore3.1", + "runtime": "dotnet6", "architectures": { "value": [ "x86_64" diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj index 0749a6fd85..8926242ef3 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj @@ -1,11 +1,7 @@ - {%- if cookiecutter.runtime == 'dotnetcore3.1' %} - netcoreapp3.1 - {%- else %} net6.0 - {%- endif %} true diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/aws-lambda-tools-defaults.json b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/aws-lambda-tools-defaults.json index 34ae747e11..fd910bc628 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/aws-lambda-tools-defaults.json +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/aws-lambda-tools-defaults.json @@ -11,9 +11,6 @@ "profile":"", "region" : "", "configuration": "Release", - {%- if cookiecutter.runtime == 'dotnetcore3.1' %} - "framework" : "netcoreapp3.1", - {%- endif %} "function-runtime":"{{ cookiecutter.runtime }}", "function-memory-size" : 256, "function-timeout" : 30, diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/template.yaml b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/template.yaml index 4bcfaa9d43..3450d2620e 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/template.yaml +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/template.yaml @@ -14,8 +14,8 @@ Resources: Properties: CodeUri: ./src/HelloWorld/ Handler: HelloWorld::HelloWorld.Function::FunctionHandler - {%- if cookiecutter.runtime == 'dotnetcore3.1' %} - Runtime: dotnetcore3.1 + {%- if cookiecutter.runtime == 'dotnet6' %} + Runtime: dotnet6 {%- endif %} Architectures: {%- for arch in cookiecutter.architectures.value %} diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/test/HelloWorld.Test/HelloWorld.Tests.csproj b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/test/HelloWorld.Test/HelloWorld.Tests.csproj index 1c2b1f32e2..998671f9e5 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/test/HelloWorld.Test/HelloWorld.Tests.csproj +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/test/HelloWorld.Test/HelloWorld.Tests.csproj @@ -1,9 +1,7 @@ - {%- if cookiecutter.runtime == 'dotnetcore3.1' %} - netcoreapp3.1 - {%- else %} + {%- if cookiecutter.runtime == 'dotnet6' %} net6.0 {%- endif %} diff --git a/samcli/lib/utils/architecture.py b/samcli/lib/utils/architecture.py index 470754b2c1..a8025d8b3f 100644 --- a/samcli/lib/utils/architecture.py +++ b/samcli/lib/utils/architecture.py @@ -29,7 +29,6 @@ "java11": [ARM64, X86_64], "java17": [ARM64, X86_64], "go1.x": [X86_64], - "dotnetcore3.1": [ARM64, X86_64], "dotnet6": [ARM64, X86_64], "provided": [X86_64], "provided.al2": [ARM64, X86_64], diff --git a/samcli/local/common/runtime_template.py b/samcli/local/common/runtime_template.py index 85eb282a90..697631adea 100644 --- a/samcli/local/common/runtime_template.py +++ b/samcli/local/common/runtime_template.py @@ -40,7 +40,7 @@ ], "dotnet": [ { - "runtimes": ["dotnet6", "dotnetcore3.1"], + "runtimes": ["dotnet6"], "dependency_manager": "cli-package", "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-dotnet"), "build": True, @@ -96,9 +96,8 @@ def get_local_lambda_images_location(mapping, runtime): # When adding new Lambda runtimes, please update SAM_RUNTIME_TO_SCHEMAS_CODE_LANG_MAPPING # Runtimes are ordered in alphabetical fashion with reverse version order (latest versions first) INIT_RUNTIMES = [ - # dotnetcore runtimes in descending order + # dotnet runtimes in descending order "dotnet6", - "dotnetcore3.1", "go1.x", # java runtimes in descending order "java17", @@ -126,7 +125,6 @@ def get_local_lambda_images_location(mapping, runtime): LAMBDA_IMAGES_RUNTIMES_MAP = { "dotnet6": "amazon/dotnet6-base", - "dotnetcore3.1": "amazon/dotnetcore3.1-base", "go1.x": "amazon/go1.x-base", "go (provided.al2)": "amazon/go-provided.al2-base", "java17": "amazon/java17-base", @@ -158,7 +156,7 @@ def get_local_lambda_images_location(mapping, runtime): "python3.8": "Python36", "python3.9": "Python36", "python3.10": "Python36", - "dotnet6": "dotnetcore3.1", + "dotnet6": "dotnet6", "go1.x": "Go1", } diff --git a/samcli/local/docker/lambda_debug_settings.py b/samcli/local/docker/lambda_debug_settings.py index 856717be99..8bffc6a3e2 100644 --- a/samcli/local/docker/lambda_debug_settings.py +++ b/samcli/local/docker/lambda_debug_settings.py @@ -93,10 +93,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime **_container_env_vars, }, ), - Runtime.dotnetcore31.value: lambda: DebugSettings( - entry + ["/var/runtime/bootstrap"] + debug_args_list, - container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars}, - ), Runtime.dotnet6.value: lambda: DebugSettings( entry + ["/var/runtime/bootstrap"] + debug_args_list, container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars}, diff --git a/samcli/local/docker/lambda_image.py b/samcli/local/docker/lambda_image.py index 285e1b81e7..23f0a770d9 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -46,7 +46,6 @@ class Runtime(Enum): java11 = "java11" java17 = "java17" go1x = "go1.x" - dotnetcore31 = "dotnetcore3.1" dotnet6 = "dotnet6" provided = "provided" providedal2 = "provided.al2" @@ -86,7 +85,7 @@ def get_image_name_tag(cls, runtime: str, architecture: str) -> str: # `provided.al2` becomes `provided:al2`` runtime_image_tag = runtime.replace(".", ":") elif runtime.startswith("dotnet"): - # dotnetcore3.1 becomes dotnet:core3.1 and dotnet6 becomes dotnet:6 + # dotnet6 becomes dotnet:6 runtime_image_tag = runtime.replace("dotnet", "dotnet:") else: # This fits most runtimes format: `nameN.M` becomes `name:N.M` (python3.9 -> python:3.9) diff --git a/tests/integration/buildcmd/test_build_cmd.py b/tests/integration/buildcmd/test_build_cmd.py index 1a22c9cbb7..2b35d7c6e9 100644 --- a/tests/integration/buildcmd/test_build_cmd.py +++ b/tests/integration/buildcmd/test_build_cmd.py @@ -1223,15 +1223,13 @@ class TestBuildCommand_Dotnet_cli_package(BuildIntegBase): @parameterized.expand( [ - ("dotnetcore3.1", "Dotnetcore3.1", None), ("dotnet6", "Dotnet6", None), - ("dotnetcore3.1", "Dotnetcore3.1", "debug"), ("dotnet6", "Dotnet6", "debug"), ("provided.al2", "Dotnet7", None), ] ) @pytest.mark.flaky(reruns=3) - def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_64"): + def test_dotnet_in_process(self, runtime, code_uri, mode, architecture="x86_64"): # dotnet7 requires docker to build the function if code_uri == "Dotnet7" and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD): self.skipTest(SKIP_DOCKER_MESSAGE) @@ -1294,9 +1292,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_ @parameterized.expand( [ - ("dotnetcore3.1", "Dotnetcore3.1", None), ("dotnet6", "Dotnet6", None), - ("dotnetcore3.1", "Dotnetcore3.1", "debug"), ("dotnet6", "Dotnet6", "debug"), # force to run tests on arm64 machines may cause dotnet7 test failing # because Native AOT Lambda functions require the host and lambda architectures to match @@ -1305,7 +1301,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_ ) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) @pytest.mark.flaky(reruns=3) - def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"): + def test_dotnet_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"): overrides = { "Runtime": runtime, "CodeUri": code_uri, @@ -1368,9 +1364,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u @parameterized.expand( [ - ("dotnetcore3.1", "Dotnetcore3.1", None), ("dotnet6", "Dotnet6", None), - ("dotnetcore3.1", "Dotnetcore3.1", "debug"), ("dotnet6", "Dotnet6", "debug"), # force to run tests on arm64 machines may cause dotnet7 test failing # because Native AOT Lambda functions require the host and lambda architectures to match @@ -1379,7 +1373,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u ) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) @pytest.mark.flaky(reruns=3) - def test_dotnetcore_in_container_mount_with_write_interactive( + def test_dotnet_in_container_mount_with_write_interactive( self, runtime, code_uri, @@ -1444,7 +1438,7 @@ def test_dotnetcore_in_container_mount_with_write_interactive( ) self.verify_docker_container_cleanedup(runtime) - @parameterized.expand([("dotnetcore3.1", "Dotnetcore3.1"), ("dotnet6", "Dotnet6")]) + @parameterized.expand([("dotnet6", "Dotnet6")]) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) @pytest.mark.flaky(reruns=3) def test_must_fail_on_container_mount_without_write_interactive(self, runtime, code_uri): @@ -2045,13 +2039,6 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase): @parameterized.expand( [ # in process - ( - False, - "Dotnetcore3.1", - "HelloWorld::HelloWorld.FirstFunction::FunctionHandler", - "HelloWorld::HelloWorld.SecondFunction::FunctionHandler", - "dotnetcore3.1", - ), ( False, "Dotnet6", @@ -2177,13 +2164,6 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase): @parameterized.expand( [ # in process - ( - False, - "Dotnetcore3.1", - "HelloWorld::HelloWorld.FirstFunction::FunctionHandler", - "HelloWorld::HelloWorld.SecondFunction::FunctionHandler", - "dotnetcore3.1", - ), ( False, "Dotnet6", @@ -2366,13 +2346,6 @@ class TestParallelBuilds(DedupBuildIntegBase): @parameterized.expand( [ # in process - ( - False, - "Dotnetcore3.1", - "HelloWorld::HelloWorld.FirstFunction::FunctionHandler", - "HelloWorld::HelloWorld.SecondFunction::FunctionHandler", - "dotnetcore3.1", - ), ( False, "Dotnet6", diff --git a/tests/integration/testdata/buildcmd/Dotnetcore3.1/HelloWorld.csproj b/tests/integration/testdata/buildcmd/Dotnetcore3.1/HelloWorld.csproj deleted file mode 100644 index b795d281f0..0000000000 --- a/tests/integration/testdata/buildcmd/Dotnetcore3.1/HelloWorld.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp3.1 - true - - - - - - - - - - - diff --git a/tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs b/tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs deleted file mode 100644 index b7dc35f8f6..0000000000 --- a/tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Net.Http; -using System.Net.Http.Headers; -using Newtonsoft.Json; - -using Amazon.Lambda.Core; -using Amazon.Lambda.APIGatewayEvents; - -// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. -[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] - -namespace HelloWorld -{ - - public class Function - { - - public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context) - { - return "{'message': 'Hello World'}"; - } - } - - public class FirstFunction - { - - public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context) - { - return "Hello World"; - } - } - - public class SecondFunction - { - - public string FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context) - { - return "Hello Mars"; - } - } -} diff --git a/tests/integration/testdata/buildcmd/Dotnetcore3.1/aws-lambda-tools-defaults.json b/tests/integration/testdata/buildcmd/Dotnetcore3.1/aws-lambda-tools-defaults.json deleted file mode 100644 index 89bbd11cf2..0000000000 --- a/tests/integration/testdata/buildcmd/Dotnetcore3.1/aws-lambda-tools-defaults.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Information" : [ - "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", - "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", - - "dotnet lambda help", - - "All the command line options for the Lambda command can be specified in this file." - ], - - "profile":"", - "region" : "", - "configuration": "Release", - "framework": "netcoreapp3.1", - "function-runtime":"dotnetcore3.1", - "function-memory-size" : 256, - "function-timeout" : 30, - "function-handler" : "HelloWorld::HelloWorld.Function::FunctionHandler" -} diff --git a/tests/integration/testdata/invoke/credential_tests/inprocess/dotnet/STS/STS.csproj b/tests/integration/testdata/invoke/credential_tests/inprocess/dotnet/STS/STS.csproj index 95f1ecee69..148daf168b 100644 --- a/tests/integration/testdata/invoke/credential_tests/inprocess/dotnet/STS/STS.csproj +++ b/tests/integration/testdata/invoke/credential_tests/inprocess/dotnet/STS/STS.csproj @@ -1,7 +1,7 @@ - netcoreapp2.1 + net6.0 true diff --git a/tests/integration/testdata/invoke/credential_tests/inprocess/template.yaml b/tests/integration/testdata/invoke/credential_tests/inprocess/template.yaml index d5b0c32de6..41147cf58c 100644 --- a/tests/integration/testdata/invoke/credential_tests/inprocess/template.yaml +++ b/tests/integration/testdata/invoke/credential_tests/inprocess/template.yaml @@ -13,7 +13,7 @@ Resources: Properties: CodeUri: dotnet/STS Handler: STS::STS.Function::FunctionHandler - Runtime: dotnetcore3.1 + Runtime: dotnet6 GoStsExample: Type: AWS::Serverless::Function Properties: diff --git a/tests/unit/commands/init/test_cli.py b/tests/unit/commands/init/test_cli.py index 65ff97a31b..15c892a114 100644 --- a/tests/unit/commands/init/test_cli.py +++ b/tests/unit/commands/init/test_cli.py @@ -2119,7 +2119,6 @@ def test_init_cli_must_not_generate_default_hello_world_app( def test_must_return_runtime_from_base_image_name(self): base_images = [ "amazon/dotnet6-base", - "amazon/dotnetcore3.1-base", "amazon/go1.x-base", "amazon/java11-base", "amazon/nodejs14.x-base", @@ -2131,7 +2130,6 @@ def test_must_return_runtime_from_base_image_name(self): expected_runtime = [ "dotnet6", - "dotnetcore3.1", "go1.x", "java11", "nodejs14.x", @@ -2153,10 +2151,10 @@ def test_must_process_manifest(self, _get_manifest_mock): preprocess_manifest = template.get_preprocessed_manifest() expected_result = { "Hello World Example": { - "dotnetcore3.1": { + "dotnet6": { "Zip": [ { - "directory": "dotnetcore3.1/cookiecutter-aws-sam-hello-dotnet", + "directory": "dotnet6/cookiecutter-aws-sam-hello-dotnet", "displayName": "Hello World Example", "dependencyManager": "cli-package", "appTemplate": "hello-world", @@ -2788,9 +2786,9 @@ def test_init_cli_generate_app_template_from_local_cli_templates( @patch("samcli.local.common.runtime_template.INIT_RUNTIMES") def test_must_remove_unsupported_runtime(self, init_runtime_mock): - runtime_option_list = ["python3.7", "ruby3.2", "ruby2.7", "java11", "unsupported_runtime", "dotnetcore3.1"] - init_runtime_mock.return_value = ["dotnetcore3.1", "go1.x", "java11", "python3.7", "ruby3.2", "ruby2.7"] - expect_result = ["dotnetcore3.1", "java11", "python3.7", "ruby3.2", "ruby2.7"] + runtime_option_list = ["python3.7", "ruby3.2", "ruby2.7", "java11", "unsupported_runtime"] + init_runtime_mock.return_value = ["go1.x", "java11", "python3.7", "ruby3.2", "ruby2.7"] + expect_result = ["java11", "python3.7", "ruby3.2", "ruby2.7"] actual_result = get_sorted_runtimes(runtime_option_list) self.assertEqual(actual_result, expect_result) diff --git a/tests/unit/commands/init/test_manifest.json b/tests/unit/commands/init/test_manifest.json index 0ae5edf30f..7ae51a146b 100644 --- a/tests/unit/commands/init/test_manifest.json +++ b/tests/unit/commands/init/test_manifest.json @@ -1,7 +1,7 @@ { - "dotnetcore3.1": [ + "dotnet6": [ { - "directory": "dotnetcore3.1/cookiecutter-aws-sam-hello-dotnet", + "directory": "dotnet6/cookiecutter-aws-sam-hello-dotnet", "displayName": "Hello World Example", "dependencyManager": "cli-package", "appTemplate": "hello-world", diff --git a/tests/unit/lib/build_module/test_app_builder.py b/tests/unit/lib/build_module/test_app_builder.py index 98b8006ad0..408ba8bb35 100644 --- a/tests/unit/lib/build_module/test_app_builder.py +++ b/tests/unit/lib/build_module/test_app_builder.py @@ -460,7 +460,9 @@ def test_must_raise_for_functions_with_multi_architecture(self, persist_mock, re msg = "Function name property Architectures should be a list of length 1" self.assertEqual(str(ex.exception), msg) - @parameterized.expand([("python2.7",), ("python3.6",), ("ruby2.5",), ("nodejs10.x",), ("dotnetcore2.1",)]) + @parameterized.expand( + [("python2.7",), ("python3.6",), ("ruby2.5",), ("nodejs10.x",), ("dotnetcore2.1",), ("dotnetcore3.1",)] + ) def test_deprecated_runtimes(self, runtime): with self.assertRaises(UnsupportedRuntimeException): self.builder._build_function( diff --git a/tests/unit/lib/build_module/test_build_strategy.py b/tests/unit/lib/build_module/test_build_strategy.py index 3e3bc35754..5b2f3f7d77 100644 --- a/tests/unit/lib/build_module/test_build_strategy.py +++ b/tests/unit/lib/build_module/test_build_strategy.py @@ -749,7 +749,7 @@ def test_will_call_incremental_build_strategy(self, mocked_read, mocked_write, r @parameterized.expand( [ - "dotnetcore3.1", + "dotnet6", "go1.x", "java11", ] diff --git a/tests/unit/lib/build_module/test_workflow_config.py b/tests/unit/lib/build_module/test_workflow_config.py index c8a1fad900..9a1beaccfd 100644 --- a/tests/unit/lib/build_module/test_workflow_config.py +++ b/tests/unit/lib/build_module/test_workflow_config.py @@ -64,7 +64,7 @@ def test_must_work_for_provided_with_build_method_dotnet7(self, runtime): self.assertIn(Event("BuildWorkflowUsed", "dotnet-cli-package"), EventTracker.get_tracked_events()) self.assertTrue(result.must_mount_with_write_in_container) - @parameterized.expand([("dotnetcore3.1",), ("dotnet6",), ("provided.al2", "dotnet7")]) + @parameterized.expand([("dotnet6",), ("provided.al2", "dotnet7")]) def test_must_mount_with_write_for_dotnet_in_container(self, runtime, specified_workflow=None): result = get_workflow_config(runtime, self.code_dir, self.project_dir, specified_workflow) self.assertTrue(result.must_mount_with_write_in_container) diff --git a/tests/unit/lib/utils/test_architecture.py b/tests/unit/lib/utils/test_architecture.py index 1c95a96aa5..860c513a07 100644 --- a/tests/unit/lib/utils/test_architecture.py +++ b/tests/unit/lib/utils/test_architecture.py @@ -44,7 +44,7 @@ def test_validate_architecture_errors(self, value): [ ("nodejs14.x", X86_64, ZIP), ("java8.al2", ARM64, ZIP), - ("dotnetcore3.1", ARM64, ZIP), + ("dotnet6", ARM64, ZIP), (None, X86_64, IMAGE), (None, ARM64, IMAGE), (None, X86_64, IMAGE), diff --git a/tests/unit/local/docker/test_lambda_container.py b/tests/unit/local/docker/test_lambda_container.py index 1ccff3c2f0..90893e4e49 100644 --- a/tests/unit/local/docker/test_lambda_container.py +++ b/tests/unit/local/docker/test_lambda_container.py @@ -12,7 +12,7 @@ from samcli.local.docker.lambda_debug_settings import DebuggingNotSupported from samcli.local.docker.lambda_image import RAPID_IMAGE_TAG_PREFIX -RUNTIMES_WITH_ENTRYPOINT = [Runtime.dotnetcore31.value, Runtime.dotnet6.value, Runtime.go1x.value] +RUNTIMES_WITH_ENTRYPOINT = [Runtime.dotnet6.value, Runtime.go1x.value] RUNTIMES_WITH_BOOTSTRAP_ENTRYPOINT = [ Runtime.nodejs12x.value, @@ -31,7 +31,6 @@ Runtime.java11.value, Runtime.java8.value, Runtime.java8al2.value, - Runtime.dotnetcore31.value, Runtime.dotnet6.value, Runtime.go1x.value, ] diff --git a/tests/unit/local/docker/test_lambda_debug_settings.py b/tests/unit/local/docker/test_lambda_debug_settings.py index 407cd05bba..1dd024ebc2 100644 --- a/tests/unit/local/docker/test_lambda_debug_settings.py +++ b/tests/unit/local/docker/test_lambda_debug_settings.py @@ -10,7 +10,6 @@ Runtime.java8al2, Runtime.java11, Runtime.java17, - Runtime.dotnetcore31, Runtime.dotnet6, Runtime.go1x, Runtime.nodejs12x, diff --git a/tests/unit/local/docker/test_lambda_image.py b/tests/unit/local/docker/test_lambda_image.py index 3ad8a10c54..1e8f936d98 100644 --- a/tests/unit/local/docker/test_lambda_image.py +++ b/tests/unit/local/docker/test_lambda_image.py @@ -34,7 +34,6 @@ class TestRuntime(TestCase): ("java17", "java:17-x86_64"), ("go1.x", "go:1"), ("dotnet6", "dotnet:6-x86_64"), - ("dotnetcore3.1", "dotnet:core3.1-x86_64"), ("provided", "provided:alami"), ("provided.al2", "provided:al2-x86_64"), ]