一键导入
run-e2e-tests
Run E2E tests to verify complete user workflows like environment discovery, creation, and selection. Use this before releases or after major changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run E2E tests to verify complete user workflows like environment discovery, creation, and selection. Use this before releases or after major changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Critical patterns for cross-platform path handling in this VS Code extension. Windows vs POSIX path bugs are the #1 source of issues. Use this skill when reviewing or writing path-related code.
Generate a codebase health snapshot for technical debt tracking and planning. Analyzes git history, code complexity, debt markers, and dependencies to identify hotspots and refactoring priorities.
Environment manager-specific discovery patterns and known issues. Use when working on or reviewing environment discovery code for conda, poetry, pipenv, pyenv, or venv.
Run the mandatory pre-commit checks before committing code. Includes lint, type checking, and unit tests. MUST be run before every commit.
VS Code settings precedence rules and common pitfalls. Essential for any code that reads or writes settings. Covers getConfiguration scope, inspect() vs get(), and multi-workspace handling.
Debug a failing test using an iterative logging approach, then clean up and document the learning.
| name | run-e2e-tests |
| description | Run E2E tests to verify complete user workflows like environment discovery, creation, and selection. Use this before releases or after major changes. |
Run E2E (end-to-end) tests to verify complete user workflows work correctly.
Note: Run smoke tests first. If smoke tests fail, E2E tests will also fail.
| Action | Command |
|---|---|
| Run all E2E tests | npm run compile && npm run compile-tests && npm run e2e-test |
| Run specific test | npm run e2e-test -- --grep "discovers" |
| Debug in VS Code | Debug panel → "E2E Tests" → F5 |
Unlike unit tests (mocked) and smoke tests (quick checks), E2E tests:
They take longer (1-3 minutes) but catch integration issues.
npm run compile && npm run compile-tests && npm run e2e-test
Pass:
E2E: Environment Discovery
✓ Can trigger environment refresh
✓ Discovers at least one environment
✓ Environments have required properties
✓ Can get global environments
4 passing (45s)
Fail: Check error message and see Debugging section.
| Error | Cause | Fix |
|---|---|---|
No environments discovered | Python not installed | Install Python, verify it's on PATH |
Extension not found | Build failed | Run npm run compile |
API not available | Activation error | Debug with F5, check Debug Console |
Timeout exceeded | Slow operation or hang | Increase timeout or check for blocking code |
For detailed debugging: Debug panel → "E2E Tests" → F5
E2E tests have system requirements:
npm run compile before testsnpm run compile (webpack) before tests, not just npm run compile-tests (tsc)Create files in src/test/e2e/ with pattern *.e2e.test.ts:
import * as assert from 'assert';
import * as vscode from 'vscode';
import { waitForCondition } from '../testUtils';
import { ENVS_EXTENSION_ID } from '../constants';
suite('E2E: [Workflow Name]', function () {
this.timeout(120_000); // 2 minutes
let api: ExtensionApi;
suiteSetup(async function () {
const extension = vscode.extensions.getExtension(ENVS_EXTENSION_ID);
assert.ok(extension, 'Extension not found');
if (!extension.isActive) await extension.activate();
api = extension.exports;
});
test('[Test description]', async function () {
// Use real API (flat structure, not nested!)
// api.getEnvironments(), not api.environments.getEnvironments()
await waitForCondition(
async () => (await api.getEnvironments('all')).length > 0,
60_000,
'No environments found',
);
});
});
| File | Purpose |
|---|---|
src/test/e2e/environmentDiscovery.e2e.test.ts | Discovery workflow tests |
src/test/e2e/index.ts | Test runner entry point |
src/test/testUtils.ts | Utilities (waitForCondition, etc.) |
suiteTeardown.vscode-test/)