Skip to content

Commit 820bee5

Browse files
valerenavicheeyroger-zhangg
authored
test: Add Ruby3.4 to integ tests (aws#7984)
Also change the runtime of the Ruby `init` template to 3.4 (when the full list can't be retrieved online) Co-authored-by: vicheey <[email protected]> Co-authored-by: Roger Zhang <[email protected]>
1 parent 582ea59 commit 820bee5

File tree

11 files changed

+37
-14
lines changed

11 files changed

+37
-14
lines changed

appveyor-windows-al2023.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ install:
5454
# Make sure the temp directory exists for Python to use.
5555
- ps: "mkdir -Force C:\\tmp"
5656
- "python --version"
57-
- 'set PATH=%PYTHON_HOME%;C:\Ruby33-x64\bin;C:\Ruby32-x64\bin;%PATH%;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64;C:\Python312-x64;C:\Python313-x64'
57+
- 'set PATH=%PYTHON_HOME%;C:\Ruby33-x64\bin;%PATH%;C:\Python39-x64;C:\Python310-x64;C:\Python311-x64;C:\Python312-x64;C:\Python313-x64'
5858
- "node --version"
5959
- "echo %PYTHON_HOME%"
6060
- "echo %PATH%"

appveyor-windows-binary.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ install:
6464
- "gradle -v"
6565
- "mvn --version"
6666
- choco install ruby --version=3.3.0.1
67+
- choco install ruby --version=3.4.2.1
6768

6869
# Make sure the temp directory exists for Python to use.
6970
- ps: "mkdir -Force C:\\tmp"

appveyor-windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ install:
6262
- choco upgrade gradle --version=8.4.0
6363
- "gradle -v"
6464
- "mvn --version"
65-
- choco install ruby --version=3.3.0.1
6665

6766
# Make sure the temp directory exists for Python to use.
6867
- ps: "mkdir -Force C:\\tmp"

samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A cookiecutter template to create a Ruby Hello world boilerplate using [Serverle
1010

1111
Generate a boilerplate template in your current project directory using the following syntax:
1212

13-
* **Ruby 3.2**: `sam init --runtime ruby3.2`
13+
* **Ruby 3.4**: `sam init --runtime ruby3.4`
1414

1515
> **NOTE**: ``--name`` allows you to specify a different project folder name (`sam-app` is the default)
1616

samcli/lib/init/templates/cookiecutter-aws-sam-hello-ruby/cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"project_name": "Name of the project",
3-
"runtime": "ruby3.2",
3+
"runtime": "ruby3.4",
44
"architectures": {
55
"value": [
66
"x86_64"

tests/integration/buildcmd/test_build_cmd.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_building_ruby_3_2(self, use_container):
272272

273273
self._test_with_default_gemfile("ruby3.2", use_container, "Ruby", self.test_data_path)
274274

275-
@parameterized.expand([("ruby3.3",)])
275+
@parameterized.expand([("ruby3.3",), ("ruby3.4",)])
276276
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
277277
@pytest.mark.al2023
278278
def test_building_ruby_al2023(self, runtime):
@@ -288,7 +288,14 @@ def test_building_ruby_3_2(self, use_container):
288288
self.skipTest(SKIP_DOCKER_MESSAGE)
289289
self._test_with_default_gemfile("ruby3.2", use_container, "Ruby32", self.test_data_path, "x86_64")
290290

291-
@parameterized.expand([("ruby3.3", "Ruby33", False), ("ruby3.3", "Ruby33", True)])
291+
@parameterized.expand(
292+
[
293+
("ruby3.3", "Ruby33", False),
294+
("ruby3.3", "Ruby33", True),
295+
# ("ruby3.4", "Ruby34", False), # TODO: Try to make this work in AppVeyor (windows-al2023)
296+
("ruby3.4", "Ruby34", True),
297+
]
298+
)
292299
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
293300
@pytest.mark.al2023
294301
def test_building_ruby_al2023(self, runtime, codeuri, use_container):
@@ -301,7 +308,7 @@ class TestBuildCommand_RubyFunctionsWithGemfileInTheRoot(BuildIntegRubyBase):
301308
This doesn't apply to containerized build, since it copies only the function folder to the container
302309
"""
303310

304-
@parameterized.expand([("ruby3.2"), ("ruby3.3")])
311+
@parameterized.expand([("ruby3.2",), ("ruby3.3",), ("ruby3.4",)])
305312
def test_building_ruby_in_process_with_root_gemfile(self, runtime):
306313
self._prepare_application_environment(runtime)
307314
self._test_with_default_gemfile(runtime, False, "RubyWithRootGemfile", self.working_dir)
@@ -948,7 +955,7 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase):
948955
),
949956
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
950957
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
951-
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
958+
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
952959
# container
953960
(
954961
True,
@@ -959,7 +966,7 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase):
959966
),
960967
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
961968
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
962-
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
969+
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
963970
]
964971
)
965972
def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):
@@ -1079,7 +1086,7 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase):
10791086
),
10801087
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
10811088
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
1082-
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
1089+
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
10831090
# container
10841091
(
10851092
True,
@@ -1090,7 +1097,7 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase):
10901097
),
10911098
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
10921099
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
1093-
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
1100+
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
10941101
]
10951102
)
10961103
def test_cache_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):
@@ -1270,7 +1277,7 @@ class TestParallelBuilds(DedupBuildIntegBase):
12701277
),
12711278
(False, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
12721279
(False, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
1273-
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
1280+
(False, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
12741281
# container
12751282
(
12761283
True,
@@ -1281,7 +1288,7 @@ class TestParallelBuilds(DedupBuildIntegBase):
12811288
),
12821289
(True, "Node", "main.lambdaHandler", "main.secondLambdaHandler", "nodejs20.x"),
12831290
(True, "Python", "main.first_function_handler", "main.second_function_handler", "python3.9"),
1284-
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.2"),
1291+
(True, "Ruby", "app.lambda_handler", "app.second_lambda_handler", "ruby3.4"),
12851292
]
12861293
)
12871294
def test_dedup_build(self, use_container, code_uri, function1_handler, function2_handler, runtime):

tests/integration/buildcmd/test_build_cmd_arm64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_building_default_package_json_al2023(self, runtime, use_container):
182182
class TestBuildCommand_RubyFunctions_With_Architecture_arm64(BuildIntegRubyBase):
183183
template = "template_with_architecture.yaml"
184184

185-
@parameterized.expand([("ruby3.2", "Ruby32")])
185+
@parameterized.expand([("ruby3.2", "Ruby32"), ("ruby3.4", "Ruby34")])
186186
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
187187
def test_building_ruby_in_container_with_specified_architecture(self, runtime, code_uri):
188188
self._test_with_default_gemfile(runtime, "use_container", code_uri, self.test_data_path, ARM64)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "aws-eventstream"
4+
5+
ruby '~> 3.4'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'json'
2+
3+
def lambda_handler(event:, context:)
4+
"Hello World"
5+
end
6+
7+
def second_lambda_handler(event:, context:)
8+
"Hello Mars"
9+
end

0 commit comments

Comments
 (0)