run-cli-e2e-locally
Skill646 starsChanged 24 days agoMITView on GitHub
Run the CLI E2E tests locally using your own user credentials instead of a service principal. Use when: run e2e locally, run cli tests, test with my credentials, local e2e, e2e user auth, run fabric tests locally.
- Reads credentials
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Create packages/tools/cli-e2e/.env (this file is gitignored):
- Distinctive: line 40
If the user doesn't know their tenant ID, suggest:
- Very specific: line 58
If no valid user session exists, it automatically runs rayfin login --tenant <E2E_TENANT_ID> which opens the browser for interactive …
- Distinctive: line 59
After authenticating once, subsequent test runs reuse the cached session without prompting again.
- Very specific: line 113
When E2E_AUTH_MODE=user, it checks rayfin login status output.
- Very specific: line 114
If not signed in as a user, it triggers rayfin login --tenant <E2E_TENANT_ID> (opens browser).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Help a developer run the CLI E2E tests locally using their own Azure AD credentials.
Prerequisites:
- The repo is cloned and Rush dependencies are installed (
rush update) - The CLI and E2E packages are built (
rush build --to rayfin-cli-e2e) - The user has an Azure AD account with access to the target Fabric workspace
Steps
1. Create the local environment file
Create packages/tools/cli-e2e/.env (this file is gitignored):
E2E_AUTH_MODE=user
E2E_ENVIRONMENT=daily
E2E_TENANT_ID=<your-tenant-id>
E2E_CLI_SOURCE=source
USE_LOCAL_PACKAGES=true
RAYFIN_E2E_WORKSPACE_NAME=DO_NOT_DELETE_AppDev_E2E_Workspace
RAYFIN_TELEMETRY_OPTOUT=1
RAYFIN_ENCRYPTION_FALLBACK_ENABLED=trueReplace <your-tenant-id> with the user's Azure AD tenant ID.
If the user doesn't know their tenant ID, suggest:
rayfin login statusor check the Azure Portal under Microsoft Entra ID → Overview → Tenant ID.
2. Run the tests
From packages/tools/cli-e2e:
rushx test:e2eLogin is automatic.
The test suite includes a globalSetup that checks for an existing user session before tests run.
If no valid user session exists, it automatically runs rayfin login --tenant <E2E_TENANT_ID> which opens the browser for interactive sign-in.
After authenticating once, subsequent test runs reuse the cached session without prompting again.
To run a specific test file:
rushx test:e2e -- src/init/init.test.tsTo run with coverage:
rushx test:e2e:coverageTo run in watch mode during development:
rushx test:e2e:watch3. Run the Playwright browser E2E tests
First install Playwright browsers (one-time):
npx playwright install chromiumThen run the browser tests:
rushx test:e2e:browserNote: The browser tests deploy to a Fabric workspace and navigate to the hosted URL.
They require the user's account to have Contributor access to the DO_NOT_DELETE_AppDev_E2E_Workspace workspace.
The Playwright tests do not use the Vitest globalSetup, so the user must have a valid session from a prior rushx test:e2e run or manual rayfin login --tenant <id>.
4. Troubleshooting
| Symptom | Fix |
E2E_AUTH_MODE=user requires E2E_TENANT_ID to be set | Fill in E2E_TENANT_ID in your .env file |
Interactive login failed + browser did not open | Run manually: rayfin login --tenant <id> |
Silent token acquisition failed | Token expired — re-run rayfin login --tenant <id> or delete ~/.rayfin/auth.json and retry |
Workspace not found | Verify your account has access to DO_NOT_DELETE_AppDev_E2E_Workspace in the daily Fabric environment |
Tests skip with Skipped: authMode === 'user' | Expected — SP-specific tests are skipped in user mode |
Tests skip with data-client tests require SP credentials | Expected — data-client tests need SP secrets |
| Keychain errors (WSL/containers) | Set RAYFIN_ENCRYPTION_FALLBACK_ENABLED=true in .env |
| Windows libuv assertion crash during login | Harmless — the globalSetup checks CLI output content, not exit code |
How It Works
- Automatic login via globalSetup: The Vitest config references
src/global-setup.tswhich runs before all tests. WhenE2E_AUTH_MODE=user, it checksrayfin login statusoutput. If not signed in as a user, it triggersrayfin login --tenant <E2E_TENANT_ID>(opens browser). On subsequent runs, the cached session is reused and login is skipped. - Output-based detection: On Windows,
rayfin loginmay crash during process cleanup (libuv assertion) even after success. The setup checks for"Signed in successfully"in stdout rather than relying on exit code. - Auth state sharing: CLI commands in tests inherit the user's auth from
~/.rayfin/auth.json. Direct Fabric API calls acquire a token silently from the MSAL cache via the CLI'sgetAuthenticatedToken()function. - Test skipping: Service principal-specific tests (SP login, SP logout) are automatically skipped via
it.skipIf(authMode === 'user'). - CI isolation: CI always sets
E2E_AUTH_MODE=spwith pipeline secrets. Local.envfiles are gitignored and never affect CI.
In this repository76 other files it gives its agents.
- common/config/typedoc/AGENTS.mdAGENTS.md
- docs/site/AGENTS.mdAGENTS.md
- .github/skills/react-best-practices/AGENTS.mdAGENTS.md
- packages/docgen/AGENTS.mdAGENTS.md
- packages/guide/AGENTS.mdAGENTS.md
- packages/host-docs/AGENTS.mdAGENTS.md
- packages/tools/AGENTS.mdAGENTS.md
- packages/tools/cli/AGENTS.mdAGENTS.md
- packages/tools/cli/assets/agent-files/AGENTS.mdAGENTS.md
- packages/tools/common/AGENTS.mdAGENTS.md
- packages/tools/docs-lib/AGENTS.mdAGENTS.md
- packages/tools/mcp/AGENTS.mdAGENTS.md
- packages/tools/vscode/AGENTS.mdAGENTS.md
- packages/typescript-sdk/AGENTS.mdAGENTS.md
- packages/typescript-sdk/auth/AGENTS.mdAGENTS.md
- packages/typescript-sdk/core/AGENTS.mdAGENTS.md
- packages/typescript-sdk/data/AGENTS.mdAGENTS.md
- packages/typescript-sdk/storage/AGENTS.mdAGENTS.md
- packages/udf/udf-worker-extension/AGENTS.mdAGENTS.md
- samples/data-app/AGENTS.mdAGENTS.md
- samples/getting-started-auth/AGENTS.mdAGENTS.md
- samples/notes-app/AGENTS.mdAGENTS.md
- samples/todo-app/AGENTS.mdAGENTS.md
- samples/universal-app/template/AGENTS.mdAGENTS.md
- samples/welcome-app-react-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-react-no-auth/AGENTS.mdAGENTS.md
- samples/welcome-app-typescript/AGENTS.mdAGENTS.md
- hotfix-releaseSkill
- launch-vscode-extensionSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- privacy-dfdSkill
- rayfin-cli-uxSkill
- vercel-react-best-practicesSkill
- react-clean-architectureSkill
- vscode-react-webview-architectureSkill
- vscode-webview-trpc-messagingSkill
- rayfin-connectorsSkill
- rayfin-functionsSkill
- rayfinSkill
- rayfin-storageSkill
- rayfin-getting-startedSkill
- app-designSkill
- app-validationSkill
- dax-authoringSkill
- fabric-cliSkill
- fabric-sdkSkill
- playwright-cliSkill
- query-designSkill
- schema-discoverySkill
- visualsSkill
- analyticsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

