@descryy/runtime-test-runner 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/swift-isolation.d.ts +120 -0
- package/dist/swift-isolation.d.ts.map +1 -0
- package/dist/swift-isolation.js +201 -0
- package/dist/swift-isolation.js.map +1 -0
- package/dist/swift-xctest.d.ts +20 -0
- package/dist/swift-xctest.d.ts.map +1 -1
- package/dist/swift-xctest.js +86 -9
- package/dist/swift-xctest.js.map +1 -1
- package/package.json +11 -8
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps `swift-xctest.ts`'s generated `Tests/LinuxMain.swift` out of the user's real
|
|
3
|
+
* package tree, crash-safe. `writeLinuxMain`/`removeGeneratedLinuxMain` (that file's own
|
|
4
|
+
* pair) are correct on the happy path, but a process killed between the write and the
|
|
5
|
+
* `stop()` cleanup — the exact thing observing a real, possibly-hanging test run has to
|
|
6
|
+
* tolerate — leaves the generated file sitting in the user's own `Tests/` directory,
|
|
7
|
+
* indistinguishable from something they wrote. This module runs the write-then-`swift
|
|
8
|
+
* test` pass somewhere the real tree can never see, so there is nothing left to clean up:
|
|
9
|
+
*
|
|
10
|
+
* - **Preferred: bubblewrap overlay.** `bwrap --overlay-src <pkg> --tmp-overlay <pkg>`
|
|
11
|
+
* (bwrap >= 0.8.0) presents `<pkg>` inside the sandbox as a writable tmpfs layered
|
|
12
|
+
* over the real directory read-only underneath. Every write the sandboxed process
|
|
13
|
+
* makes — the generated file, `.build`'s incremental state — lands in that tmpfs and
|
|
14
|
+
* is torn down by the kernel the moment the sandboxed process's mount namespace goes
|
|
15
|
+
* away, including on SIGKILL. Reuses `filesystemIsolationCapability` from
|
|
16
|
+
* `@descryy/runtime-controller`'s existing bwrap backend (`sandbox.ts`) for the
|
|
17
|
+
* "bwrap present, unprivileged user namespaces usable, Linux" checks that backend
|
|
18
|
+
* already makes real; this module adds only the overlay-specific version gate
|
|
19
|
+
* (`--overlay-src`/`--tmp-overlay` need bwrap >= 0.8.0) and the overlay invocation
|
|
20
|
+
* itself, which `sandbox.ts` does not build (its own `applySandbox` only confines
|
|
21
|
+
* writes via read-only/bind mounts, it never overlays a writable one).
|
|
22
|
+
*
|
|
23
|
+
* - **Fallback: a real filesystem copy.** No bwrap, too old, or not Linux: the whole
|
|
24
|
+
* package is copied to a fresh temp directory (skipping `.build` — a fresh build
|
|
25
|
+
* there is the honest cost of this path, not a defect) and the pass runs against the
|
|
26
|
+
* copy. `Tests/LinuxMain.swift` and every build artifact land only in the copy;
|
|
27
|
+
* `removeCopy()` deletes it afterward, and even a crash before that runs leaves an
|
|
28
|
+
* orphaned temp directory at worst — never a file inside the user's own tree.
|
|
29
|
+
*
|
|
30
|
+
* Which mode ran is always disclosed (`IsolationDecision.mode`) — rule 7. Neither mode is
|
|
31
|
+
* silently downgraded to "write directly," which is the one thing this module exists to
|
|
32
|
+
* rule out.
|
|
33
|
+
*/
|
|
34
|
+
/** `bwrap --version` prints e.g. "bubblewrap 0.8.0\n". `null` when the text doesn't match —
|
|
35
|
+
* refuse to guess a version rather than assume "old enough" or "new enough" either way. */
|
|
36
|
+
export declare function parseBwrapVersion(versionOutput: string): {
|
|
37
|
+
readonly major: number;
|
|
38
|
+
readonly minor: number;
|
|
39
|
+
readonly patch: number;
|
|
40
|
+
} | null;
|
|
41
|
+
/** `a >= b`, the three components compared most-significant first — the ordinary meaning
|
|
42
|
+
* of a semantic version comparison, no pre-release/build-metadata handling because
|
|
43
|
+
* `bwrap --version` never emits any. */
|
|
44
|
+
export declare function versionAtLeast(a: {
|
|
45
|
+
readonly major: number;
|
|
46
|
+
readonly minor: number;
|
|
47
|
+
readonly patch: number;
|
|
48
|
+
}, b: {
|
|
49
|
+
readonly major: number;
|
|
50
|
+
readonly minor: number;
|
|
51
|
+
readonly patch: number;
|
|
52
|
+
}): boolean;
|
|
53
|
+
/** bwrap 0.10.0 is where `--overlay-src`/`--tmp-overlay` were added. This said 0.8.0 once; measured
|
|
54
|
+
* on bubblewrap 0.9.0, `--overlay-src` is an unknown option, so the version gate is backed by
|
|
55
|
+
* asking bwrap itself (`bwrapListsOverlayFlags`). It is the specific gate this module needs beyond `filesystemIsolationCapability`'s own
|
|
56
|
+
* presence-and-userns check, which knows nothing about which flags a given bwrap build supports. */
|
|
57
|
+
export declare const MIN_OVERLAY_BWRAP_VERSION: {
|
|
58
|
+
readonly major: 0;
|
|
59
|
+
readonly minor: 10;
|
|
60
|
+
readonly patch: 0;
|
|
61
|
+
};
|
|
62
|
+
/** True only when this bwrap build's own `--help` lists both overlay flags. A version number is a
|
|
63
|
+
* claim about upstream; the help text is the build actually on this machine saying what it accepts. */
|
|
64
|
+
export declare function bwrapListsOverlayFlags(env?: NodeJS.ProcessEnv): boolean;
|
|
65
|
+
export type IsolationMode = "bwrap-overlay" | "copy";
|
|
66
|
+
export interface IsolationDecision {
|
|
67
|
+
readonly mode: IsolationMode;
|
|
68
|
+
/** Present only for `"copy"` — why bwrap-overlay was not used, for the disclosure a
|
|
69
|
+
* caller shows alongside "which mode ran" (rule 7: a fallback is always labelled). */
|
|
70
|
+
readonly fallbackReason?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Decides which isolation mode to use, checking real state rather than assuming — never
|
|
74
|
+
* downgrades silently: a `"copy"` decision always carries why bwrap-overlay was not used.
|
|
75
|
+
*/
|
|
76
|
+
export declare function detectIsolationMode(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): IsolationDecision;
|
|
77
|
+
export interface BwrapOverlayCommand {
|
|
78
|
+
readonly command: string;
|
|
79
|
+
readonly args: readonly string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the argv for running `swift test` against `packageRoot` with a Descry-generated
|
|
83
|
+
* `Tests/LinuxMain.swift` in place, entirely inside a bwrap overlay: the real tree stays
|
|
84
|
+
* read-only underneath, every write lands in a tmpfs upper layer the kernel discards when
|
|
85
|
+
* the process's mount namespace ends. `--bind / /` mirrors the host exactly (the sandboxed
|
|
86
|
+
* process still needs the real Swift toolchain, `sh`, `cp`, everything on `PATH`) and the
|
|
87
|
+
* overlay is layered on top of that mirror for `packageRoot` alone — bwrap composes mounts
|
|
88
|
+
* in argument order, a later, more specific one always overriding an earlier, broader one,
|
|
89
|
+
* the same layering `sandbox.ts`'s own bind-mount branches already rely on.
|
|
90
|
+
*
|
|
91
|
+
* `generatedLinuxMainPath` is a file Node already wrote *outside* the package (this
|
|
92
|
+
* module's own caller does that) — its content never passes through this shell command,
|
|
93
|
+
* only its path does, so no Swift source content is ever shell-interpolated or escaped.
|
|
94
|
+
* Bound read-only into the sandbox so the `cp` inside it can reach it, then copied into
|
|
95
|
+
* place at `Tests/LinuxMain.swift` before `swift test` runs — `cp`, not a bind, because a
|
|
96
|
+
* bind-mounted `Tests/LinuxMain.swift` would need the destination to exist first and would
|
|
97
|
+
* point back at the same real inode either way, defeating the overlay for that one file.
|
|
98
|
+
*/
|
|
99
|
+
export declare function buildBwrapOverlayCommand(packageRoot: string, generatedLinuxMainPath: string): BwrapOverlayCommand;
|
|
100
|
+
export interface PackageCopy {
|
|
101
|
+
readonly copyRoot: string;
|
|
102
|
+
}
|
|
103
|
+
/** `.build` is the one directory never copied — it is the largest part of a Swift package's
|
|
104
|
+
* tree by far, and copying it buys nothing: `swift build`/`swift test` in the copy starts
|
|
105
|
+
* fresh either way once the copy's `Tests/LinuxMain.swift` differs from whatever the real
|
|
106
|
+
* tree's `.build` was compiled against. `cpSync`'s own `filter` is the exclusion mechanism
|
|
107
|
+
* rather than a post-copy `rm -rf`, so the excluded tree is never written to disk at all —
|
|
108
|
+
* cheaper, and immune to a `.build` symlink escaping the copy root before it could be removed. */
|
|
109
|
+
export declare function copyPackageExcludingBuild(packageRoot: string, tmpParent?: string): PackageCopy;
|
|
110
|
+
export declare function removeCopy(copy: PackageCopy): void;
|
|
111
|
+
/**
|
|
112
|
+
* A path a copy-mode run reported (a failing assertion naming a file, a stack trace frame)
|
|
113
|
+
* translated back to where that file actually lives in the user's real tree — a caller
|
|
114
|
+
* told `Tests/HandlerTests.swift:42` inside the copy needs the real path to be useful.
|
|
115
|
+
* `null` when `reportedPath` does not resolve under `copy.copyRoot` at all (already
|
|
116
|
+
* absolute elsewhere, or relative and copy-root-relative resolution does not apply) —
|
|
117
|
+
* returned unresolved rather than guessed at.
|
|
118
|
+
*/
|
|
119
|
+
export declare function mapPathBackToOriginal(reportedPath: string, copy: PackageCopy, packageRoot: string): string;
|
|
120
|
+
//# sourceMappingURL=swift-isolation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swift-isolation.d.ts","sourceRoot":"","sources":["../src/swift-isolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AASH;4FAC4F;AAC5F,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI1I;AAED;;yCAEyC;AACzC,wBAAgB,cAAc,CAC5B,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAC7E,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5E,OAAO,CAIT;AAED;;;qGAGqG;AACrG,eAAO,MAAM,yBAAyB;;;;CAA6C,CAAC;AAEpF;wGACwG;AACxG,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAIpF;AAED,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B;2FACuF;IACvF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAcD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,iBAAiB,CAuBnB;AAUD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,GAAG,mBAAmB,CAiCjH;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;mGAKmG;AACnG,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAiB,GAAG,WAAW,CAUxG;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAElD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAK1G"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps `swift-xctest.ts`'s generated `Tests/LinuxMain.swift` out of the user's real
|
|
3
|
+
* package tree, crash-safe. `writeLinuxMain`/`removeGeneratedLinuxMain` (that file's own
|
|
4
|
+
* pair) are correct on the happy path, but a process killed between the write and the
|
|
5
|
+
* `stop()` cleanup — the exact thing observing a real, possibly-hanging test run has to
|
|
6
|
+
* tolerate — leaves the generated file sitting in the user's own `Tests/` directory,
|
|
7
|
+
* indistinguishable from something they wrote. This module runs the write-then-`swift
|
|
8
|
+
* test` pass somewhere the real tree can never see, so there is nothing left to clean up:
|
|
9
|
+
*
|
|
10
|
+
* - **Preferred: bubblewrap overlay.** `bwrap --overlay-src <pkg> --tmp-overlay <pkg>`
|
|
11
|
+
* (bwrap >= 0.8.0) presents `<pkg>` inside the sandbox as a writable tmpfs layered
|
|
12
|
+
* over the real directory read-only underneath. Every write the sandboxed process
|
|
13
|
+
* makes — the generated file, `.build`'s incremental state — lands in that tmpfs and
|
|
14
|
+
* is torn down by the kernel the moment the sandboxed process's mount namespace goes
|
|
15
|
+
* away, including on SIGKILL. Reuses `filesystemIsolationCapability` from
|
|
16
|
+
* `@descryy/runtime-controller`'s existing bwrap backend (`sandbox.ts`) for the
|
|
17
|
+
* "bwrap present, unprivileged user namespaces usable, Linux" checks that backend
|
|
18
|
+
* already makes real; this module adds only the overlay-specific version gate
|
|
19
|
+
* (`--overlay-src`/`--tmp-overlay` need bwrap >= 0.8.0) and the overlay invocation
|
|
20
|
+
* itself, which `sandbox.ts` does not build (its own `applySandbox` only confines
|
|
21
|
+
* writes via read-only/bind mounts, it never overlays a writable one).
|
|
22
|
+
*
|
|
23
|
+
* - **Fallback: a real filesystem copy.** No bwrap, too old, or not Linux: the whole
|
|
24
|
+
* package is copied to a fresh temp directory (skipping `.build` — a fresh build
|
|
25
|
+
* there is the honest cost of this path, not a defect) and the pass runs against the
|
|
26
|
+
* copy. `Tests/LinuxMain.swift` and every build artifact land only in the copy;
|
|
27
|
+
* `removeCopy()` deletes it afterward, and even a crash before that runs leaves an
|
|
28
|
+
* orphaned temp directory at worst — never a file inside the user's own tree.
|
|
29
|
+
*
|
|
30
|
+
* Which mode ran is always disclosed (`IsolationDecision.mode`) — rule 7. Neither mode is
|
|
31
|
+
* silently downgraded to "write directly," which is the one thing this module exists to
|
|
32
|
+
* rule out.
|
|
33
|
+
*/
|
|
34
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
35
|
+
import { cpSync, mkdtempSync, rmSync } from "node:fs";
|
|
36
|
+
import { tmpdir } from "node:os";
|
|
37
|
+
import { isAbsolute, join, relative } from "node:path";
|
|
38
|
+
import { filesystemIsolationCapability } from "@descryy/runtime-controller";
|
|
39
|
+
/** `bwrap --version` prints e.g. "bubblewrap 0.8.0\n". `null` when the text doesn't match —
|
|
40
|
+
* refuse to guess a version rather than assume "old enough" or "new enough" either way. */
|
|
41
|
+
export function parseBwrapVersion(versionOutput) {
|
|
42
|
+
const match = /bubblewrap\s+(\d+)\.(\d+)\.(\d+)/.exec(versionOutput);
|
|
43
|
+
if (match === null)
|
|
44
|
+
return null;
|
|
45
|
+
return { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]) };
|
|
46
|
+
}
|
|
47
|
+
/** `a >= b`, the three components compared most-significant first — the ordinary meaning
|
|
48
|
+
* of a semantic version comparison, no pre-release/build-metadata handling because
|
|
49
|
+
* `bwrap --version` never emits any. */
|
|
50
|
+
export function versionAtLeast(a, b) {
|
|
51
|
+
if (a.major !== b.major)
|
|
52
|
+
return a.major > b.major;
|
|
53
|
+
if (a.minor !== b.minor)
|
|
54
|
+
return a.minor > b.minor;
|
|
55
|
+
return a.patch >= b.patch;
|
|
56
|
+
}
|
|
57
|
+
/** bwrap 0.10.0 is where `--overlay-src`/`--tmp-overlay` were added. This said 0.8.0 once; measured
|
|
58
|
+
* on bubblewrap 0.9.0, `--overlay-src` is an unknown option, so the version gate is backed by
|
|
59
|
+
* asking bwrap itself (`bwrapListsOverlayFlags`). It is the specific gate this module needs beyond `filesystemIsolationCapability`'s own
|
|
60
|
+
* presence-and-userns check, which knows nothing about which flags a given bwrap build supports. */
|
|
61
|
+
export const MIN_OVERLAY_BWRAP_VERSION = { major: 0, minor: 10, patch: 0 };
|
|
62
|
+
/** True only when this bwrap build's own `--help` lists both overlay flags. A version number is a
|
|
63
|
+
* claim about upstream; the help text is the build actually on this machine saying what it accepts. */
|
|
64
|
+
export function bwrapListsOverlayFlags(env = process.env) {
|
|
65
|
+
const result = spawnSync("bwrap", ["--help"], { env, encoding: "utf8" });
|
|
66
|
+
const text = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
67
|
+
return text.includes("--overlay-src") && text.includes("--tmp-overlay");
|
|
68
|
+
}
|
|
69
|
+
/** Real bwrap version, or `null` when bwrap cannot even be invoked (absent, not executable) —
|
|
70
|
+
* distinct from `filesystemIsolationCapability`, which only checks presence-and-userns and
|
|
71
|
+
* says nothing about which flags this particular build supports. */
|
|
72
|
+
function detectBwrapVersion(env) {
|
|
73
|
+
try {
|
|
74
|
+
const output = execFileSync("bwrap", ["--version"], { env, encoding: "utf8" });
|
|
75
|
+
return parseBwrapVersion(output);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Decides which isolation mode to use, checking real state rather than assuming — never
|
|
83
|
+
* downgrades silently: a `"copy"` decision always carries why bwrap-overlay was not used.
|
|
84
|
+
*/
|
|
85
|
+
export function detectIsolationMode(env = process.env, platform = process.platform) {
|
|
86
|
+
const capability = filesystemIsolationCapability(env, platform);
|
|
87
|
+
if (capability.availability !== "available") {
|
|
88
|
+
return { mode: "copy", fallbackReason: capability.reason ?? "bwrap-based filesystem isolation is unavailable" };
|
|
89
|
+
}
|
|
90
|
+
const version = detectBwrapVersion(env);
|
|
91
|
+
if (version === null) {
|
|
92
|
+
return { mode: "copy", fallbackReason: "bwrap --version could not be read, so its overlay support could not be confirmed" };
|
|
93
|
+
}
|
|
94
|
+
if (!versionAtLeast(version, MIN_OVERLAY_BWRAP_VERSION)) {
|
|
95
|
+
return {
|
|
96
|
+
mode: "copy",
|
|
97
|
+
fallbackReason: `bwrap ${String(version.major)}.${String(version.minor)}.${String(version.patch)} is older than the ` +
|
|
98
|
+
`${String(MIN_OVERLAY_BWRAP_VERSION.major)}.${String(MIN_OVERLAY_BWRAP_VERSION.minor)}.${String(MIN_OVERLAY_BWRAP_VERSION.patch)} ` +
|
|
99
|
+
"--overlay-src/--tmp-overlay needs",
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (!bwrapListsOverlayFlags(env)) {
|
|
103
|
+
return { mode: "copy", fallbackReason: "this bwrap build's --help does not list --overlay-src and --tmp-overlay" };
|
|
104
|
+
}
|
|
105
|
+
return { mode: "bwrap-overlay" };
|
|
106
|
+
}
|
|
107
|
+
/** Single-quotes a shell word the POSIX-safe way: close the quote, emit an escaped literal
|
|
108
|
+
* quote, reopen — correct for any byte a path or command can contain, including one that
|
|
109
|
+
* is itself a single quote. Used only for the two paths this module ever interpolates into
|
|
110
|
+
* a shell command string (never for file *content*, which never touches a shell here). */
|
|
111
|
+
function shQuote(word) {
|
|
112
|
+
return `'${word.replace(/'/g, "'\\''")}'`;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Builds the argv for running `swift test` against `packageRoot` with a Descry-generated
|
|
116
|
+
* `Tests/LinuxMain.swift` in place, entirely inside a bwrap overlay: the real tree stays
|
|
117
|
+
* read-only underneath, every write lands in a tmpfs upper layer the kernel discards when
|
|
118
|
+
* the process's mount namespace ends. `--bind / /` mirrors the host exactly (the sandboxed
|
|
119
|
+
* process still needs the real Swift toolchain, `sh`, `cp`, everything on `PATH`) and the
|
|
120
|
+
* overlay is layered on top of that mirror for `packageRoot` alone — bwrap composes mounts
|
|
121
|
+
* in argument order, a later, more specific one always overriding an earlier, broader one,
|
|
122
|
+
* the same layering `sandbox.ts`'s own bind-mount branches already rely on.
|
|
123
|
+
*
|
|
124
|
+
* `generatedLinuxMainPath` is a file Node already wrote *outside* the package (this
|
|
125
|
+
* module's own caller does that) — its content never passes through this shell command,
|
|
126
|
+
* only its path does, so no Swift source content is ever shell-interpolated or escaped.
|
|
127
|
+
* Bound read-only into the sandbox so the `cp` inside it can reach it, then copied into
|
|
128
|
+
* place at `Tests/LinuxMain.swift` before `swift test` runs — `cp`, not a bind, because a
|
|
129
|
+
* bind-mounted `Tests/LinuxMain.swift` would need the destination to exist first and would
|
|
130
|
+
* point back at the same real inode either way, defeating the overlay for that one file.
|
|
131
|
+
*/
|
|
132
|
+
export function buildBwrapOverlayCommand(packageRoot, generatedLinuxMainPath) {
|
|
133
|
+
const script = `set -e; cp ${shQuote(generatedLinuxMainPath)} Tests/LinuxMain.swift; exec swift test`;
|
|
134
|
+
return {
|
|
135
|
+
command: "bwrap",
|
|
136
|
+
args: [
|
|
137
|
+
"--bind",
|
|
138
|
+
"/",
|
|
139
|
+
"/",
|
|
140
|
+
"--dev",
|
|
141
|
+
"/dev",
|
|
142
|
+
"--proc",
|
|
143
|
+
"/proc",
|
|
144
|
+
"--bind",
|
|
145
|
+
"/tmp",
|
|
146
|
+
"/tmp",
|
|
147
|
+
"--ro-bind",
|
|
148
|
+
generatedLinuxMainPath,
|
|
149
|
+
generatedLinuxMainPath,
|
|
150
|
+
"--overlay-src",
|
|
151
|
+
packageRoot,
|
|
152
|
+
"--tmp-overlay",
|
|
153
|
+
packageRoot,
|
|
154
|
+
"--chdir",
|
|
155
|
+
packageRoot,
|
|
156
|
+
// Same backstop sandbox.ts's own bwrap invocation uses: if this Node process
|
|
157
|
+
// dies unexpectedly, the sandboxed tree dies with it rather than orphaning.
|
|
158
|
+
"--die-with-parent",
|
|
159
|
+
"--",
|
|
160
|
+
"/bin/sh",
|
|
161
|
+
"-c",
|
|
162
|
+
script,
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** `.build` is the one directory never copied — it is the largest part of a Swift package's
|
|
167
|
+
* tree by far, and copying it buys nothing: `swift build`/`swift test` in the copy starts
|
|
168
|
+
* fresh either way once the copy's `Tests/LinuxMain.swift` differs from whatever the real
|
|
169
|
+
* tree's `.build` was compiled against. `cpSync`'s own `filter` is the exclusion mechanism
|
|
170
|
+
* rather than a post-copy `rm -rf`, so the excluded tree is never written to disk at all —
|
|
171
|
+
* cheaper, and immune to a `.build` symlink escaping the copy root before it could be removed. */
|
|
172
|
+
export function copyPackageExcludingBuild(packageRoot, tmpParent = tmpdir()) {
|
|
173
|
+
const copyRoot = mkdtempSync(join(tmpParent, "descry-swift-copy-"));
|
|
174
|
+
cpSync(packageRoot, copyRoot, {
|
|
175
|
+
recursive: true,
|
|
176
|
+
filter: (source) => {
|
|
177
|
+
const rel = relative(packageRoot, source);
|
|
178
|
+
return rel !== ".build" && !rel.startsWith(`.build${"/"}`);
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
return { copyRoot };
|
|
182
|
+
}
|
|
183
|
+
export function removeCopy(copy) {
|
|
184
|
+
rmSync(copy.copyRoot, { recursive: true, force: true });
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* A path a copy-mode run reported (a failing assertion naming a file, a stack trace frame)
|
|
188
|
+
* translated back to where that file actually lives in the user's real tree — a caller
|
|
189
|
+
* told `Tests/HandlerTests.swift:42` inside the copy needs the real path to be useful.
|
|
190
|
+
* `null` when `reportedPath` does not resolve under `copy.copyRoot` at all (already
|
|
191
|
+
* absolute elsewhere, or relative and copy-root-relative resolution does not apply) —
|
|
192
|
+
* returned unresolved rather than guessed at.
|
|
193
|
+
*/
|
|
194
|
+
export function mapPathBackToOriginal(reportedPath, copy, packageRoot) {
|
|
195
|
+
const absolute = isAbsolute(reportedPath) ? reportedPath : join(copy.copyRoot, reportedPath);
|
|
196
|
+
const rel = relative(copy.copyRoot, absolute);
|
|
197
|
+
if (rel.startsWith("..") || isAbsolute(rel))
|
|
198
|
+
return reportedPath;
|
|
199
|
+
return join(packageRoot, rel);
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=swift-isolation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swift-isolation.js","sourceRoot":"","sources":["../src/swift-isolation.ts"],"names":[],"mappings":"AAAA;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;QAAE,OAAO,YAAY,CAAC;IACjE,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/swift-xctest.d.ts
CHANGED
|
@@ -28,9 +28,26 @@
|
|
|
28
28
|
* Known limitation: two classes with the same bare name in different modules
|
|
29
29
|
* produce two colliding `extension <Name>` blocks. Not solved — the generated
|
|
30
30
|
* file fails to compile rather than silently picking one (refuse over guess).
|
|
31
|
+
*
|
|
32
|
+
* **`Tests/LinuxMain.swift` is never written into the real package tree.** It used to be
|
|
33
|
+
* — `writeLinuxMain`/`removeGeneratedLinuxMain` below are correct on the happy path, but a
|
|
34
|
+
* process killed between the write and `stop()`'s cleanup (the exact thing observing a
|
|
35
|
+
* real, possibly-hanging test run has to tolerate) left the generated file sitting in the
|
|
36
|
+
* user's own `Tests/` directory, indistinguishable from something they wrote — a site-claims
|
|
37
|
+
* gap ("Descry never writes to your code"), not a cosmetic one. `start()` now runs the
|
|
38
|
+
* write-then-`swift test` pass through `swift-isolation.ts`: a bubblewrap overlay when one
|
|
39
|
+
* with `--overlay-src`/`--tmp-overlay` support is available (every write, including the
|
|
40
|
+
* generated file and `.build`'s incremental state, lands in a tmpfs the kernel discards the
|
|
41
|
+
* moment the sandboxed process's mount namespace ends, including on SIGKILL), or a full copy
|
|
42
|
+
* of the package to a throwaway temp directory otherwise. `discoverSwiftTests` itself is
|
|
43
|
+
* unchanged and still runs directly against the real tree — it writes only to `.build`
|
|
44
|
+
* (ordinary, expected build output, not source) and never touches `Tests/LinuxMain.swift`,
|
|
45
|
+
* so isolating it buys nothing. Which mode ran is queryable via `isolationMode()` on the
|
|
46
|
+
* returned collector — rule 7, a fallback is always labelled, never silently taken.
|
|
31
47
|
*/
|
|
32
48
|
import type { Collector } from "@descryy/runtime-contracts";
|
|
33
49
|
import { type TraceCoverage } from "./test-runner-collector.ts";
|
|
50
|
+
import { type IsolationMode } from "./swift-isolation.ts";
|
|
34
51
|
export interface SwiftTestDump {
|
|
35
52
|
readonly name: string;
|
|
36
53
|
readonly tests?: readonly SwiftTestDump[];
|
|
@@ -78,6 +95,9 @@ export interface SwiftXCTestCollectorOptions {
|
|
|
78
95
|
export interface SwiftXCTestCollector extends Collector {
|
|
79
96
|
waitForCompletion(): Promise<void>;
|
|
80
97
|
traceCoverage(): TraceCoverage;
|
|
98
|
+
/** Which isolation mode the last `start()` used, `null` before the first one — rule 7's
|
|
99
|
+
* "label the fallback" surfaced as a fact a caller can read, not buried in a log line. */
|
|
100
|
+
isolationMode(): IsolationMode | null;
|
|
81
101
|
}
|
|
82
102
|
/** Two-pass collector: `start()` discovers-then-generates before spawning the real run — slower to become `available` than the single-spawn runners, the cost of having no reporter flag. */
|
|
83
103
|
export declare function createSwiftXCTestCollector(options: SwiftXCTestCollectorOptions): SwiftXCTestCollector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swift-xctest.d.ts","sourceRoot":"","sources":["../src/swift-xctest.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"swift-xctest.d.ts","sourceRoot":"","sources":["../src/swift-xctest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AASH,OAAO,KAAK,EAAE,SAAS,EAAiE,MAAM,4BAA4B,CAAC;AAE3H,OAAO,EAAyE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEvI,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,S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ctest.js
CHANGED
|
@@ -28,13 +28,32 @@
|
|
|
28
28
|
* Known limitation: two classes with the same bare name in different modules
|
|
29
29
|
* produce two colliding `extension <Name>` blocks. Not solved — the generated
|
|
30
30
|
* file fails to compile rather than silently picking one (refuse over guess).
|
|
31
|
+
*
|
|
32
|
+
* **`Tests/LinuxMain.swift` is never written into the real package tree.** It used to be
|
|
33
|
+
* — `writeLinuxMain`/`removeGeneratedLinuxMain` below are correct on the happy path, but a
|
|
34
|
+
* process killed between the write and `stop()`'s cleanup (the exact thing observing a
|
|
35
|
+
* real, possibly-hanging test run has to tolerate) left the generated file sitting in the
|
|
36
|
+
* user's own `Tests/` directory, indistinguishable from something they wrote — a site-claims
|
|
37
|
+
* gap ("Descry never writes to your code"), not a cosmetic one. `start()` now runs the
|
|
38
|
+
* write-then-`swift test` pass through `swift-isolation.ts`: a bubblewrap overlay when one
|
|
39
|
+
* with `--overlay-src`/`--tmp-overlay` support is available (every write, including the
|
|
40
|
+
* generated file and `.build`'s incremental state, lands in a tmpfs the kernel discards the
|
|
41
|
+
* moment the sandboxed process's mount namespace ends, including on SIGKILL), or a full copy
|
|
42
|
+
* of the package to a throwaway temp directory otherwise. `discoverSwiftTests` itself is
|
|
43
|
+
* unchanged and still runs directly against the real tree — it writes only to `.build`
|
|
44
|
+
* (ordinary, expected build output, not source) and never touches `Tests/LinuxMain.swift`,
|
|
45
|
+
* so isolating it buys nothing. Which mode ran is queryable via `isolationMode()` on the
|
|
46
|
+
* returned collector — rule 7, a fallback is always labelled, never silently taken.
|
|
31
47
|
*/
|
|
32
48
|
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
49
|
+
import { tmpdir } from "node:os";
|
|
33
50
|
import { join } from "node:path";
|
|
51
|
+
import { randomUUID } from "node:crypto";
|
|
34
52
|
import { spawnSync } from "node:child_process";
|
|
35
53
|
import { spawnProcess } from "@descryy/runtime-controller";
|
|
36
54
|
import { createEnvelopeGate, createEventTranslator, pumpLines, isNodeTestEvent } from "./test-runner-collector.js";
|
|
37
55
|
import { COLLECTOR_VERSION } from "./collector-version.js";
|
|
56
|
+
import { buildBwrapOverlayCommand, copyPackageExcludingBuild, detectIsolationMode, removeCopy, } from "./swift-isolation.js";
|
|
38
57
|
/**
|
|
39
58
|
* `--dump-tests-json`'s tree has no explicit node kind — a class is recognised
|
|
40
59
|
* structurally: a node whose every child is a leaf (bare `{"name": "testFoo"}`,
|
|
@@ -231,16 +250,43 @@ export function createSwiftXCTestCollector(options) {
|
|
|
231
250
|
let managed = null;
|
|
232
251
|
let completion = Promise.resolve();
|
|
233
252
|
let translator = null;
|
|
234
|
-
let
|
|
253
|
+
let mode = null;
|
|
254
|
+
let generatedTmpFile = null;
|
|
255
|
+
let packageCopy = null;
|
|
235
256
|
return {
|
|
236
257
|
collectorId: "swift-xctest-collector",
|
|
237
258
|
async start(ctx) {
|
|
259
|
+
// Unchanged: writes only to .build (ordinary build output), never to
|
|
260
|
+
// Tests/LinuxMain.swift, so it runs directly against the real tree either way.
|
|
238
261
|
const discovery = discoverSwiftTests(options.packageRoot);
|
|
239
262
|
if (!discovery.ok)
|
|
240
263
|
return { available: false, reason: discovery.reason };
|
|
264
|
+
const decision = detectIsolationMode();
|
|
265
|
+
mode = decision.mode;
|
|
266
|
+
let spawnCommand;
|
|
267
|
+
let spawnArgs;
|
|
268
|
+
let spawnCwd;
|
|
241
269
|
try {
|
|
242
|
-
|
|
243
|
-
|
|
270
|
+
if (decision.mode === "bwrap-overlay") {
|
|
271
|
+
const tmpFile = join(tmpdir(), `descry-swift-linuxmain-${randomUUID()}.swift`);
|
|
272
|
+
// Descry's own scratch file, in the system temp directory -- never inside the
|
|
273
|
+
// package the user tracks in git, and never the file bwrap's overlay makes visible
|
|
274
|
+
// as Tests/LinuxMain.swift (that copy exists only inside the overlay's tmpfs).
|
|
275
|
+
writeFileSync(tmpFile, generateLinuxMain(discovery.classes), "utf8");
|
|
276
|
+
generatedTmpFile = tmpFile;
|
|
277
|
+
const built = buildBwrapOverlayCommand(options.packageRoot, tmpFile);
|
|
278
|
+
spawnCommand = built.command;
|
|
279
|
+
spawnArgs = built.args;
|
|
280
|
+
spawnCwd = options.packageRoot;
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
const copy = copyPackageExcludingBuild(options.packageRoot);
|
|
284
|
+
packageCopy = copy;
|
|
285
|
+
writeLinuxMain(copy.copyRoot, discovery.classes);
|
|
286
|
+
spawnCommand = "swift";
|
|
287
|
+
spawnArgs = ["test"];
|
|
288
|
+
spawnCwd = copy.copyRoot;
|
|
289
|
+
}
|
|
244
290
|
}
|
|
245
291
|
catch (error) {
|
|
246
292
|
return { available: false, reason: error instanceof Error ? error.message : String(error) };
|
|
@@ -248,9 +294,9 @@ export function createSwiftXCTestCollector(options) {
|
|
|
248
294
|
const processId = `swift-xctest-${Date.now()}`;
|
|
249
295
|
managed = spawnProcess({
|
|
250
296
|
processId,
|
|
251
|
-
command:
|
|
252
|
-
args:
|
|
253
|
-
cwd:
|
|
297
|
+
command: spawnCommand,
|
|
298
|
+
args: spawnArgs,
|
|
299
|
+
cwd: spawnCwd,
|
|
254
300
|
});
|
|
255
301
|
translator = createEventTranslator(ctx.emit, options.service, processId);
|
|
256
302
|
const activeTranslator = translator;
|
|
@@ -299,8 +345,20 @@ export function createSwiftXCTestCollector(options) {
|
|
|
299
345
|
if (verdict.kind !== "event")
|
|
300
346
|
return;
|
|
301
347
|
activeTranslator.handle(parsed);
|
|
302
|
-
}).then(() => {
|
|
348
|
+
}).then(async () => {
|
|
303
349
|
activeTranslator.flush();
|
|
350
|
+
// A run that died before a single test was observed (bwrap refusing a flag, swift
|
|
351
|
+
// missing inside the sandbox, a build failure) must say so. Without this it read as
|
|
352
|
+
// a clean run of zero tests — measured: bwrap 0.9.0 has no --overlay-src, exited 1,
|
|
353
|
+
// and the collector reported nothing at all.
|
|
354
|
+
const spawned = managed;
|
|
355
|
+
if (spawned === null)
|
|
356
|
+
return;
|
|
357
|
+
const exit = await spawned.waitForExit();
|
|
358
|
+
if (exit.exitCode !== null && exit.exitCode !== 0 && activeTranslator.coverage().testsObserved === 0) {
|
|
359
|
+
reportEnvelopeError(`swift test exited ${String(exit.exitCode)} before any test was observed ` +
|
|
360
|
+
`(isolation: ${mode ?? "unknown"}). Last output:\n${spawned.readOutput().slice(-2000)}`);
|
|
361
|
+
}
|
|
304
362
|
});
|
|
305
363
|
return { available: true };
|
|
306
364
|
},
|
|
@@ -309,8 +367,24 @@ export function createSwiftXCTestCollector(options) {
|
|
|
309
367
|
await managed.kill();
|
|
310
368
|
}
|
|
311
369
|
await completion;
|
|
312
|
-
|
|
313
|
-
|
|
370
|
+
// Neither cleanup can leave anything in the real package tree: the tmp file lives in
|
|
371
|
+
// the system temp directory (never inside options.packageRoot), and the copy is a
|
|
372
|
+
// wholly separate directory tree. A crash before this runs leaves, at worst, an
|
|
373
|
+
// orphaned temp file/directory outside the user's repository -- never inside it,
|
|
374
|
+
// which is the property this module exists to guarantee.
|
|
375
|
+
if (generatedTmpFile !== null) {
|
|
376
|
+
try {
|
|
377
|
+
rmSync(generatedTmpFile, { force: true });
|
|
378
|
+
}
|
|
379
|
+
catch {
|
|
380
|
+
// Best-effort: an already-gone scratch file outside the user's tree is not a fault.
|
|
381
|
+
}
|
|
382
|
+
generatedTmpFile = null;
|
|
383
|
+
}
|
|
384
|
+
if (packageCopy !== null) {
|
|
385
|
+
removeCopy(packageCopy);
|
|
386
|
+
packageCopy = null;
|
|
387
|
+
}
|
|
314
388
|
},
|
|
315
389
|
capabilities() {
|
|
316
390
|
return capabilities;
|
|
@@ -321,6 +395,9 @@ export function createSwiftXCTestCollector(options) {
|
|
|
321
395
|
traceCoverage() {
|
|
322
396
|
return translator?.coverage() ?? { testsObserved: 0, idsPresent: 0, notRun: 0 };
|
|
323
397
|
},
|
|
398
|
+
isolationMode() {
|
|
399
|
+
return mode;
|
|
400
|
+
},
|
|
324
401
|
};
|
|
325
402
|
}
|
|
326
403
|
//# sourceMapp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ChF,iFAAiF;YACjF,yDAAyD;YACzD,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;gBAC9B,IAAI,CAAC;oBACH,MAAM,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5C,CAAC;gBAAC,MAAM,CAAC;oBACP,oFAAoF;gBACtF,CAAC;gBACD,gBAAgB,GAAG,IAAI,CAAC;YAC1B,CAAC;YACD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBACzB,UAAU,CAAC,WAAW,CAAC,CAAC;gBACxB,WAAW,GAAG,IAAI,CAAC;YACrB,CAAC;QACH,CAAC;QAED,YAAY;YACV,OAAO,YAAY,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,iBAAiB;YACrB,MAAM,UAAU,CAAC;QACnB,CAAC;QAED,aAAa;YACX,OAAO,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAClF,CAAC;QAED,aAAa;YACX,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descryy/runtime-test-runner",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Test-runner observation (plan §17): discovery, start, TEST_STARTED/PASSED/FAILED, trace capture, source mapping, not-run disclosure. Three runners -- node:test, Jest, Vitest -- each observed through its own structured reporter API writing one shared envelope; no TAP or text scraping anywhere.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -25,14 +25,17 @@
|
|
|
25
25
|
"registry": "https://registry.npmjs.org",
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tsc -b && node reporters/junit/build.mjs && node reporters/xunit/build.mjs"
|
|
30
|
-
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@descryy/runtime-contracts": "0.3.3",
|
|
33
30
|
"@descryy/runtime-backend-observation": "0.3.6",
|
|
34
|
-
"@descryy/runtime-controller": "0.3.
|
|
35
|
-
"@descryy/runtime-graph-correlator": "0.
|
|
36
|
-
"@descryy/core": "0.
|
|
31
|
+
"@descryy/runtime-controller": "0.3.9",
|
|
32
|
+
"@descryy/runtime-graph-correlator": "0.5.0",
|
|
33
|
+
"@descryy/core": "0.10.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@descryy/ir": "0.11.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -b && node reporters/junit/build.mjs && node reporters/xunit/build.mjs"
|
|
37
40
|
}
|
|
38
|
-
}
|
|
41
|
+
}
|