Skip to content

Commit a492d02

Browse files
authored
Update dev docs (#208)
1 parent 80bb033 commit a492d02

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

DEVELOPMENT.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Packaging DotNet 8 for Lambda
21

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
42

53
# Testing Lambda Locally
64

@@ -15,42 +13,60 @@ https://github.com/aws/aws-lambda-dotnet/tree/master/Tools/LambdaTestTool
1513
* [LambdaTestTool for DotNet 8](https://github.com/aws/aws-lambda-dotnet/tree/master/Tools/LambdaTestTool)
1614
* `dotnet tool install -g Amazon.Lambda.TestTool-8.0`
1715
* `dotnet lambda-test-tool-8.0 --help`
16+
* [Rust](https://www.rust-lang.org/tools/install)
1817

1918
## Install Lambda Templates
2019

2120
```sh
2221
dotnet new -i Amazon.Lambda.Templates
2322
```
2423

25-
## Building
24+
## Building and Running Unit Tests
25+
26+
### Router - DotNet
2627

2728
```sh
29+
# Build
2830
dotnet build
29-
```
30-
31-
## Running Locally
3231

33-
### DotNet Router
32+
# Run Unit Tests without Coverage Report
33+
dotnet test
3434

35-
```sh
36-
dotnet run --project PwrDrvr.LambdaDispatch.Router
35+
# One Time Install of ReportGenerator
36+
dotnet tool install --global dotnet-reportgenerator-globaltool
3737

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
3940
```
4041

41-
### Rust Lambda Extension
42+
## Extension - Rust
4243

4344
```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
4647

47-
### DotNet Lambda Extension
48+
# Run Unit Tests
49+
cargo test
4850

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
5156
```
5257

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
5470

5571
- https://github.com/mozilla/grcov
5672
- Runs into a problem with zip not being supported by the toolchain

extension/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ rustls-pemfile = "2.1.2"
6060
tower-test = "0.4.0"
6161
tokio-test = "0.4.4"
6262
axum-extra = { version = "0.9.3", features = ["async-read-body"] }
63-
lazy_static = "1.4.0"
63+
lazy_static = "1.4.0"

0 commit comments

Comments
 (0)