Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions scripts/ci-test-plan.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function planTests(changedFiles, options = {}) {
e2e: true,
full: true,
headless: graph.dirs.includes('packages/headless'),
runtimeSandbox: graph.dirs.includes('packages/runtime'),
runtimeSandbox: graph.dirs.includes('packages/cli'),
scriptMode: 'full',
storageStress: graph.dirs.includes('packages/storage'),
workspaces: [...graph.dirs],
Expand Down Expand Up @@ -159,12 +159,11 @@ export function planTests(changedFiles, options = {}) {
e2e: directWorkspaces.has('apps/desktop') || directWorkspaces.has('packages/ui'),
full: false,
headless: workspaces.includes('packages/headless'),
runtimeSandbox:
directWorkspaces.has('packages/runtime') ||
// runtime-bootstrap.test.ts (packages/cli) executes real sandboxed shell
// tools, so it needs the bubblewrap + user-namespace setup even though
// the change is scoped to the cli workspace.
files.some((path) => path === 'packages/cli/src/__tests__/runtime-bootstrap.test.ts'),
// packages/cli/src/__tests__/runtime-bootstrap.test.ts executes real sandboxed
// shell tools, so the bubblewrap + user-namespace setup is required whenever
// the cli workspace runs in the dependency closure, not only for direct
// cli/runtime edits (e.g. a storage-only change still selects cli via runtime).
runtimeSandbox: workspaces.includes('packages/cli'),
scriptMode,
storageStress,
workspaces,
Expand Down
14 changes: 14 additions & 0 deletions scripts/ci-test-plan.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ test('stress and specialized script checks run only for their owning surfaces',
assert.deepEqual(measurement.workspaces, []);
});

test('sandbox is flagged whenever the cli workspace runs in the closure', () => {
// packages/cli/src/__tests__/runtime-bootstrap.test.ts executes real sandboxed
// shell tools, so any change whose dependency closure selects packages/cli must
// provision the sandbox — not only direct cli/runtime edits.
for (const path of [
'packages/cli/src/__tests__/runtime-bootstrap.test.ts',
'packages/runtime/src/shell-tools.ts',
'packages/storage/src/session-store.ts',
'packages/headless/src/cell-output.ts',
]) {
assert.equal(planTests([path], { graph }).runtimeSandbox, true, path);
}
});

test('global and unknown production changes fail safe to the complete suite', () => {
for (const path of ['package-lock.json', 'scripts/ci-test-plan.mjs', 'new-root/file.ts']) {
const plan = planTests([path], { graph });
Expand Down
Loading