1
- # Packaging DotNet 8 for Lambda
2
1
3
- https://coderjony.com/blogs/running-net-8-lambda-functions-on-aws-using-custom-runtime-and-lambda-internals-for-net-developers?sc_channel=sm&sc_campaign=Developer_Campaigns&sc_publisher=TWITTER&sc_geo=GLOBAL&sc_outcome=awareness&trk=Developer_Campaigns&linkId=250770379
4
2
5
3
# Testing Lambda Locally
6
4
@@ -15,42 +13,60 @@ https://github.com/aws/aws-lambda-dotnet/tree/master/Tools/LambdaTestTool
15
13
* [ LambdaTestTool for DotNet 8] ( https://github.com/aws/aws-lambda-dotnet/tree/master/Tools/LambdaTestTool )
16
14
* ` dotnet tool install -g Amazon.Lambda.TestTool-8.0 `
17
15
* ` dotnet lambda-test-tool-8.0 --help `
16
+ * [ Rust] ( https://www.rust-lang.org/tools/install )
18
17
19
18
## Install Lambda Templates
20
19
21
20
``` sh
22
21
dotnet new -i Amazon.Lambda.Templates
23
22
```
24
23
25
- ## Building
24
+ ## Building and Running Unit Tests
25
+
26
+ ### Router - DotNet
26
27
27
28
``` sh
29
+ # Build
28
30
dotnet build
29
- ```
30
-
31
- ## Running Locally
32
31
33
- ### DotNet Router
32
+ # Run Unit Tests without Coverage Report
33
+ dotnet test
34
34
35
- ``` sh
36
- dotnet run --project PwrDrvr.LambdaDispatch.Router
35
+ # One Time Install of ReportGenerator
36
+ dotnet tool install --global dotnet-reportgenerator-globaltool
37
37
38
- DOTNET_ThreadPool_UnfairSemaphoreSpinLimit=0 LAMBDA_DISPATCH_MaxConcurrentCount=10 LAMBDA_DISPATCH_AllowInsecureControlChannel=true LAMBDA_DISPATCH_PreferredControlChannelScheme=http LAMBDA_DISPATCH_FunctionName=dogs AWS_LAMBDA_SERVICE_URL=http://localhost:5051 AWS_REGION=us-east-2 AWS_ACCESS_KEY_ID=test-access-key-id AWS_SECRET_ACCESS_KEY=test-secret-access-key AWS_SESSION_TOKEN=test-session-token src/PwrDrvr.LambdaDispatch.Router/bin/Release/net8.0/PwrDrvr.LambdaDispatch.Router 2>&1 | tee router.log
38
+ # Run Unit Tests with HTML Coverage Report
39
+ dotnet test --collect:" XPlat Code Coverage" && reportgenerator " -reports:test/coverage/projects/PwrDrvr.LambdaDispatch.Router.Tests/coverage.opencover.xml" " -targetdir:test/coverage/html_report" -reporttypes:Html
39
40
```
40
41
41
- ### Rust Lambda Extension
42
+ ## Extension - Rust
42
43
43
44
``` sh
44
- LAMBDA_DISPATCH_RUNTIME=default_multi_thread LAMBDA_DISPATCH_FORCE_DEADLINE=60 AWS_LAMBDA_FUNCTION_VERSION= \$ LATEST AWS_LAMBDA_FUNCTION_MEMORY_SIZE=512 AWS_LAMBDA_FUNCTION_NAME=dogs AWS_LAMBDA_RUNTIME_API=localhost:5051 AWS_REGION=us-east-2 AWS_ACCESS_KEY_ID=test-access-key-id AWS_SECRET_ACCESS_KEY=test-secret-access-key AWS_SESSION_TOKEN=test-session-token cargo run --release --bin extension 2>&1 | tee extension.log
45
- ```
45
+ # Build
46
+ cargo build
46
47
47
- ### DotNet Lambda Extension
48
+ # Run Unit Tests
49
+ cargo test
48
50
49
- ``` sh
50
- DOTNET_ThreadPool_UnfairSemaphoreSpinLimit=0 AWS_LAMBDA_RUNTIME_API=localhost:5051 AWS_REGION=us-east-2 AWS_ACCESS_KEY_ID=test-access-key-id AWS_SECRET_ACCESS_KEY=test-secret-access-key AWS_SESSION_TOKEN=test-session-token src/PwrDrvr.LambdaDispatch.Extension/bin/Release/net8.0/bootstrap 2>&1 | tee extension.log
51
+ # One Time Install of llvm-cov
52
+ cargo install cargo-llvm-cov
53
+
54
+ # Run Unit Tests with Coverage Report
55
+ cargo llvm-cov --all-features --workspace --html
51
56
```
52
57
53
- ## Rust Unit Tests
58
+ ## Running Locally
59
+
60
+ See [ Development Current Commands] ( ./DEVELOPMENT-CURRENT-COMMANDS.md ) for command lines to bring everything up locally.
61
+
62
+
63
+ # Appendix
64
+
65
+ ## Packaging DotNet 8 for Lambda
66
+
67
+ https://coderjony.com/blogs/running-net-8-lambda-functions-on-aws-using-custom-runtime-and-lambda-internals-for-net-developers?sc_channel=sm&sc_campaign=Developer_Campaigns&sc_publisher=TWITTER&sc_geo=GLOBAL&sc_outcome=awareness&trk=Developer_Campaigns&linkId=250770379
68
+
69
+ ## Rust Unit Test Notes
54
70
55
71
- https://github.com/mozilla/grcov
56
72
- Runs into a problem with zip not being supported by the toolchain
0 commit comments