-
Notifications
You must be signed in to change notification settings - Fork 822
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
fix: dotnet lambda templates compilation issues #11562
Conversation
packages/amplify-dotnet-function-template-provider/src/utils/dynamoDBWalkthrough.ts
Outdated
Show resolved
Hide resolved
}); // will throw if successString is not in output | ||
}); | ||
|
||
it('add dotnet crud function and invoke in the cloud', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crud template is not able to use amplify mock function
. it requires ddb table reference at runtime. Hence this test pushes and calls real lambda.
expect(JSON.parse(response.Payload.toString())).toEqual(helloWorldSuccessObj); | ||
}); | ||
|
||
it('add dotnet serverless function and mock locally', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new coverage is base on mock as it compiles and runs dotnet code locally. this is best effort, some templates like crud don't work locally.
@@ -1,7 +1,7 @@ | |||
{ | |||
"body": null, | |||
"resource": "<%= props.functionTemplate.parameters.path %>/{proxy+}", | |||
"path": "<%= props.functionTemplate.parameters.path %>/", | |||
"path": "<%= props.functionTemplate.parameters.path %>/<%= props.functionTemplate.parameters.database.tableDefinition.partitionKeyName %>:foo", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we don't use this event in test I was playing a bit with this in aws console to invoke resulting lambda.
previous version was leading to error response asking for missing path parameter - this change fixes this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left 1 suggestion for consideration, but not blocking
packages/amplify-dotnet-function-template-provider/src/utils/dynamoDBWalkthrough.ts
Outdated
Show resolved
Hide resolved
* fix: fix dotnet lambda templates * fix: fix naming * fix: split function_3 * fix: cover triggers * fix: fix tests * fix: fix tests * fix: add kinesis test * chore: pr feedback
Description of changes
This PR fixes existing dotnet templates and makes sure that they work (i.e. compile and return something).
Current samples (except Hello World) don't compile due to dependency conflicts.
![image](https://user-images.githubusercontent.com/5849952/206536613-39235bb4-05a3-4672-ae7a-010262f69a10.png)
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.