You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(e2e): route every state-touching CLI call through executeCliInScratch
Audit + harden of the e2e suite's isolation guarantees. The Phase 1
helper change pinned npm/pnpm/yarn/pip/cargo/gradle dirs into the
scratch HOME; this commit makes sure every test that COULD touch the
dev's filesystem, npm cache, real Socket account, or org-side state
actually USES that helper.
Files updated (per-file conversion of executeCliCommand →
executeCliInScratch for state-touching calls):
- scan.e2e.test.mts: all auth-required read calls (list/view/metadata/
report/diff) + the --org fake_org error paths now scratch.
- organization.e2e.test.mts: list/policy/quota, --org real / --org
trash, config-driven org resolution.
- package.e2e.test.mts: every score/shallow against the real API.
- analytics.e2e.test.mts: default/org/repo/time-window calls plus the
unknown-repo error path (which hits the API for validation).
- manifest.e2e.test.mts: every no-args generator invocation (auto,
conda, gradle, kotlin, scala) — the generators walk cwd looking
for build files; scratch cwd keeps them out of socket-cli/.
- repos.e2e.test.mts: read-only error paths + the destructive
round-trip (create / update / view / del + afterAll cleanup).
- config.e2e.test.mts: `config get defaultOrg` no longer reads the
dev's real config even with --config '{}' injection.
- package-managers.e2e.test.mts: npm info, npx cowsay, raw-npm info,
raw-npx cowsay, raw-npm (no args), cdxgen, all organization
dependencies API calls.
- audit-fix-ci.e2e.test.mts: audit-log no-args (real API hit).
- auth.e2e.test.mts: whoami.
- threat-feed.e2e.test.mts: every non-help/dry-run call.
What stays on executeCliCommand (intentional):
- --help / --dry-run calls (argparser short-circuits before any IO).
- Argparse-error checks like `analytics --whatnow` or `config` with
no subcommand (exit 2 before any IO).
- `oops` (no args, deliberate failure, no IO).
- The single beforeAll() read in organization.e2e that needs the
dev's real defaultOrg — uses `isolateConfig: false` explicitly.
Suite still collects 315 tests across 15 files. Skip behavior
unchanged when RUN_E2E_TESTS is unset.
0 commit comments