From 3d4309de5acafd7078e567f837ba80747db65951 Mon Sep 17 00:00:00 2001 From: Grant Robinson Date: Mon, 1 Feb 2021 16:41:30 -0700 Subject: [PATCH 1/2] Re-did the change after rebasing --- lib/validate.js | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/validate.js b/lib/validate.js index 80d8999cc..393eefebd 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -191,7 +191,10 @@ module.exports = { if (_.has(this.serverless, 'service.package') && this.serverless.service.package.individually) { this.multiCompile = true; this.serializedCompile = this.configuration.serializedCompile; - this.options.verbose && this.serverless.cli.log(`Using ${this.serializedCompile ? 'serialized' : 'multi'}-compile (individual packaging)`); + this.options.verbose && + this.serverless.cli.log( + `Using ${this.serializedCompile ? 'serialized' : 'multi'}-compile (individual packaging)` + ); if (this.webpackConfig.entry && !_.isEqual(this.webpackConfig.entry, entries)) { return BbPromise.reject( @@ -203,16 +206,23 @@ module.exports = { } // Lookup associated Serverless functions - const allEntryFunctions = _.map(this.serverless.service.getAllFunctions(), funcName => { - const func = this.serverless.service.getFunction(funcName); - const handler = func.handler; - const handlerFile = path.relative('.', getHandlerFile(handler)); - return { - handlerFile, - funcName, - func - }; - }); + const allEntryFunctions = _.map( + _.filter(this.serverless.service.getAllFunctions(), funcName => { + const func = this.serverless.service.getFunction(funcName); + const runtime = func.runtime || this.serverless.service.provider.runtime || 'nodejs'; + return runtime.match(/node/); + }), + funcName => { + const func = this.serverless.service.getFunction(funcName); + const handler = func.handler; + const handlerFile = path.relative('.', getHandlerFile(handler)); + return { + handlerFile, + funcName, + func + }; + } + ); this.entryFunctions = _.flatMap(entries, (value, key) => { const entry = path.relative('.', value); From b2cf9acad9828dd4f6fe9efa9d2d7d93a6f8c2b9 Mon Sep 17 00:00:00 2001 From: Grant Robinson Date: Tue, 2 Feb 2021 14:49:24 -0700 Subject: [PATCH 2/2] Added a new function config that exercises the issue from #644 Also fixed a typo in one of the names of the tests --- tests/validate.test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/validate.test.js b/tests/validate.test.js index 24c513aa9..a99da798d 100644 --- a/tests/validate.test.js +++ b/tests/validate.test.js @@ -468,6 +468,18 @@ describe('validate', () => { } ], runtime: 'java8' + }, + rustfunc: { + handler: 'my-rust-func', + runtime: 'rust', + events: [ + { + http: { + method: 'POST', + path: 'rustfuncpath' + } + } + ] } }; @@ -960,7 +972,7 @@ describe('validate', () => { }); describe('with skipped builds', () => { - it('should set `skipComile` to true if `options.build` is false', () => { + it('should set `skipCompile` to true if `options.build` is false', () => { const testConfig = { entry: 'test', output: {}