Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamorosi authored Apr 6, 2024
2 parents 66d0e08 + ccd6c09 commit 31db614
Show file tree
Hide file tree
Showing 21 changed files with 124 additions and 18 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build_test_invoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions manifest-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions ruby/hello-img/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"project_name": "Name of the project",
"runtime": ["ruby3.2"],
"runtime": ["ruby3.2", "ruby3.3"],
"architectures": {
"value": [
"x86_64", "arm64"
]
},
"options": {
"ruby3.2": {
"version": "3.2"
"version": "3.2",
"memory_size": "128"
},
"ruby3.3": {
"version": "3.3",
"memory_size": "512"
}
},
"_copy_without_render": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source "https://rubygems.org"

gem "httparty"

ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0'
ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}'
2 changes: 1 addition & 1 deletion ruby/hello-img/{{cookiecutter.project_name}}/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: >
Globals:
Function:
Timeout: 3
MemorySize: 128
MemorySize: {{ cookiecutter.options[cookiecutter.runtime].memory_size }}

Resources:
HelloWorldFunction:
Expand Down
9 changes: 7 additions & 2 deletions ruby/hello/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"project_name": "Name of the project",
"runtime": ["ruby3.2"],
"runtime": ["ruby3.2", "ruby3.3"],
"architectures": {
"value": [
"x86_64", "arm64"
]
},
"options": {
"ruby3.2": {
"version": "3.2"
"version": "3.2",
"memory_size": "128"
},
"ruby3.3": {
"version": "3.3",
"memory_size": "512"
}
},
"_copy_without_render": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source "https://rubygems.org"

gem "httparty"

ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0'
ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}'
2 changes: 1 addition & 1 deletion ruby/hello/{{cookiecutter.project_name}}/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Description: >
Globals:
Function:
Timeout: 3
MemorySize: 128
MemorySize: {{ cookiecutter.options[cookiecutter.runtime].memory_size }}

Resources:
HelloWorldFunction:
Expand Down
9 changes: 7 additions & 2 deletions ruby/step-func/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"project_name": "Name of the project",
"runtime": ["ruby3.2"],
"runtime": ["ruby3.2", "ruby3.3"],
"architectures": {
"value": [
"x86_64", "arm64"
]
},
"options": {
"ruby3.2": {
"version": "3.2"
"version": "3.2",
"memory_size": "128"
},
"ruby3.3": {
"version": "3.3",
"memory_size": "512"
}
},
"_copy_without_render": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0'
ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0'
ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}.0'
ruby '~> {{ cookiecutter.options[cookiecutter.runtime].version }}'
5 changes: 5 additions & 0 deletions ruby/step-func/{{cookiecutter.project_name}}/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file.
31 changes: 31 additions & 0 deletions tests/integration/build_invoke/ruby/test_ruby_3_3.py
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions tests/integration/unit_test/test_unit_test_ruby3_3.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 31db614

Please sign in to comment.