Skip to content

Improve Lambda Test Tool v2 getting-started docs and add samples - #2494

Open
GarrettBeatty wants to merge 3 commits into
devfrom
docs/testtool-v2-getting-started
Open

Improve Lambda Test Tool v2 getting-started docs and add samples#2494
GarrettBeatty wants to merge 3 commits into
devfrom
docs/testtool-v2-getting-started

Conversation

@GarrettBeatty

@GarrettBeatty GarrettBeatty commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves the getting-started experience for the Lambda Test Tool v2. Based on a full review of the README against the actual source, this fixes copy-paste-breaking inaccuracies, documents features that shipped but were undocumented, restructures the doc to be usage-first, and adds runnable sample projects. Every sample and documented flow was verified end-to-end against the installed tool (v0.15.0).

README changes

  • Quick Start at the top: install → run → invoke → result, consistently using HttpV2.
  • Prerequisites section (.NET 8+ SDK, ~/.dotnet/tools on PATH, verify step).
  • Correctness fixes:
    • API Gateway route Endpoint now uses the base URL (http://localhost:5050) instead of wrongly appending the function name.
    • Emulator-mode examples are consistently HttpV2 to match the sample handler (previously Rest, which yields HTTP 502); casing normalized (HttpV2, Get).
    • Corrected/completed the command-line options table; removed the duplicate H1, stale version note, and duplicated sentence.
  • Newly documented features: the info command, SQS and DynamoDB Streams event sources, the web UI invoke workflow, the 58 built-in sample events, saved requests, and theming.
  • Added Troubleshooting and Known Limitations sections.
  • Class-library setup (Option 2) now leads with a command-line dotnet exec path and keeps the IDE launch profile as a secondary option, with the dotnet run vs IDE caveat called out.

Sample projects (new, under Tools/LambdaTestTool-v2/samples/)

Sample Shows
AddFunctionTopLevel Quick Start: top-level function behind the API Gateway emulator
AddFunctionClassLibrary Class-library function, launchable from CLI or IDE
SQSProcessor SQSEvent handler (SQS event source or built-in sqs.json)
ToUpperFunction Minimal zero-dependency function for the web UI

Each has its own README and a committed launch profile (added a .gitignore exception so the sample launchSettings.json files are tracked).

Verification

Installed the tool (amazon.lambda.testtool 0.15.0) and ran each sample:

  • AddFunctionTopLevelcurl /add/5/38 (HTTP 200)
  • AddFunctionClassLibrary — verified both the .store runtime-support path and a token-free CLI dotnet exec launch → 8 (HTTP 200)
  • ToUpperFunction"hello world""HELLO WORLD" (HTTP 200)
  • SQSProcessor — built-in sqs.json event → processed "Hello from SQS!" (HTTP 200)

Rewrite the LambdaTestTool-v2 README to be usage-first and fix several
copy-paste-breaking inaccuracies:

- Add a top-of-page Quick Start (install -> run -> invoke -> result) and
  a Prerequisites section (.NET 8+, PATH for global tools, verify step).
- Fix the API Gateway route Endpoint example to use the base URL
  (http://localhost:5050) instead of appending the function name.
- Make emulator-mode examples consistently HttpV2 to match the sample
  handler (avoids HTTP 502) and normalize Get/HttpV2 casing.
- Correct and complete the command-line options table; document the
  info command, SQS and DynamoDB Streams event sources, the web UI
  workflow, built-in sample events, saved requests, and theming.
- Add Troubleshooting and Known Limitations sections; remove the
  duplicate H1 and stale version note; reframe the Aspire pointer.

Add runnable sample projects under samples/ (AddFunctionTopLevel,
AddFunctionClassLibrary, SQSProcessor, ToUpperFunction), each with its
own README and committed launch profile. Add a .gitignore exception so
the samples' launchSettings.json files are tracked.
Verified end-to-end that a class-library Lambda function can run from the
command line (not just an IDE). The Executable launch profile relies on the
IDE expanding $(Configuration) and resolving workingDirectory, which plain
'dotnet run --launch-profile' does not do.

- Add CopyLocalLockFileAssemblies to the AddFunctionClassLibrary sample so
  its NuGet dependencies are copied to the build output, making the function
  self-contained for a command-line 'dotnet exec' launch.
- Restructure README Option 2 to lead with the command-line 'dotnet exec'
  steps and keep the IDE launch profile as a secondary option, noting the
  dotnet-run-vs-IDE caveat.
- Rewrite the sample README with both command-line and IDE launch paths.
# AWS Lambda Test Tool

## Overview
The AWS Lambda Test Tool provides local testing capabilities for .NET Lambda functions with support for both Lambda emulation and API Gateway emulation. This tool allows developers to test their Lambda functions locally in three different modes:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had go through here and correct a bunch of things. i then asked it to go through the readme and follow the steps and see if it could run the test tool etc following the steps in the readme and it could

@GarrettBeatty
GarrettBeatty marked this pull request as ready for review July 23, 2026 01:32
@GarrettBeatty
GarrettBeatty requested review from a team as code owners July 23, 2026 01:32
@GarrettBeatty
GarrettBeatty requested a review from normj July 23, 2026 01:32
@GarrettBeatty GarrettBeatty added the Release Not Needed Add this label if a PR does not need to be released. label Jul 23, 2026
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update to net 10. same in other places

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the getting-started experience for Lambda Test Tool v2 by restructuring and correcting the main README and adding runnable sample projects under Tools/LambdaTestTool-v2/samples/ to demonstrate common local-testing workflows (Lambda emulator, API Gateway emulator, and SQS).

Changes:

  • Reworked Tools/LambdaTestTool-v2/README.md into a usage-first guide (Quick Start, prerequisites, web UI, event sources, troubleshooting/limitations).
  • Added multiple minimal, runnable sample projects (API Gateway HttpV2, class-library launch, SQS handler, and UI-only string handler), each with its own README and launch profile.
  • Updated .gitignore to ensure sample launchSettings.json files are tracked.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Tools/LambdaTestTool-v2/README.md Major documentation restructure + new feature coverage and troubleshooting/limitations sections.
Tools/LambdaTestTool-v2/samples/README.md Index of available sample projects and prerequisites.
Tools/LambdaTestTool-v2/samples/AddFunctionTopLevel/AddFunctionTopLevel.csproj New net8 sample project for Quick Start flow.
Tools/LambdaTestTool-v2/samples/AddFunctionTopLevel/Program.cs Top-level HttpV2 API Gateway handler sample implementation.
Tools/LambdaTestTool-v2/samples/AddFunctionTopLevel/README.md Step-by-step run/invoke instructions for the top-level API Gateway sample.
Tools/LambdaTestTool-v2/samples/AddFunctionTopLevel/Properties/launchSettings.json Launch profile wiring AWS_LAMBDA_RUNTIME_API for the sample.
Tools/LambdaTestTool-v2/samples/AddFunctionClassLibrary/AddFunctionClassLibrary.csproj New net8 class-library sample project configuration (deps/runtimeconfig + local deps copy).
Tools/LambdaTestTool-v2/samples/AddFunctionClassLibrary/Function.cs Class-library handler sample implementation.
Tools/LambdaTestTool-v2/samples/AddFunctionClassLibrary/README.md CLI + IDE instructions for launching a class-library handler under the test tool’s runtime support shim.
Tools/LambdaTestTool-v2/samples/AddFunctionClassLibrary/Properties/launchSettings.json IDE launch profile wrapping dotnet exec for the shim-based class-library flow.
Tools/LambdaTestTool-v2/samples/SQSProcessor/SQSProcessor.csproj New net8 SQS sample project.
Tools/LambdaTestTool-v2/samples/SQSProcessor/Program.cs SQSEvent handler sample implementation.
Tools/LambdaTestTool-v2/samples/SQSProcessor/README.md Instructions for testing with built-in sqs.json and with a real queue via event-source polling.
Tools/LambdaTestTool-v2/samples/SQSProcessor/Properties/launchSettings.json Launch profile wiring AWS_LAMBDA_RUNTIME_API for the sample.
Tools/LambdaTestTool-v2/samples/ToUpperFunction/ToUpperFunction.csproj New net8 UI-only string handler sample project.
Tools/LambdaTestTool-v2/samples/ToUpperFunction/Program.cs Minimal string-to-upper handler using runtime support bootstrap.
Tools/LambdaTestTool-v2/samples/ToUpperFunction/README.md Instructions focused on invoking via the web UI.
Tools/LambdaTestTool-v2/samples/ToUpperFunction/Properties/launchSettings.json Launch profile wiring AWS_LAMBDA_RUNTIME_API for the sample.
.gitignore Adds an exception rule so sample launchSettings.json files are committed.
Comments suppressed due to low confidence (1)

Tools/LambdaTestTool-v2/README.md:226

  • The options table lists a default value for --api-gateway-emulator-mode, but the CLI requires this option to be explicitly set whenever --api-gateway-emulator-port / --api-gateway-emulator-https-port are provided. Marking a default here can lead readers to omit the option and hit an error.
| `--api-gateway-emulator-mode <MODE>` | API Gateway mode: `Rest`, `HttpV1`, or `HttpV2`. | `HttpV2` |

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tools/LambdaTestTool-v2/README.md Outdated
Comment thread Tools/LambdaTestTool-v2/README.md Outdated
Comment thread Tools/LambdaTestTool-v2/README.md
@GarrettBeatty

Copy link
Copy Markdown
Contributor Author

fixed copilot comments

@@ -0,0 +1,78 @@
# AddFunctionClassLibrary

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove this file, not needed for this sample and I assume just created from the new project template.

@@ -0,0 +1,38 @@
# AddFunctionTopLevel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove this file, not needed for this sample and I assume just created from the new project template.

@@ -0,0 +1,39 @@
# SQSProcessor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove this file, not needed for this sample and I assume just created from the new project template.

@@ -0,0 +1,27 @@
# ToUpperFunction

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove this file, not needed for this sample and I assume just created from the new project template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Not Needed Add this label if a PR does not need to be released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants