Migrate e2e test runner lambda to lambdas/ directory#4449
Draft
Copilot wants to merge 5 commits into
Draft
Conversation
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
…replacement Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate lambda to run E2E tests to lambdas directory
Migrate e2e test runner lambda to lambdas/ directory
Jun 4, 2026
stephenhand
requested changes
Jun 4, 2026
stephenhand
left a comment
Collaborator
There was a problem hiding this comment.
Deprecate e2e-lambda-deploy. The e2e lambda should be deployed via the Deploy Twilio Lambda and Deploy All Twilio Lambdas workflows
…workflows - Add e2eTestRunner to twilio-lambda-ci.yml build matrix with conditional build steps that use its custom Dockerfile (lambdas/e2eTestRunner/Dockerfile) and repo-root build context instead of the shared lambdas/Dockerfile - Add e2eTestRunner to lambda-environment-region-map.json with same regions as the previous e2e-lambda-deploy (dev/staging/prod all regions) - Add e2eTestRunner to Deploy Twilio Lambda workflow options - Add e2eTestRunner to Deploy All Twilio Lambdas workflow matrix - Deprecate e2e-lambda-deploy.yml: remove workflow_dispatch trigger and add deprecation notice pointing to the standard deploy workflows Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
Contributor
Author
Done in commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The E2E test runner lambda was defined in
e2e-tests/alongside the test code itself. This moves the lambda harness intolambdas/e2eTestRunner/to unify it with the rest of the lambda infrastructure, while the test code stays ine2e-tests/and is pulled in at Docker build time.New:
lambdas/e2eTestRunner/src/index.ts— TypeScript port ofe2e-tests/lambda/handler.js; spawnsnpm run <script>in/app/e2e-tests, then uploads artifacts (screenshots, videos, JUnit XML) to S3 using SSM-resolved bucket/region. Also fixes two bugs from the original JS:replaceAllfor backslash normalisation on Windows paths, and split-loglevel/silentas separate spawn args.Dockerfile— Replacese2e-tests/Dockerfile. Two-stage build: Playwright base image (mcr.microsoft.com/playwright:v1.30.0-jammy) to install browser deps + compile the TypeScript handler via the lambdas workspace, then copy into a leanubuntu:jammyruntime.docker-entrypoint.sh— Migrated frome2e-tests/docker-entrypoint.sh; copies Playwright browsers to writable/tmpbefore invokingaws-lambda-ric.package.json,tsconfig.json,tsconfig.build.json,README.md— Standard lambdas workspace structure.Updated
lambdas/package.json/lambdas/tsconfig.json— registere2eTestRunneras a workspace and project reference..github/workflows/e2e-lambda-deploy.yml— Deprecated;workflow_dispatchtrigger removed and a deprecation notice added. The e2e lambda is now built and deployed via the standardDeploy Twilio LambdaandDeploy All Twilio Lambdasworkflows..github/workflows/twilio-lambda-ci.yml—e2eTestRunneradded to the build matrix with conditional steps that use its customlambdas/e2eTestRunner/Dockerfileand repo-root build context (all other lambdas continue to use the sharedlambdas/Dockerfile)..github/workflows/twilio-lambda-deploy.yml—e2eTestRunneradded to thelambda_pathoptions..github/workflows/twilio-lambda-deploy-all.yml—e2eTestRunneradded to the deploy-all matrix..github/workflows/config/lambda-environment-region-map.json—e2eTestRunnerentry added with the same region coverage as before (all regions per environment).Checklist
Other Related Issues
None
Verification steps
docker build -t e2e-test -f lambdas/e2eTestRunner/Dockerfile .Deploy Twilio Lambdaworkflow runs successfully withlambda_path = e2eTestRunner.Deploy All Twilio Lambdasworkflow deployse2eTestRunneralongside the other lambdas.{ "testName": "login", "npmScript": "test" }.AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P