sam-goodwin / punchcard

Type-safe AWS infrastructure.
Apache License 2.0
507 stars 20 forks source link

allows overriding the Node runtime for lambda, closes #56 #62

Closed pocesar closed 4 years ago

pocesar commented 4 years ago
pocesar commented 4 years ago

I don't know what is failing on the test, but I guess something checks for the runtime. the PR isn't complete, I need to remove the omitted 'runtime' from other places as well like executor

sam-goodwin commented 4 years ago

Fixes: https://github.com/punchcard/punchcard/issues/56

sam-goodwin commented 4 years ago

Looks like our tests use inline code to simplify which are breaking when we default to node 12. We should update the tests to use an asset.

FAIL test/lambda/test.function.js 
  ● Function › should install clients in context 

    Inline source not allowed for nodejs12.x 

      84 |  
      85 |     this.resource = scope.chain(scope => (props.functionProps || Build.of({})).map(functionProps => { 
    > 86 |       const lambdaFunction = new lambda.Function(scope, id, { 
         |                              ^ 
      87 |         runtime: lambda.Runtime.NODEJS_12_X, 
      88 |         ...functionProps, 
      89 |         code: Code.tryGetCode(scope) || Code.mock,
pocesar commented 4 years ago

I'm reverting changing the default runtime, just leaving the possibility to override it

sam-goodwin commented 4 years ago

Closed by: https://github.com/punchcard/punchcard/commit/91df5aeaeeb66609d64f8b491dac032b0094d8c4