mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +08:00
- Clear inherited scheduler controls outside intentional shards. - Bound Sandbox removal and escalate stalled CLI termination.
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
/**
|
|
* Choose where tests that exercise the native host toolchain run.
|
|
*
|
|
* Darwin and Linux have supported native clang paths, so those files should
|
|
* test the contributor's actual host. Other hosts keep the coverage in the
|
|
* Linux Sandboxes. Darwin alone adds the compact kqueue/Mach-O contracts.
|
|
*/
|
|
export function sandboxHostSchedule(platform, invariantFiles) {
|
|
const runsNative = platform === "darwin" || platform === "linux";
|
|
return {
|
|
darwinContracts: platform === "darwin",
|
|
localArtifactContracts: runsNative,
|
|
localInvariantFiles: runsNative ? invariantFiles : [],
|
|
remoteArtifactContracts: !runsNative,
|
|
remoteInvariantFiles: runsNative ? [] : invariantFiles,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Pin lane and scheduler identity even when the parent shell, .env.local, or
|
|
* Sandbox image already defines these variables. Empty values restore the
|
|
* unsharded, platform-native defaults; intentional remote and local shards
|
|
* override them at their call sites.
|
|
*/
|
|
export function sandboxLaneEnv(lane) {
|
|
return {
|
|
CI: "1",
|
|
SCRIPTC_PORTABLE_ONLY: "",
|
|
SCRIPTC_SAN: lane === "san" ? "1" : "",
|
|
SCRIPTC_TEST_SHARD: "",
|
|
};
|
|
}
|