alpha
Login
or
Join now
compounding.tech
/
pty
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
pty
/
tests
/
setup
/
at
fix/typecheck-test-mocks
2 files
Nathan
test: scrub ambient PTY_ROOT so the suite is hermetic inside a pty session (#62)
7d ago
773fadbc
isolate-env.ts
test: scrub ambient PTY_ROOT so the suite is hermetic inside a pty session (#62) When the vitest process itself runs inside a pty session, its ambient PTY_ROOT / PTY_SESSION / PTY_SESSION_DIR leaked into every spawned `pty`. getSessionDir() prefers PTY_ROOT over the per-test PTY_SESSION_DIR that the helpers pass, so the spawned CLI read the developer's REAL live session dir instead of the test tmpdir — non-deterministic failures, and a risk of mutating live sessions. - tests/setup/isolate-env.ts: new per-worker setupFile (registered in vitest.config) that scrubs the three ambient vars before any test module runs — the hard guard. - Session.spawn: extract buildSpawnEnv() (pure, exported) and also scrub ambient PTY_ROOT / PTY_SESSION_DIR there, so external users of the shipped testing library get the same isolation. Guarded: an explicit root passed via opts.env still wins. - tests/env-isolation.test.ts: unit tests for buildSpawnEnv + a guard test asserting the setupFile scrubbed the worker env. - gc-flap-clear-badge-root-len: the restart test was passing only because an ambient PTY_SESSION made `pty restart` skip its attach; set PTY_SESSION explicitly so it no longer depends on the leak. Verified: full suite green (1213 passed) WITH ambient PTY_ROOT set and no env -u / shim workarounds; unchanged in clean CI (scrub is a no-op there).
1 week ago
vitest-global.ts
feat(root): PTY_ROOT canonical + --root flag + per-root gc plist (#55) Phase-2 per-namespace isolation. `PTY_SESSION_DIR` becomes a legacy alias (still functional, emits a one-time deprecation notice per process; suppress with PTY_ROOT_LEGACY_SILENT=1). New canonical env `PTY_ROOT` and matching global `pty --root <path>` flag pin the state registry per call — every subcommand transparently scopes via getSessionDir(). `pty gc --print-launchd-plist` parameterizes off the current root: default root keeps the pre-Phase-2 Label (com.myobie.pty.gc) for backwards compat with existing installs; non-default roots get a sanitized Label suffix (com.myobie.pty.gc.<basename>) and a per-root log path (<root>/gc.log). Emitted plist writes PTY_ROOT (canonical), not the legacy name — a mid-migration installer sees loud stderr in gc.log until it's cleaned up. README gains a "Namespaces" section documenting soft (tag-filter) and hard (--root/PTY_ROOT) isolation. smalltalk's Phase-1 `st.network` tag composes with this cleanly. Tests in tests/pty-root.test.ts cover: env-var precedence, one-time deprecation notice + silence hatch, --root overrides both envs, --root value validation, default vs non-default plist Label, per-root logPath, pathological-basename sanitization.
1 week ago