@@ -21,9 +21,15 @@ runs `serverless package` to produce a CloudFormation template, and
2121asserts on the generated resources.
2222
2323Critically, ** these tests do not deploy anything to AWS** — they only
24- exercise the synthesis path. That makes them fast (~ 3s per fixture),
25- fork-safe (no AWS credentials required), and suitable to run on every
26- PR.
24+ exercise the synthesis path. That makes them fast (~ 3s per fixture)
25+ and suitable to run on every PR. No AWS credentials are required.
26+
27+ > ** Serverless Framework v4 requires authentication.** As of v4, every
28+ > CLI invocation (including the ` serverless package ` these tests run)
29+ > must be authenticated, even though nothing is deployed. You need a
30+ > Serverless ** Access Key** or ** License Key** — free for individual
31+ > developers and organizations under the revenue threshold. See
32+ > [ Authentication] ( #authentication-serverless-v4 ) below.
2733
2834## Running locally
2935
@@ -38,6 +44,24 @@ npm run test:all
3844npx jest --config jest.e2e.config.ts basic-api-key
3945```
4046
47+ ### Authentication (Serverless v4)
48+
49+ Set a Serverless Access Key (or License Key) before running, otherwise
50+ the spawned ` serverless package ` will fail / prompt for login:
51+
52+ ``` bash
53+ # One-time interactive login (writes a key to your machine)
54+ npx serverless login
55+
56+ # …or set an explicit key for this shell / CI
57+ export SERVERLESS_ACCESS_KEY=... # from Dashboard > Settings > Access Keys
58+ # or
59+ export SERVERLESS_LICENSE_KEY=...
60+ ```
61+
62+ The harness passes the current environment through to the CLI, so any
63+ of the above is sufficient.
64+
4165## Adding a new test
4266
43671 . Create a new example under ` examples/<feature>/ ` :
@@ -90,3 +114,7 @@ A dedicated `e2e` job in `.github/workflows/ci.yml` runs the full
90114synthesis test suite on every PR and push to ` master ` or ` alpha ` . It
91115runs after the unit-test matrix completes successfully (no point
92116running E2E if unit tests already failed).
117+
118+ The job reads ` SERVERLESS_ACCESS_KEY ` from repository secrets to
119+ authenticate the Serverless v4 CLI. Add it under
120+ ** Settings > Secrets and variables > Actions** before this job can pass.
0 commit comments