Skip to content

Migrate e2e test runner lambda to lambdas/ directory#4449

Draft
Copilot wants to merge 5 commits into
masterfrom
copilot/migrate-e2e-tests-lambda
Draft

Migrate e2e test runner lambda to lambdas/ directory#4449
Copilot wants to merge 5 commits into
masterfrom
copilot/migrate-e2e-tests-lambda

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

The E2E test runner lambda was defined in e2e-tests/ alongside the test code itself. This moves the lambda harness into lambdas/e2eTestRunner/ to unify it with the rest of the lambda infrastructure, while the test code stays in e2e-tests/ and is pulled in at Docker build time.

New: lambdas/e2eTestRunner/

  • src/index.ts — TypeScript port of e2e-tests/lambda/handler.js; spawns npm 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: replaceAll for backslash normalisation on Windows paths, and split -loglevel/silent as separate spawn args.
  • Dockerfile — Replaces e2e-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 lean ubuntu:jammy runtime.
  • docker-entrypoint.sh — Migrated from e2e-tests/docker-entrypoint.sh; copies Playwright browsers to writable /tmp before invoking aws-lambda-ric.
  • package.json, tsconfig.json, tsconfig.build.json, README.md — Standard lambdas workspace structure.

Updated

  • lambdas/package.json / lambdas/tsconfig.json — register e2eTestRunner as a workspace and project reference.
  • .github/workflows/e2e-lambda-deploy.yml — Deprecated; workflow_dispatch trigger removed and a deprecation notice added. The e2e lambda is now built and deployed via the standard Deploy Twilio Lambda and Deploy All Twilio Lambdas workflows.
  • .github/workflows/twilio-lambda-ci.ymle2eTestRunner added to the build matrix with conditional steps that use its custom lambdas/e2eTestRunner/Dockerfile and repo-root build context (all other lambdas continue to use the shared lambdas/Dockerfile).
  • .github/workflows/twilio-lambda-deploy.ymle2eTestRunner added to the lambda_path options.
  • .github/workflows/twilio-lambda-deploy-all.ymle2eTestRunner added to the deploy-all matrix.
  • .github/workflows/config/lambda-environment-region-map.jsone2eTestRunner entry added with the same region coverage as before (all regions per environment).

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

  1. Build the Docker image from the repo root:
    docker build -t e2e-test -f lambdas/e2eTestRunner/Dockerfile .
  2. Verify the Deploy Twilio Lambda workflow runs successfully with lambda_path = e2eTestRunner.
  3. Verify the Deploy All Twilio Lambdas workflow deploys e2eTestRunner alongside the other lambdas.
  4. Confirm deployed lambdas still function by triggering a test run — event shape is unchanged: { "testName": "login", "npmScript": "test" }.

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

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

Copilot AI and others added 3 commits June 4, 2026 12:03
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
Copilot AI requested a review from stephenhand June 4, 2026 12:09

@stephenhand stephenhand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Deprecate e2e-lambda-deploy. The e2e lambda should be deployed via the Deploy Twilio Lambda and Deploy All Twilio Lambdas workflows

Done in commit e2eTestRunner is now wired into both the Deploy Twilio Lambda and Deploy All Twilio Lambdas workflows:

  • e2e-lambda-deploy.ymlworkflow_dispatch trigger removed and a [DEPRECATED] notice added pointing to the standard pipelines.
  • twilio-lambda-ci.ymle2eTestRunner added to the build matrix; uses its own lambdas/e2eTestRunner/Dockerfile with repo-root context (needed to copy e2e-tests/), while all other lambdas continue to use the shared lambdas/Dockerfile.
  • lambda-environment-region-map.jsone2eTestRunner entry added with the same region coverage as before (all regions per environment).
  • twilio-lambda-deploy.yml / twilio-lambda-deploy-all.ymle2eTestRunner added to the options/matrix.

Copilot AI requested a review from stephenhand June 4, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate lambda to run e2e tests to same location & infra stack as other lambdas

2 participants