diff --git a/.github/workflows/build_test_invoke.yml b/.github/workflows/build_test_invoke.yml index 8dd315c1a..61a94601f 100644 --- a/.github/workflows/build_test_invoke.yml +++ b/.github/workflows/build_test_invoke.yml @@ -234,7 +234,13 @@ jobs: file: 'tests/integration/unit_test/test_unit_test_ruby3_2.py' - version: '3.2' type: 'Invoke' - file: 'tests/integration/build_invoke/test_ruby_3_2.py' + file: 'tests/integration/build_invoke/ruby/test_ruby_3_2.py' + - version: '3.3' + type: 'Test' + file: 'tests/integration/unit_test/test_unit_test_ruby3_3.py' + - version: '3.3' + type: 'Invoke' + file: 'tests/integration/build_invoke/ruby/test_ruby_3_3.py' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/manifest-v2.json b/manifest-v2.json index 34dd74238..623c19a1f 100644 --- a/manifest-v2.json +++ b/manifest-v2.json @@ -1267,6 +1267,24 @@ "useCaseName": "Multi-step workflow" } ], + "ruby3.3": [ + { + "directory": "ruby/hello", + "displayName": "Hello World Example", + "dependencyManager": "bundler", + "appTemplate": "hello-world", + "packageType": "Zip", + "useCaseName": "Hello World Example" + }, + { + "directory": "ruby/step-func", + "displayName": "Step Functions Sample App (Stock Trader)", + "dependencyManager": "bundler", + "appTemplate": "step-functions-sample-app", + "packageType": "Zip", + "useCaseName": "Multi-step workflow" + } + ], "rust (provided.al2)": [ { "directory": "al2/rust/hello", @@ -1499,6 +1517,16 @@ "useCaseName": "Hello World Example" } ], + "amazon/ruby3.3-base": [ + { + "directory": "ruby/hello-img", + "displayName": "Hello World Lambda Image Example", + "dependencyManager": "bundler", + "appTemplate": "hello-world-lambda-image", + "packageType": "Image", + "useCaseName": "Hello World Example" + } + ], "amazon/go-provided.al2-base": [ { "directory": "al2/go/hello-img", diff --git a/nodejs16.x/step-func-conn/{{cookiecutter.project_name}}/makefile b/nodejs16.x/step-func-conn/{{cookiecutter.project_name}}/makefile index ac7c640b5..3e9440fd3 100644 --- a/nodejs16.x/step-func-conn/{{cookiecutter.project_name}}/makefile +++ b/nodejs16.x/step-func-conn/{{cookiecutter.project_name}}/makefile @@ -10,7 +10,7 @@ create: sed -E -e 's/\$$\{.+\}/arn:aws:lambda:us-east-1:123456789012:function:mock/' statemachine/stock_trader.asl.json > statemachine/test/mocked.test.asl.json aws stepfunctions create-state-machine \ --endpoint-url http://localhost:8083 \ - --definition file://statemachine/stock_trader.asl.json \ + --definition file://statemachine/test/mocked.test.asl.json \ --name "StockTradingLocalTesting" \ --role-arn "arn:aws:iam::123456789012:role/DummyRole" \ --no-cli-pager diff --git a/nodejs16.x/step-func/{{cookiecutter.project_name}}/makefile b/nodejs16.x/step-func/{{cookiecutter.project_name}}/makefile index ac7c640b5..3e9440fd3 100644 --- a/nodejs16.x/step-func/{{cookiecutter.project_name}}/makefile +++ b/nodejs16.x/step-func/{{cookiecutter.project_name}}/makefile @@ -10,7 +10,7 @@ create: sed -E -e 's/\$$\{.+\}/arn:aws:lambda:us-east-1:123456789012:function:mock/' statemachine/stock_trader.asl.json > statemachine/test/mocked.test.asl.json aws stepfunctions create-state-machine \ --endpoint-url http://localhost:8083 \ - --definition file://statemachine/stock_trader.asl.json \ + --definition file://statemachine/test/mocked.test.asl.json \ --name "StockTradingLocalTesting" \ --role-arn "arn:aws:iam::123456789012:role/DummyRole" \ --no-cli-pager diff --git a/nodejs18.x/step-func/{{cookiecutter.project_name}}/makefile b/nodejs18.x/step-func/{{cookiecutter.project_name}}/makefile index ac7c640b5..3e9440fd3 100644 --- a/nodejs18.x/step-func/{{cookiecutter.project_name}}/makefile +++ b/nodejs18.x/step-func/{{cookiecutter.project_name}}/makefile @@ -10,7 +10,7 @@ create: sed -E -e 's/\$$\{.+\}/arn:aws:lambda:us-east-1:123456789012:function:mock/' statemachine/stock_trader.asl.json > statemachine/test/mocked.test.asl.json aws stepfunctions create-state-machine \ --endpoint-url http://localhost:8083 \ - --definition file://statemachine/stock_trader.asl.json \ + --definition file://statemachine/test/mocked.test.asl.json \ --name "StockTradingLocalTesting" \ --role-arn "arn:aws:iam::123456789012:role/DummyRole" \ --no-cli-pager diff --git a/nodejs20.x/step-func/{{cookiecutter.project_name}}/makefile b/nodejs20.x/step-func/{{cookiecutter.project_name}}/makefile index ac7c640b5..3e9440fd3 100644 --- a/nodejs20.x/step-func/{{cookiecutter.project_name}}/makefile +++ b/nodejs20.x/step-func/{{cookiecutter.project_name}}/makefile @@ -10,7 +10,7 @@ create: sed -E -e 's/\$$\{.+\}/arn:aws:lambda:us-east-1:123456789012:function:mock/' statemachine/stock_trader.asl.json > statemachine/test/mocked.test.asl.json aws stepfunctions create-state-machine \ --endpoint-url http://localhost:8083 \ - --definition file://statemachine/stock_trader.asl.json \ + --definition file://statemachine/test/mocked.test.asl.json \ --name "StockTradingLocalTesting" \ --role-arn "arn:aws:iam::123456789012:role/DummyRole" \ --no-cli-pager diff --git a/ruby/hello-img/cookiecutter.json b/ruby/hello-img/cookiecutter.json index 58645bec9..843777012 100644 --- a/ruby/hello-img/cookiecutter.json +++ b/ruby/hello-img/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": ["ruby3.2"], + "runtime": ["ruby3.2", "ruby3.3"], "architectures": { "value": [ "x86_64", "arm64" @@ -8,7 +8,12 @@ }, "options": { "ruby3.2": { - "version": "3.2" + "version": "3.2", + "memory_size": "128" + }, + "ruby3.3": { + "version": "3.3", + "memory_size": "512" } }, "_copy_without_render": [ diff --git a/ruby/hello-img/{{cookiecutter.project_name}}/hello_world/Gemfile b/ruby/hello-img/{{cookiecutter.project_name}}/hello_world/Gemfile index e8c5784e0..c97863b65 100644 --- a/ruby/hello-img/{{cookiecutter.project_name}}/hello_world/Gemfile +++ b/ruby/hello-img/{{cookiecutter.project_name}}/hello_world/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "httparty" -ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0' +ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}' diff --git a/ruby/hello-img/{{cookiecutter.project_name}}/template.yaml b/ruby/hello-img/{{cookiecutter.project_name}}/template.yaml index 18e72aab2..580f7ff29 100644 --- a/ruby/hello-img/{{cookiecutter.project_name}}/template.yaml +++ b/ruby/hello-img/{{cookiecutter.project_name}}/template.yaml @@ -9,7 +9,7 @@ Description: > Globals: Function: Timeout: 3 - MemorySize: 128 + MemorySize: {{ cookiecutter.options[cookiecutter.runtime].memory_size }} Resources: HelloWorldFunction: diff --git a/ruby/hello/cookiecutter.json b/ruby/hello/cookiecutter.json index 58645bec9..843777012 100644 --- a/ruby/hello/cookiecutter.json +++ b/ruby/hello/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": ["ruby3.2"], + "runtime": ["ruby3.2", "ruby3.3"], "architectures": { "value": [ "x86_64", "arm64" @@ -8,7 +8,12 @@ }, "options": { "ruby3.2": { - "version": "3.2" + "version": "3.2", + "memory_size": "128" + }, + "ruby3.3": { + "version": "3.3", + "memory_size": "512" } }, "_copy_without_render": [ diff --git a/ruby/hello/{{cookiecutter.project_name}}/hello_world/Gemfile b/ruby/hello/{{cookiecutter.project_name}}/hello_world/Gemfile index e8c5784e0..c97863b65 100644 --- a/ruby/hello/{{cookiecutter.project_name}}/hello_world/Gemfile +++ b/ruby/hello/{{cookiecutter.project_name}}/hello_world/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gem "httparty" -ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0' +ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}' diff --git a/ruby/hello/{{cookiecutter.project_name}}/template.yaml b/ruby/hello/{{cookiecutter.project_name}}/template.yaml index 882bc6f36..87345e896 100644 --- a/ruby/hello/{{cookiecutter.project_name}}/template.yaml +++ b/ruby/hello/{{cookiecutter.project_name}}/template.yaml @@ -9,7 +9,7 @@ Description: > Globals: Function: Timeout: 3 - MemorySize: 128 + MemorySize: {{ cookiecutter.options[cookiecutter.runtime].memory_size }} Resources: HelloWorldFunction: diff --git a/ruby/step-func/cookiecutter.json b/ruby/step-func/cookiecutter.json index 58645bec9..843777012 100644 --- a/ruby/step-func/cookiecutter.json +++ b/ruby/step-func/cookiecutter.json @@ -1,6 +1,6 @@ { "project_name": "Name of the project", - "runtime": ["ruby3.2"], + "runtime": ["ruby3.2", "ruby3.3"], "architectures": { "value": [ "x86_64", "arm64" @@ -8,7 +8,12 @@ }, "options": { "ruby3.2": { - "version": "3.2" + "version": "3.2", + "memory_size": "128" + }, + "ruby3.3": { + "version": "3.3", + "memory_size": "512" } }, "_copy_without_render": [ diff --git a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_buyer/Gemfile b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_buyer/Gemfile index b8e3186be..0ed5b9348 100644 --- a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_buyer/Gemfile +++ b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_buyer/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0' +ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}' diff --git a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_checker/Gemfile b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_checker/Gemfile index b8e3186be..0ed5b9348 100644 --- a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_checker/Gemfile +++ b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_checker/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0' +ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}' diff --git a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_seller/Gemfile b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_seller/Gemfile index b8e3186be..0ed5b9348 100644 --- a/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_seller/Gemfile +++ b/ruby/step-func/{{cookiecutter.project_name}}/functions/stock_seller/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0' +ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}' diff --git a/ruby/step-func/{{cookiecutter.project_name}}/template.yaml b/ruby/step-func/{{cookiecutter.project_name}}/template.yaml index e5c23ca77..fb50d79cf 100644 --- a/ruby/step-func/{{cookiecutter.project_name}}/template.yaml +++ b/ruby/step-func/{{cookiecutter.project_name}}/template.yaml @@ -5,6 +5,11 @@ Description: > Sample SAM Template for {{ cookiecutter.project_name }} +# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst +Globals: + Function: + MemorySize: {{ cookiecutter.options[cookiecutter.runtime].memory_size }} + Resources: StockTradingStateMachine: Type: AWS::Serverless::StateMachine # More info about State Machine Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html diff --git a/tests/integration/build_invoke/ruby/__init__.py b/tests/integration/build_invoke/ruby/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/integration/build_invoke/test_ruby_3_2.py b/tests/integration/build_invoke/ruby/test_ruby_3_2.py similarity index 100% rename from tests/integration/build_invoke/test_ruby_3_2.py rename to tests/integration/build_invoke/ruby/test_ruby_3_2.py diff --git a/tests/integration/build_invoke/ruby/test_ruby_3_3.py b/tests/integration/build_invoke/ruby/test_ruby_3_3.py new file mode 100644 index 000000000..fc49c062c --- /dev/null +++ b/tests/integration/build_invoke/ruby/test_ruby_3_3.py @@ -0,0 +1,31 @@ +from unittest import skip +from tests.integration.build_invoke.build_invoke_base import BuildInvokeBase + +""" +For each template, it will test the following sam commands: +1. sam init +2. sam build --use-container (if self.use_container is False, --use-container will be omitted) +3. (if there are event jsons), for each event json, check `sam local invoke` response is a valid json +""" + +class BuildInvoke_ruby3_3_cookiecutter_aws_sam_hello_ruby(BuildInvokeBase.HelloWorldExclamationBuildInvokeBase): + runtime = "ruby3.3" + directory = "ruby/hello" + # TODO(hawflau): remove the line below when cfn-lint supports ruby3.3 + should_test_lint = False + + +class BuildInvoke_ruby3_3_cookiecutter_aws_sam_step_functions_sample_app(BuildInvokeBase.BuildInvokeBase): + runtime = "ruby3.3" + directory = "ruby/step-func" + # TODO(hawflau): remove the line below when cfn-lint supports ruby3.3 + should_test_lint = False + + +class BuildInvoke_image_ruby3_3_cookiecutter_aws_sam_hello_ruby_lambda_image( + BuildInvokeBase.HelloWorldExclamationBuildInvokeBase +): + runtime = "ruby3.3" + directory = "ruby/hello-img" + # TODO(hawflau): remove the line below when cfn-lint supports ruby3.3 + should_test_lint = False diff --git a/tests/integration/unit_test/test_unit_test_ruby3_3.py b/tests/integration/unit_test/test_unit_test_ruby3_3.py new file mode 100644 index 000000000..432bfad23 --- /dev/null +++ b/tests/integration/unit_test/test_unit_test_ruby3_3.py @@ -0,0 +1,21 @@ +from tests.integration.unit_test.unit_test_base import UnitTestBase + + +class UnitTest_ruby3_3_cookiecutter_aws_sam_hello_ruby(UnitTestBase.RubyUnitTestBase): + runtime = "ruby3.3" + directory = "ruby/hello" + code_directories = ["tests/unit/test_handler.rb"] + # TODO(hawflau): remove the line below when cfn-lint supports ruby3.3 + should_test_lint = False + + +class UnitTest_ruby3_3_cookiecutter_aws_sam_step_functions_sample_app(UnitTestBase.RubyUnitTestBase): + runtime = "ruby3.3" + directory = "ruby/step-func" + code_directories = [ + "tests/unit/test_stock_buyer.rb", + "tests/unit/test_stock_checker.rb", + "tests/unit/test_stock_seller.rb", + ] + # TODO(hawflau): remove the line below when cfn-lint supports ruby3.3 + should_test_lint = False