Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ruby 3.3 runtime #12420

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/plugins/aws/invoke-local/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class AwsInvokeLocal {
);
}

if (['ruby2.7', 'ruby3.2'].includes(runtime)) {
if (['ruby2.7', 'ruby3.2', 'ruby3.3'].includes(runtime)) {
const handlerComponents = handler.split(/\./);
const handlerPath = handlerComponents[0];
const handlerName = handlerComponents.slice(1).join('.');
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/aws/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ class AwsProvider {
'python3.11',
'ruby2.7',
'ruby3.2',
'ruby3.3',
],
},
awsLambdaRuntimeManagement: {
Expand Down
11 changes: 11 additions & 0 deletions test/unit/lib/plugins/aws/invoke-local/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,17 @@ describe('AwsInvokeLocal', () => {
).to.be.equal(true);
});

it('should call invokeLocalRuby when ruby3.3 runtime is set', async () => {
awsInvokeLocal.options.functionObj.runtime = 'ruby3.3';
await awsInvokeLocal.invokeLocal();
// NOTE: this is important so that tests on Windows won't fail
const runtime = process.platform === 'win32' ? 'ruby.exe' : 'ruby';
expect(invokeLocalRubyStub.calledOnce).to.be.equal(true);
expect(
invokeLocalRubyStub.calledWithExactly(runtime, 'handler', 'hello', {}, undefined)
).to.be.equal(true);
});

it('should call invokeLocalDocker if using runtime provided', async () => {
awsInvokeLocal.options.functionObj.runtime = 'provided';
awsInvokeLocal.options.functionObj.handler = 'handler.foobar';
Expand Down