Skip to content

docs: add E2E local test run instructions to samples/AGENTS.md#8497

Open
hectormmg wants to merge 1 commit into
devfrom
docs/e2e-local-test-instructions
Open

docs: add E2E local test run instructions to samples/AGENTS.md#8497
hectormmg wants to merge 1 commit into
devfrom
docs/e2e-local-test-instructions

Conversation

@hectormmg
Copy link
Copy Markdown
Member

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

  • How to generate the .env\ file and lab certificate (\gen_env.ps1\ / \gen_env.sh) and where the file is resolved from
  • Running all E2E tests for VanillaJSTestApp2.0 (
    pm run test:e2e)
  • Running a specific sample's tests (--sample\ flag)
  • Running a specific test file (--testPathPattern\ flag)

  • pm run format:fix\ requirement before committing

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
@hectormmg hectormmg requested a review from a team as a code owner April 1, 2026 06:21
Copilot AI review requested due to automatic review settings April 1, 2026 06:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 .env is 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:fix from relevant library packages.

Comment thread samples/AGENTS.md
Comment on lines +27 to +34
The `.env` must contain:

```
AZURE_CLIENT_ID=...
AZURE_CLIENT_CERTIFICATE_PATH=...
AZURE_TENANT_ID=...
SESSION_SECRET=...
```
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread samples/AGENTS.md
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.
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Attention 👋 Awaiting response from the MSAL.js team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants