docs: add E2E local test run instructions to samples/AGENTS.md#8497
docs: add E2E local test run instructions to samples/AGENTS.md#8497hectormmg wants to merge 1 commit into
Conversation
Document how to generate the .env file and lab certificate, and how to run all E2E tests, a specific sample's tests, or a specific test file for VanillaJSTestApp2.0. Also note the format:fix requirement before committing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds local end-to-end (E2E) testing run instructions to the samples agent/developer guidance documentation so contributors can run sample E2E suites without hunting through individual sample READMEs.
Changes:
- Documents how
.envis discovered/loaded for lab-authenticated E2E runs. - Adds commands for running VanillaJSTestApp2.0 E2E tests (all tests, per-sample filtering, and per-test-file filtering).
- Adds a pre-commit reminder to run
npm run format:fixfrom relevant library packages.
| The `.env` must contain: | ||
|
|
||
| ``` | ||
| AZURE_CLIENT_ID=... | ||
| AZURE_CLIENT_CERTIFICATE_PATH=... | ||
| AZURE_TENANT_ID=... | ||
| SESSION_SECRET=... | ||
| ``` |
There was a problem hiding this comment.
The .env list here states SESSION_SECRET is required for E2E tests, but samples/e2eTestUtils/src/LabClient.ts only relies on AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_CERTIFICATE_PATH for lab auth, and VanillaJSTestApp2.0 doesn’t reference SESSION_SECRET. Consider rewording to distinguish (a) variables required for lab authentication vs (b) additional variables that some samples (e.g., msal-node express-session samples) may require.
| SESSION_SECRET=... | ||
| ``` | ||
|
|
||
| If the file is missing, generate it by running `gen_env.ps1` (Windows) or `gen_env.sh` (bash) from either the 1P root (`C:\src\msal-javascript-1p\`) or the 3P repo root. These scripts require `az` CLI access to the `msidlabs` KeyVault and will produce the `.env`, `LabCert.pem`, and `LabCert.pfx` files. |
There was a problem hiding this comment.
gen_env.sh is described as a bash alternative, but in this repo it simply runs Powershell.exe -file gen_env.ps1, so it still requires Windows/WSL (or a PowerShell install that provides Powershell.exe). Clarify the platform/runtime requirements for gen_env.sh so non-Windows users don’t assume it’s a native bash implementation.
| If the file is missing, generate it by running `gen_env.ps1` (Windows) or `gen_env.sh` (bash) from either the 1P root (`C:\src\msal-javascript-1p\`) or the 3P repo root. These scripts require `az` CLI access to the `msidlabs` KeyVault and will produce the `.env`, `LabCert.pem`, and `LabCert.pfx` files. | |
| If the file is missing, generate it by running `gen_env.ps1` (Windows) or `gen_env.sh` (a bash wrapper that invokes `gen_env.ps1` and requires `Powershell.exe` to be available, e.g., on Windows or WSL) from either the 1P root (`C:\src\msal-javascript-1p\`) or the 3P repo root. These scripts require `az` CLI access to the `msidlabs` KeyVault and will produce the `.env`, `LabCert.pem`, and `LabCert.pfx` files. |
|
Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft. |
Summary
Adds a new Running E2E Tests Locally section to \samples/AGENTS.md\ so AI agents (and developers) have clear, self-contained instructions for running E2E tests without needing to dig through individual sample READMEs or setup scripts.
What's documented
pm run test:e2e)
pm run format:fix\ requirement before committing
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com