-
Notifications
You must be signed in to change notification settings - Fork 485
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 README #1971
base: dev
Are you sure you want to change the base?
Add README #1971
Conversation
|
||
The AWS Lambda Test Tool is an evolution of the previous AWS .NET Mock Lambda Test Tool, with several key improvements: | ||
|
||
### New Features |
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.
anything else worth mentioning here?
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 flow for loading Lambda functions that mimic's closer to the Lambda service. This solves many of the issues with the older tool when it came to loading dependencies.
- Ability to have multiple Lambda functions use the same instance of the test tool.
- UI refresh
- Support for integration with .NET Aspire (.NET Aspire Lambda Local Development Feature Tracker integrations-on-dotnet-aspire-for-aws#17)
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.
updated
|
||
The AWS Lambda Test Tool is an evolution of the previous AWS .NET Mock Lambda Test Tool, with several key improvements: | ||
|
||
### New Features |
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 flow for loading Lambda functions that mimic's closer to the Lambda service. This solves many of the issues with the older tool when it came to loading dependencies.
- Ability to have multiple Lambda functions use the same instance of the test tool.
- UI refresh
- Support for integration with .NET Aspire (.NET Aspire Lambda Local Development Feature Tracker integrations-on-dotnet-aspire-for-aws#17)
|
||
This tool is currently in preview and there are some known limitations. For questions and problems please open a GitHub issue in this repository. | ||
|
||
## Installing |
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.
Can you add a section before here that directs users to the Aspire experience something like
## .NET Aspire integration
The easiest way to get started using the features of the new test tool is with .NET Aspire. The integration takes care of installing the tool and provides .NET Aspire extension methods for configuring your Lambda functions and API Gateway emulator in the .NET Aspire AppHost. It avoids all steps list below for installing the tooling and setting up environment variables.
Check out the following tracker issue for information on the .NET Aspire integration and steps for getting started. https://github.com/aws/integrations-on-dotnet-aspire-for-aws/issues/17
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.
updated
|
||
``` | ||
|
||
## Running the Test Tool Project via an IDE |
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.
Not sure I understand the point of this section. We don't expect users to download our repository and run it unless they want to contribute to the repo. In that case this would be information to provide in our contributing guide.
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.
I will move this to the contribution guide
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.
i moved this to a separate contribution guide
} | ||
``` | ||
|
||
### 2. Configuration Files |
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.
I would organize this different and out the information about editing the launchsettings.json file under each of the options above. That way you can say for executable set the launchsetting to this. For class library set the launchsettings to this version. And be sure to explain the AWS_LAMBDA_RUNTIME_API
environment variable.
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.
i have updated this section and also fixed the launchSettings for the classlibrary and have also added a snippet explaining the AWS_LAMBDA_RUNTIME_API variable
|
||
**aws-lambda-tools-defaults.json** | ||
|
||
For top-level statements, your `aws-lambda-tools-defaults.json` should be: |
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.
As of right now our test tool or aspire integration don't do anything with aws-lambda-tools-defaults.json
so I wouldn't talk about here.
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.
Doesnt the function handler name need to match in order for api gateway to work with it? Let me double check 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.
maybe it was just the AWS_LAMBDA_RUNTIME_API
function name that needs to match. ill retest
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.
i removed this part
Tools/LambdaTestTool-v2/README.md
Outdated
"LambdaRuntimeClient_FunctionHandler": { | ||
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0", | ||
"commandName": "Executable", | ||
"commandLineArgs": "exec --depsfile ./MyLambdaFunction.deps.json --runtimeconfig ./MyLambdaFunction.runtimeconfig.json %USERPROFILE%/.dotnet/tools/.store/amazon.lambda.testtool/0.0.2-preview/amazon.lambda.testtool/0.0.2-preview/content/Amazon.Lambda.RuntimeSupport/net8.0/Amazon.Lambda.RuntimeSupport.dll MyLambdaFunction::MyLambdaFunction.Function::Add", |
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.
%USERPROFILE%/.dotnet/tools/.store/amazon.lambda.testtool/0.0.2-preview/amazon.lambda.testtool/0.0.2-preview/content/Amazon.Lambda.RuntimeSupport/net8.0/Amazon.Lambda.RuntimeSupport.dll MyLambdaFunction::MyLambdaFunction.Function::Add"
wasnt sure if there was an easy way to dynamically set the test tool version based on the current release number? or if there was a more simpler way to write 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.
I think that's the issue that norm was referring to the other day.
Tools/LambdaTestTool-v2/README.md
Outdated
|
||
## Comparison with Previous Test Tool | ||
|
||
The AWS Lambda Test Tool is an evolution of the previous AWS .NET Mock Lambda Test Tool, with several key improvements: |
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.
Add a link to the old version to provide better context.
Tools/LambdaTestTool-v2/README.md
Outdated
|
||
### New Features | ||
- **API Gateway Emulation**: Direct support for testing API Gateway integrations locally | ||
- New flow for loading Lambda functions that mimic's closer to the Lambda service. This solves many of the issues with the older tool when it came to loading dependencies. |
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.
The sentence reads a bit weird to me. Also there shouldn't be an "'s" in "mimics"
Tools/LambdaTestTool-v2/README.md
Outdated
This tool is currently in preview and there are some known limitations. For questions and problems please open a GitHub issue in this repository. | ||
|
||
## .NET Aspire integration | ||
The easiest way to get started using the features of the new test tool is with .NET Aspire. The integration takes care of installing the tool and provides .NET Aspire extension methods for configuring your Lambda functions and API Gateway emulator in the .NET Aspire AppHost. It avoids all steps list below for installing the tooling and setting up environment variables. |
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.
nit: "all steps listed below"
Tools/LambdaTestTool-v2/README.md
Outdated
|
||
## Installing | ||
|
||
The tool is distributed as .NET Global Tools via the NuGet packages. To install the tool execute the following command: |
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.
"as a .NET global tool". I don't see the need to say "via the NuGet packages"
Tools/LambdaTestTool-v2/README.md
Outdated
``` | ||
|
||
### API Gateway Emulator Mode | ||
Use this mode when you want to test Lambda functions through API Gateway endpoints. This mode requires additional configuration through environment variables. |
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.
You should mention that this alone wouldn't work because the Lambda Runtime API is not running
Tools/LambdaTestTool-v2/README.md
Outdated
|
||
Linux/macOS: | ||
```bash | ||
export APIGATEWAY_EMULATOR_ROUTE_CONFIG='{"LambdaResourceName":"AddLambdaFunction","HttpMethod":"Get","Path":"/add/{x}/{y}"}' |
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.
The command you gave above does not run the Lambda client so you need to add the endpoint to the env vars where the client is running.
Tools/LambdaTestTool-v2/README.md
Outdated
"LambdaRuntimeClient_FunctionHandler": { | ||
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0", | ||
"commandName": "Executable", | ||
"commandLineArgs": "exec --depsfile ./MyLambdaFunction.deps.json --runtimeconfig ./MyLambdaFunction.runtimeconfig.json %USERPROFILE%/.dotnet/tools/.store/amazon.lambda.testtool/0.0.2-preview/amazon.lambda.testtool/0.0.2-preview/content/Amazon.Lambda.RuntimeSupport/net8.0/Amazon.Lambda.RuntimeSupport.dll MyLambdaFunction::MyLambdaFunction.Function::Add", |
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.
I think that's the issue that norm was referring to the other day.
Tools/LambdaTestTool-v2/README.md
Outdated
There are three variables you may need to replace: | ||
|
||
1. The test tool version `0.0.2-preview` in the above path to the `Amazon.Lambda.RuntimeSupport.dll` should be updated to the current test tool version. | ||
2. The .net version `net8.0` should be the same version that your lambda project is using. |
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.
Mention that we are distributing multiple target frameworks so users arent tied to net8
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.
Fixed this and the other issues in latest commit
Issue #, if available: DOTNET-7956
Description of changes: Add README
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.