diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 314ca5414f..1db61f6423 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,9 +148,6 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.19' - - uses: ruby/setup-ruby@v1 - with: - ruby-version: "2.7" - uses: ruby/setup-ruby@v1 with: ruby-version: "3.2" diff --git a/designs/per_command_help_text.md b/designs/per_command_help_text.md index b5e8d706fa..5ea9cb0177 100644 --- a/designs/per_command_help_text.md +++ b/designs/per_command_help_text.md @@ -377,7 +377,7 @@ Usage: sam build [OPTIONS] [RESOURCE_LOGICAL_ID] 2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM - 3. Ruby 2.7 using Bundler + 3. Ruby3.2 using Bundler 4. Java 8, Java 11 using Gradle and Maven diff --git a/samcli/commands/build/command.py b/samcli/commands/build/command.py index 2f7cd00392..250ba01daf 100644 --- a/samcli/commands/build/command.py +++ b/samcli/commands/build/command.py @@ -55,7 +55,7 @@ ------------------ 1. Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 using PIP\n 2. Nodejs 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n - 3. Ruby 2.7, 3.2 using Bundler\n + 3. Ruby 3.2 using Bundler\n 4. Java 8, Java 11, Java 17, Java 21 using Gradle and Maven\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/lib/build/constants.py b/samcli/lib/build/constants.py index 3f15a06dc7..35d6ff37ac 100644 --- a/samcli/lib/build/constants.py +++ b/samcli/lib/build/constants.py @@ -15,5 +15,6 @@ "python2.7", "python3.6", "ruby2.5", + "ruby2.7", } BUILD_PROPERTIES = "BuildProperties" diff --git a/samcli/lib/build/workflow_config.py b/samcli/lib/build/workflow_config.py index ab40140f20..51db4425da 100644 --- a/samcli/lib/build/workflow_config.py +++ b/samcli/lib/build/workflow_config.py @@ -97,7 +97,6 @@ def get_layer_subfolder(build_workflow: str) -> str: "nodejs16.x": "nodejs", "nodejs18.x": "nodejs", "nodejs20.x": "nodejs", - "ruby2.7": "ruby/lib", "ruby3.2": "ruby/lib", "java8": "java", "java11": "java", @@ -162,7 +161,6 @@ def get_workflow_config( "nodejs16.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG), "nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG), "nodejs20.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG), - "ruby2.7": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG), "ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG), "dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG), "go1.x": BasicWorkflowSelector(GO_MOD_CONFIG), diff --git a/samcli/lib/init/local_manifest.json b/samcli/lib/init/local_manifest.json index de154ab38d..d1e7b199fa 100644 --- a/samcli/lib/init/local_manifest.json +++ b/samcli/lib/init/local_manifest.json @@ -132,15 +132,5 @@ "packageType": "Zip", "useCaseName": "Hello World Example" } - ], - "ruby2.7": [ - { - "directory": "template/cookiecutter-aws-sam-hello-ruby", - "displayName": "Hello World Example", - "dependencyManager": "bundler", - "appTemplate": "hello-world", - "packageType": "Zip", - "useCaseName": "Hello World Example" - } ] } \ No newline at end of file diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/README.md b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/README.md index 797eaf66e9..5363664200 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/README.md +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/README.md @@ -10,7 +10,7 @@ A cookiecutter template to create a Ruby Hello world boilerplate using [Serverle Generate a boilerplate template in your current project directory using the following syntax: -* **Ruby 2.5**: `sam init --runtime ruby2.5` +* **Ruby 3.2**: `sam init --runtime ruby3.2` > **NOTE**: ``--name`` allows you to specify a different project folder name (`sam-app` is the default) diff --git a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/cookiecutter.json b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/cookiecutter.json index 01db12539b..d4e65b301d 100644 --- a/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/cookiecutter.json +++ b/samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": "ruby2.5", + "runtime": "ruby3.2", "architectures": { "value": [ "x86_64" diff --git a/samcli/lib/utils/architecture.py b/samcli/lib/utils/architecture.py index 1a3a03b689..310a429d3f 100644 --- a/samcli/lib/utils/architecture.py +++ b/samcli/lib/utils/architecture.py @@ -24,7 +24,6 @@ "python3.10": [ARM64, X86_64], "python3.11": [ARM64, X86_64], "python3.12": [ARM64, X86_64], - "ruby2.7": [ARM64, X86_64], "ruby3.2": [ARM64, X86_64], "java8": [X86_64], "java8.al2": [ARM64, X86_64], diff --git a/samcli/local/common/runtime_template.py b/samcli/local/common/runtime_template.py index 45924bb93a..aadcebdb6c 100644 --- a/samcli/local/common/runtime_template.py +++ b/samcli/local/common/runtime_template.py @@ -24,7 +24,7 @@ ], "ruby": [ { - "runtimes": ["ruby3.2", "ruby2.7"], + "runtimes": ["ruby3.2"], "dependency_manager": "bundler", "init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-ruby"), "build": True, @@ -124,7 +124,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.7", # ruby runtimes in descending order "ruby3.2", - "ruby2.7", ] @@ -148,7 +147,6 @@ def get_local_lambda_images_location(mapping, runtime): "python3.8": "amazon/python3.8-base", "python3.7": "amazon/python3.7-base", "ruby3.2": "amazon/ruby3.2-base", - "ruby2.7": "amazon/ruby2.7-base", } LAMBDA_IMAGES_RUNTIMES: List = sorted(list(set(LAMBDA_IMAGES_RUNTIMES_MAP.values()))) diff --git a/samcli/local/docker/lambda_image.py b/samcli/local/docker/lambda_image.py index 6568ec4522..8500872989 100644 --- a/samcli/local/docker/lambda_image.py +++ b/samcli/local/docker/lambda_image.py @@ -42,7 +42,6 @@ class Runtime(Enum): python310 = "python3.10" python311 = "python3.11" python312 = "python3.12" - ruby27 = "ruby2.7" ruby32 = "ruby3.2" java8 = "java8" java8al2 = "java8.al2" diff --git a/schema/samcli.json b/schema/samcli.json index acef452725..b9a5560b9d 100644 --- a/schema/samcli.json +++ b/schema/samcli.json @@ -23,7 +23,7 @@ "properties": { "parameters": { "title": "Parameters for the init command", - "description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2, ruby2.7\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.", + "description": "Available parameters for the init command:\n* no_interactive:\nDisable interactive prompting for init parameters. (fail if any required values are missing)\n* architecture:\nArchitectures for Lambda functions.\n\nArchitectures: ['arm64', 'x86_64']\n* location:\nTemplate location (git, mercurial, http(s), zip, path).\n* runtime:\nLambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2\n* package_type:\nLambda deployment package type.\n\nPackage Types: Zip, Image\n* base_image:\nLambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base\n* dependency_manager:\nDependency manager for Lambda runtime.\n\nDependency managers: bundler, cli-package, gradle, maven, mod, npm, pip\n* output_dir:\nDirectory to initialize AWS SAM application.\n* name:\nName of AWS SAM Application.\n* app_template:\nIdentifier of the managed application template to be used. Alternatively, run '$sam init' without options for an interactive workflow.\n* no_input:\nDisable Cookiecutter prompting and accept default values defined in the cookiecutter config.\n* extra_context:\nOverride custom parameters in the template's cookiecutter.json configuration e.g. {\"customParam1\": \"customValue1\", \"customParam2\":\"customValue2\"}\n* tracing:\nEnable AWS X-Ray tracing for application.\n* application_insights:\nEnable CloudWatch Application Insights monitoring for application.\n* structured_logging:\nEnable Structured Logging for application.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* save_params:\nSave the parameters provided via the command line to the configuration file.", "type": "object", "properties": { "no_interactive": { @@ -48,7 +48,7 @@ "runtime": { "title": "runtime", "type": "string", - "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2, ruby2.7", + "description": "Lambda runtime for application.\n\nRuntimes: dotnet6, go1.x, java21, java17, java11, java8.al2, java8, nodejs20.x, nodejs18.x, nodejs16.x, provided, provided.al2, provided.al2023, python3.9, python3.8, python3.7, python3.12, python3.11, python3.10, ruby3.2", "enum": [ "dotnet6", "go1.x", @@ -69,7 +69,6 @@ "python3.7", "python3.8", "python3.9", - "ruby2.7", "ruby3.2" ] }, @@ -85,7 +84,7 @@ "base_image": { "title": "base_image", "type": "string", - "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby2.7-base, amazon/ruby3.2-base", + "description": "Lambda base image for deploying IMAGE based package type.\n\nBase images: amazon/dotnet6-base, amazon/go-provided.al2-base, amazon/go-provided.al2023-base, amazon/go1.x-base, amazon/java11-base, amazon/java17-base, amazon/java21-base, amazon/java8-base, amazon/java8.al2-base, amazon/nodejs16.x-base, amazon/nodejs18.x-base, amazon/nodejs20.x-base, amazon/python3.10-base, amazon/python3.11-base, amazon/python3.12-base, amazon/python3.7-base, amazon/python3.8-base, amazon/python3.9-base, amazon/ruby3.2-base", "enum": [ "amazon/dotnet6-base", "amazon/go-provided.al2-base", @@ -105,7 +104,6 @@ "amazon/python3.7-base", "amazon/python3.8-base", "amazon/python3.9-base", - "amazon/ruby2.7-base", "amazon/ruby3.2-base" ] }, diff --git a/tests/integration/buildcmd/test_build_cmd.py b/tests/integration/buildcmd/test_build_cmd.py index 9f7b7319f9..d86d5642a6 100644 --- a/tests/integration/buildcmd/test_build_cmd.py +++ b/tests/integration/buildcmd/test_build_cmd.py @@ -798,12 +798,12 @@ def test_building_default_package_json(self, runtime, use_container, architectur class TestBuildCommand_RubyFunctions(BuildIntegRubyBase): - @parameterized.expand(["ruby2.7", "ruby3.2"]) + @parameterized.expand(["ruby3.2"]) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) def test_building_ruby_in_container(self, runtime): self._test_with_default_gemfile(runtime, "use_container", "Ruby", self.test_data_path) - @parameterized.expand(["ruby2.7", "ruby3.2"]) + @parameterized.expand(["ruby3.2"]) def test_building_ruby_in_process(self, runtime): self._test_with_default_gemfile(runtime, False, "Ruby", self.test_data_path) @@ -811,12 +811,12 @@ def test_building_ruby_in_process(self, runtime): class TestBuildCommand_RubyFunctions_With_Architecture(BuildIntegRubyBase): template = "template_with_architecture.yaml" - @parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")]) + @parameterized.expand([("ruby3.2", "Ruby32")]) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) def test_building_ruby_in_container_with_specified_architecture(self, runtime, codeuri): self._test_with_default_gemfile(runtime, "use_container", codeuri, self.test_data_path, "x86_64") - @parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")]) + @parameterized.expand([("ruby3.2", "Ruby32")]) def test_building_ruby_in_process_with_specified_architecture(self, runtime, codeuri): self._test_with_default_gemfile(runtime, False, codeuri, self.test_data_path, "x86_64") @@ -827,7 +827,7 @@ class TestBuildCommand_RubyFunctionsWithGemfileInTheRoot(BuildIntegRubyBase): This doesn't apply to containerized build, since it copies only the function folder to the container """ - @parameterized.expand([("ruby2.7"), ("ruby3.2")]) + @parameterized.expand([("ruby3.2")]) def test_building_ruby_in_process_with_root_gemfile(self, runtime): self._prepare_application_environment() self._test_with_default_gemfile(runtime, False, "RubyWithRootGemfile", self.working_dir) @@ -2130,12 +2130,12 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase): (False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), # container (True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), ] ) def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime): @@ -2249,12 +2249,12 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase): (False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), # container (True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), ] ) def test_cache_build(self, use_container, code_uri, function1_handler, function2_handler, runtime): @@ -2428,12 +2428,12 @@ class TestParallelBuilds(DedupBuildIntegBase): (False, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), # container (True, "Java/gradlew/8", "aws.example.Hello::myHandler", "aws.example.SecondFunction::myHandler", "java8"), (True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"), (True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"), - (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby2.7"), + (True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"), ] ) def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime): diff --git a/tests/integration/buildcmd/test_build_cmd_arm64.py b/tests/integration/buildcmd/test_build_cmd_arm64.py index c2064c2798..403c6e269b 100644 --- a/tests/integration/buildcmd/test_build_cmd_arm64.py +++ b/tests/integration/buildcmd/test_build_cmd_arm64.py @@ -154,12 +154,12 @@ def test_building_default_package_json(self, runtime, use_container): class TestBuildCommand_RubyFunctions_With_Architecture_arm64(BuildIntegRubyBase): template = "template_with_architecture.yaml" - @parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")]) + @parameterized.expand([("ruby3.2", "Ruby32")]) @skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE) def test_building_ruby_in_container_with_specified_architecture(self, runtime, code_uri): self._test_with_default_gemfile(runtime, "use_container", code_uri, self.test_data_path, ARM64) - @parameterized.expand([("ruby2.7", "Ruby"), ("ruby3.2", "Ruby32")]) + @parameterized.expand([("ruby3.2", "Ruby32")]) def test_building_ruby_in_process_with_specified_architecture(self, runtime, code_uri): self._test_with_default_gemfile(runtime, False, code_uri, self.test_data_path, ARM64) diff --git a/tests/integration/testdata/invoke/credential_tests/incontainer/ruby/Gemfile b/tests/integration/testdata/invoke/credential_tests/incontainer/ruby/Gemfile index 620aaa62f8..d058c25a74 100644 --- a/tests/integration/testdata/invoke/credential_tests/incontainer/ruby/Gemfile +++ b/tests/integration/testdata/invoke/credential_tests/incontainer/ruby/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -ruby '~> 2.7.0' +ruby '~> 3.2.0' diff --git a/tests/integration/testdata/invoke/credential_tests/incontainer/template.yaml b/tests/integration/testdata/invoke/credential_tests/incontainer/template.yaml index 41772a60ac..378460c682 100644 --- a/tests/integration/testdata/invoke/credential_tests/incontainer/template.yaml +++ b/tests/integration/testdata/invoke/credential_tests/incontainer/template.yaml @@ -26,7 +26,7 @@ Resources: Properties: CodeUri: ruby Handler: app.lambda_handler - Runtime: ruby2.7 + Runtime: ruby3.2 NodeStsExample: Type: AWS::Serverless::Function Properties: diff --git a/tests/integration/validate/test_validate_command.py b/tests/integration/validate/test_validate_command.py index 677d27706e..cfd47d0e6e 100644 --- a/tests/integration/validate/test_validate_command.py +++ b/tests/integration/validate/test_validate_command.py @@ -145,11 +145,11 @@ def test_lint_supported_runtimes(self): "provided", "provided.al2", "provided.al2023", + "ruby3.2", "python3.7", "python3.8", "python3.9", "python3.10", - "ruby2.7", ] i = 0 for runtime in supported_runtimes: diff --git a/tests/smoke/templates/sar/ffmpeg-lambda-layer-template.yaml b/tests/smoke/templates/sar/ffmpeg-lambda-layer-template.yaml index dced79a7e4..ce21275b32 100644 --- a/tests/smoke/templates/sar/ffmpeg-lambda-layer-template.yaml +++ b/tests/smoke/templates/sar/ffmpeg-lambda-layer-template.yaml @@ -13,7 +13,7 @@ Resources: CompatibleRuntimes: - nodejs18.x - python3.9 - - ruby2.7 + - ruby3.2 - java8 - go1.x ContentUri: diff --git a/tests/unit/commands/init/test_cli.py b/tests/unit/commands/init/test_cli.py index 95f09b0431..81148e8350 100644 --- a/tests/unit/commands/init/test_cli.py +++ b/tests/unit/commands/init/test_cli.py @@ -2183,7 +2183,6 @@ def test_must_return_runtime_from_base_image_name(self): "amazon/java11-base", "amazon/nodejs20.x-base", "amazon/python3.8-base", - "amazon/ruby2.7-base", "amazon/go-provided.al2-base", "amazon/ruby3.2-base", ] @@ -2194,7 +2193,6 @@ def test_must_return_runtime_from_base_image_name(self): "java11", "nodejs20.x", "python3.8", - "ruby2.7", "go (provided.al2)", "ruby3.2", ] @@ -2850,9 +2848,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"] - init_runtime_mock.return_value = ["go1.x", "java11", "python3.7", "ruby3.2", "ruby2.7"] - expect_result = ["java11", "python3.7", "ruby3.2", "ruby2.7"] + runtime_option_list = ["python3.7", "ruby3.2", "java11", "unsupported_runtime"] + init_runtime_mock.return_value = ["go1.x", "java11", "python3.7", "ruby3.2"] + expect_result = ["java11", "python3.7", "ruby3.2"] actual_result = get_sorted_runtimes(runtime_option_list) self.assertEqual(actual_result, expect_result) diff --git a/tests/unit/commands/init/test_templates.py b/tests/unit/commands/init/test_templates.py index 2a18f358f9..f1e448c125 100644 --- a/tests/unit/commands/init/test_templates.py +++ b/tests/unit/commands/init/test_templates.py @@ -21,7 +21,7 @@ def test_location_from_app_template_zip(self, subprocess_mock, git_exec_mock, cd it._check_upsert_templates = Mock() manifest = { - "ruby2.7": [ + "ruby3.2": [ { "directory": "mock-ruby-template", "displayName": "Hello World Example", @@ -37,7 +37,7 @@ def test_location_from_app_template_zip(self, subprocess_mock, git_exec_mock, cd with patch("samcli.cli.global_config.GlobalConfig.config_dir", new_callable=PropertyMock) as mock_cfg: mock_cfg.return_value = Path("/tmp/test-sam") with patch("samcli.commands.init.init_templates.open", m): - location = it.location_from_app_template(ZIP, "ruby2.7", None, "bundler", "hello-world") + location = it.location_from_app_template(ZIP, "ruby3.2", None, "bundler", "hello-world") self.assertTrue(search("mock-ruby-template", location)) @patch("samcli.lib.utils.git_repo.check_output") @@ -49,7 +49,7 @@ def test_location_from_app_template_image(self, subprocess_mock, git_exec_mock, it._check_upsert_templates = Mock() manifest = { - "ruby2.7-image": [ + "ruby3.2-image": [ { "directory": "mock-ruby-image-template", "displayName": "Hello World Lambda Image Example", @@ -66,7 +66,7 @@ def test_location_from_app_template_image(self, subprocess_mock, git_exec_mock, mock_cfg.return_value = Path("/tmp/test-sam") with patch("samcli.commands.init.init_templates.open", m): location = it.location_from_app_template( - IMAGE, None, "ruby2.7-image", "bundler", "hello-world-lambda-image" + IMAGE, None, "ruby3.2-image", "bundler", "hello-world-lambda-image" ) self.assertTrue(search("mock-ruby-image-template", location)) diff --git a/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py b/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py index 3d0979da49..1c9bdaa1b3 100644 --- a/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py +++ b/tests/unit/lib/bootstrap/nested_stack/test_nested_stack_manager.py @@ -241,6 +241,6 @@ def test_skipping_dependency_copy_when_function_has_no_dependencies( patched_osutils.copytree.assert_not_called() patched_add_layer_readme.assert_called_with(str(layer_root_folder), function_logical_id) - @parameterized.expand([("python3.8", True), ("ruby2.7", False)]) + @parameterized.expand([("python3.8", True), ("ruby3.2", False)]) def test_is_runtime_supported(self, runtime, supported): self.assertEqual(NestedStackManager.is_runtime_supported(runtime), supported) diff --git a/tests/unit/lib/build_module/test_app_builder.py b/tests/unit/lib/build_module/test_app_builder.py index bc47c50f06..05c5bc6499 100644 --- a/tests/unit/lib/build_module/test_app_builder.py +++ b/tests/unit/lib/build_module/test_app_builder.py @@ -462,7 +462,15 @@ def test_must_raise_for_functions_with_multi_architecture(self, persist_mock, re self.assertEqual(str(ex.exception), msg) @parameterized.expand( - [("python2.7",), ("python3.6",), ("ruby2.5",), ("nodejs10.x",), ("dotnetcore2.1",), ("dotnetcore3.1",)] + [ + ("python2.7",), + ("python3.6",), + ("ruby2.5",), + ("ruby2.7",), + ("nodejs10.x",), + ("dotnetcore2.1",), + ("dotnetcore3.1",), + ] ) def test_deprecated_runtimes(self, runtime): with self.assertRaises(UnsupportedRuntimeException): diff --git a/tests/unit/lib/build_module/test_build_strategy.py b/tests/unit/lib/build_module/test_build_strategy.py index 05c99437bf..07f5e02021 100644 --- a/tests/unit/lib/build_module/test_build_strategy.py +++ b/tests/unit/lib/build_module/test_build_strategy.py @@ -734,7 +734,7 @@ def setUp(self) -> None: [ "python3.7", "nodejs20.x", - "ruby2.7", + "ruby3.2", ] ) def test_will_call_incremental_build_strategy(self, mocked_read, mocked_write, runtime): diff --git a/tests/unit/lib/build_module/test_workflow_config.py b/tests/unit/lib/build_module/test_workflow_config.py index c284655414..d6574b27c1 100644 --- a/tests/unit/lib/build_module/test_workflow_config.py +++ b/tests/unit/lib/build_module/test_workflow_config.py @@ -99,7 +99,7 @@ def test_raise_exception_for_bad_specified_workflow(self, runtime): with self.assertRaises(UnsupportedBuilderException): get_workflow_config(runtime, self.code_dir, self.project_dir, specified_workflow="Wrong") - @parameterized.expand([("ruby2.7",)]) + @parameterized.expand([("ruby3.2",)]) def test_must_work_for_ruby(self, runtime): result = get_workflow_config(runtime, self.code_dir, self.project_dir) self.assertEqual(result.language, "ruby") diff --git a/tests/unit/lib/sync/test_sync_flow_factory.py b/tests/unit/lib/sync/test_sync_flow_factory.py index 632d25bba5..92d30c8a09 100644 --- a/tests/unit/lib/sync/test_sync_flow_factory.py +++ b/tests/unit/lib/sync/test_sync_flow_factory.py @@ -134,7 +134,7 @@ def test_create_lambda_flow_zip_with_unsupported_runtime_auto_dependency_layer( ): build_context = MagicMock() build_context.function_provider.get.return_value = Mock( - packagetype=ZIP, build_info=FunctionBuildInfo.BuildableZip, runtime="ruby2.7" + packagetype=ZIP, build_info=FunctionBuildInfo.BuildableZip, runtime="ruby3.2" ) factory = self.create_factory(True, build_context=build_context) result = factory._create_lambda_flow("Function1", pre_build_artifacts) diff --git a/tests/unit/local/docker/test_lambda_image.py b/tests/unit/local/docker/test_lambda_image.py index 91ba339b5e..a8e0d776b7 100644 --- a/tests/unit/local/docker/test_lambda_image.py +++ b/tests/unit/local/docker/test_lambda_image.py @@ -25,7 +25,6 @@ class TestRuntime(TestCase): ("python3.7", "python:3.7"), ("python3.8", "python:3.8-x86_64"), ("python3.9", "python:3.9-x86_64"), - ("ruby2.7", "ruby:2.7-x86_64"), ("ruby3.2", "ruby:3.2-x86_64"), ("java8", "java:8"), ("java8.al2", "java:8.al2-x86_64"),