@descryy/runtime-test-runner 0.0.0

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.
Files changed (41) hide show
  1. package/dist/collector-version.d.ts +10 -0
  2. package/dist/collector-version.d.ts.map +1 -0
  3. package/dist/collector-version.js +12 -0
  4. package/dist/collector-version.js.map +1 -0
  5. package/dist/go-test.d.ts +81 -0
  6. package/dist/go-test.d.ts.map +1 -0
  7. package/dist/go-test.js +224 -0
  8. package/dist/go-test.js.map +1 -0
  9. package/dist/graph-mapping.d.ts +44 -0
  10. package/dist/graph-mapping.d.ts.map +1 -0
  11. package/dist/graph-mapping.js +72 -0
  12. package/dist/graph-mapping.js.map +1 -0
  13. package/dist/index.d.ts +10 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +6 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/jest-reporter.d.ts +72 -0
  18. package/dist/jest-reporter.d.ts.map +1 -0
  19. package/dist/jest-reporter.js +110 -0
  20. package/dist/jest-reporter.js.map +1 -0
  21. package/dist/playwright-reporter.d.ts +67 -0
  22. package/dist/playwright-reporter.d.ts.map +1 -0
  23. package/dist/playwright-reporter.js +93 -0
  24. package/dist/playwright-reporter.js.map +1 -0
  25. package/dist/reporter.d.ts +35 -0
  26. package/dist/reporter.d.ts.map +1 -0
  27. package/dist/reporter.js +74 -0
  28. package/dist/reporter.js.map +1 -0
  29. package/dist/swift-xctest.d.ts +138 -0
  30. package/dist/swift-xctest.d.ts.map +1 -0
  31. package/dist/swift-xctest.js +384 -0
  32. package/dist/swift-xctest.js.map +1 -0
  33. package/dist/test-runner-collector.d.ts +370 -0
  34. package/dist/test-runner-collector.d.ts.map +1 -0
  35. package/dist/test-runner-collector.js +1014 -0
  36. package/dist/test-runner-collector.js.map +1 -0
  37. package/dist/vitest-reporter.d.ts +76 -0
  38. package/dist/vitest-reporter.d.ts.map +1 -0
  39. package/dist/vitest-reporter.js +131 -0
  40. package/dist/vitest-reporter.js.map +1 -0
  41. package/package.json +33 -0
@@ -0,0 +1,384 @@
1
+ /**
2
+ * Swift's XCTest half of §17, observed through a custom `XCTestObservation`
3
+ * hooked directly into the test process, in-process and streaming — not
4
+ * `swift test --xunit-output`'s end-of-run artifact (RT-181), which on
5
+ * Swift 6.1.2/Linux covers swift-testing only and silently reports a
6
+ * smaller, clean-looking run for one where twice as many tests ran and half
7
+ * of them failed. This closes the "real path... a different piece of work
8
+ * from consuming an artifact" RT-181 named but did not build.
9
+ *
10
+ * ## Why this is not a seventh `PROFILES` entry in `test-runner-collector.ts`
11
+ *
12
+ * Every runner on that seam is one spawn: inject a reporter flag, run the
13
+ * command as given. XCTest on Linux has no such flag. SwiftPM's generated
14
+ * test entry point (`runner.swift`, rebuilt fresh every build — not
15
+ * something a caller can edit) calls `XCTMain(__allDiscoveredTests())` with
16
+ * no `observers:` argument at all, even though the symbol accepts one and
17
+ * `swift test`'s own template privately builds — but never wires up — an
18
+ * `XCTestObservation` conformer of its own (`SwiftPMXCTestObserver`,
19
+ * confirmed dead: never instantiated, and its `testOutputPath` file never
20
+ * appears even under `--parallel`). So there is no flag to inject.
21
+ *
22
+ * What Linux *does* still honor is `Tests/LinuxMain.swift` — SwiftPM's
23
+ * pre-automatic-discovery entry point. Measured directly: when present, it
24
+ * replaces the generated runner outright (`swift test` skips building the
25
+ * `*PackageDiscoveredTests` module entirely when it exists), and a plain
26
+ * `XCTestObservationCenter.shared.addTestObserver(...)` call inside it
27
+ * genuinely receives every callback, streamed in real time, interleaved
28
+ * with the runner's own console output — not collected after the process
29
+ * exits.
30
+ *
31
+ * So this collector runs in two passes: build the tests once to discover
32
+ * them (`--dump-tests-json`, a real flag on the built `.xctest` binary,
33
+ * needing no `LinuxMain.swift` of its own — the discovery build uses
34
+ * SwiftPM's ordinary automatic discovery), generate a `LinuxMain.swift`
35
+ * naming every discovered class and method, then spawn `swift test` for
36
+ * real, which rebuilds against the generated file and runs it.
37
+ *
38
+ * ## The trade-off this creates, disclosed rather than hidden
39
+ *
40
+ * `Tests/LinuxMain.swift`'s presence does not just replace the XCTest
41
+ * dispatch, it removes the swift-testing one too. Measured directly: a
42
+ * package with both an XCTest method and a swift-testing `@Test` function,
43
+ * with no `LinuxMain.swift`, runs both — `swift test` invokes the built
44
+ * binary twice, once per `--testing-library` value. With a
45
+ * `LinuxMain.swift` present — ours or anyone's — the `@Test` function does
46
+ * not run at all: not skipped, not reported, simply never invoked; not
47
+ * even its banner line prints. So this collector observes the XCTest half
48
+ * in real time and *stops covering swift-testing while it is active* — the
49
+ * mirror image of RT-181's gap, not a fix for both halves at once.
50
+ * `stop()` removes the generated file afterward so an unattended
51
+ * `swift test` reverts to normal dual-framework discovery once this
52
+ * collector is done.
53
+ *
54
+ * ## The generated file is never a guess at the user's code
55
+ *
56
+ * Every class and method name comes from `--dump-tests-json` against a real
57
+ * build of the real target — the same build-time-derived source SwiftPM's
58
+ * own automatic discovery already trusts, not a scrape of source text. No
59
+ * `allTests` needs to exist anywhere in the user's own code; the generated
60
+ * file adds its own `__descryAllTests` extension per class instead, so a
61
+ * project that already declares a legacy `allTests` is never collided with.
62
+ *
63
+ * **Known limitation, disclosed rather than silently mishandled:** two test
64
+ * classes of the same bare name in two different modules of the same
65
+ * package produce two `extension <Name>` blocks that collide. Real, and not
66
+ * solved here — `discoverClasses` still returns both, and the generated
67
+ * file fails to compile rather than silently picking one, which is the
68
+ * refuse-rather-than-guess the rest of this codebase holds to.
69
+ */
70
+ import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
71
+ import { join } from "node:path";
72
+ import { spawnSync } from "node:child_process";
73
+ import { spawnProcess } from "@descryy/runtime-controller";
74
+ import { createEnvelopeGate, createEventTranslator, pumpLines, isNodeTestEvent } from "./test-runner-collector.js";
75
+ import { COLLECTOR_VERSION } from "./collector-version.js";
76
+ /**
77
+ * `--dump-tests-json`'s tree has no explicit node kind — a class is
78
+ * recognised structurally, as a node whose every child is itself a leaf (a
79
+ * bare `{"name": "testFoo"}` with no `tests` of its own, which is exactly
80
+ * the shape a test *method* has and a bundle/suite container never does).
81
+ * Anything else — the root, `"debug.xctest"`, a suite — is a container and
82
+ * is recursed into instead.
83
+ *
84
+ * A node whose name carries no `.` (so not `Module.Class`) is skipped
85
+ * rather than guessed at — `--dump-tests-json`'s own class names are always
86
+ * qualified this way in every build observed, and a bare name reaching here
87
+ * would mean this method's own structural assumption is wrong for that
88
+ * node, which is worth surfacing as a dropped class rather than papering
89
+ * over with an invented module.
90
+ */
91
+ export function discoverClasses(dump) {
92
+ const out = [];
93
+ const walk = (node) => {
94
+ const children = node.tests ?? [];
95
+ if (children.length > 0 && children.every((c) => c.tests === undefined)) {
96
+ const dot = node.name.indexOf(".");
97
+ if (dot === -1)
98
+ return;
99
+ out.push({
100
+ module: node.name.slice(0, dot),
101
+ className: node.name.slice(dot + 1),
102
+ methods: children.map((c) => c.name),
103
+ });
104
+ return;
105
+ }
106
+ for (const child of children)
107
+ walk(child);
108
+ };
109
+ walk(dump);
110
+ return out;
111
+ }
112
+ /** Present at the top of every file this module writes — never anything a human authored. `stop()` refuses to delete a `Tests/LinuxMain.swift` that lacks it. */
113
+ export const GENERATED_MARKER = "// Generated by @descryy/runtime-test-runner's swift-xctest observer -- safe to delete, regenerated on every observed run.";
114
+ /**
115
+ * The observer body, proven against a real `swift test` run before being
116
+ * templated here (not derived from documentation alone): `testCase.name` on
117
+ * Linux swift-corelibs-xctest is already `"<Class>.<method>"`, so it serves
118
+ * directly as both `name` and `qualifiedName` — XCTest has no `describe()`
119
+ * nesting for a `SuiteStack` to reconstruct. `testCase(_:didFailWithDescription:inFile:atLine:)`
120
+ * is the non-Darwin overload (confirmed against the exported symbols in
121
+ * `libXCTest.so`); the Darwin-only `XCTIssue` overload does not exist on
122
+ * this platform and is not referenced.
123
+ */
124
+ const OBSERVER_BODY = `final class DescryXCTestObserver: NSObject, XCTestObservation {
125
+ private var failureMessage: String?
126
+
127
+ func testBundleWillStart(_ testBundle: Bundle) {
128
+ emit(["type": "descry:envelope", "data": ["version": 1]])
129
+ }
130
+
131
+ func testCaseWillStart(_ testCase: XCTestCase) {
132
+ failureMessage = nil
133
+ emit(["type": "test:start", "data": ["name": testCase.name, "qualifiedName": testCase.name]])
134
+ }
135
+
136
+ func testCase(_ testCase: XCTestCase, didFailWithDescription description: String, inFile filePath: String?, atLine lineNumber: Int) {
137
+ if failureMessage == nil { failureMessage = description }
138
+ }
139
+
140
+ func testCaseDidFinish(_ testCase: XCTestCase) {
141
+ if let msg = failureMessage {
142
+ emit(["type": "test:fail", "data": ["name": testCase.name, "qualifiedName": testCase.name, "details": ["error": ["message": msg]]]])
143
+ } else {
144
+ emit(["type": "test:pass", "data": ["name": testCase.name, "qualifiedName": testCase.name]])
145
+ }
146
+ }
147
+
148
+ private func emit(_ obj: [String: Any]) {
149
+ if let data = try? JSONSerialization.data(withJSONObject: obj),
150
+ let str = String(data: data, encoding: .utf8) {
151
+ print(str)
152
+ fflush(stdout)
153
+ }
154
+ }
155
+ }`;
156
+ /** Pure: builds `Tests/LinuxMain.swift`'s full text from the classes `discoverClasses` found. No filesystem access. */
157
+ export function generateLinuxMain(classes) {
158
+ const modules = [...new Set(classes.map((c) => c.module))].sort();
159
+ const imports = modules.map((m) => `@testable import ${m}`).join("\n");
160
+ const extensions = classes
161
+ .map((c) => {
162
+ const entries = c.methods.map((m) => ` ("${m}", ${m}),`).join("\n");
163
+ return `extension ${c.className} {\n static var __descryAllTests: [(String, (${c.className}) -> () throws -> Void)] {\n [\n${entries}\n ]\n }\n}`;
164
+ })
165
+ .join("\n\n");
166
+ const entries = classes.map((c) => ` testCase(${c.className}.__descryAllTests),`).join("\n");
167
+ return `${GENERATED_MARKER}
168
+ import Foundation
169
+ import XCTest
170
+ ${imports}
171
+
172
+ ${extensions}
173
+
174
+ ${OBSERVER_BODY}
175
+
176
+ XCTestObservationCenter.shared.addTestObserver(DescryXCTestObserver())
177
+ XCTMain([
178
+ ${entries}
179
+ ])
180
+ `;
181
+ }
182
+ function run(command, args, cwd) {
183
+ const result = spawnSync(command, args, { cwd, encoding: "utf8" });
184
+ return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
185
+ }
186
+ /** `swift build --show-bin-path` — the one place this module asks SwiftPM where its own output goes, rather than assuming `.build/<triple>/debug`, which is not a stable public contract. */
187
+ function binPath(packageRoot) {
188
+ const result = run("swift", ["build", "--show-bin-path"], packageRoot);
189
+ if (result.status !== 0)
190
+ return null;
191
+ return result.stdout.trim();
192
+ }
193
+ function findXCTestBinary(dir) {
194
+ if (!existsSync(dir))
195
+ return null;
196
+ const found = readdirSync(dir).find((entry) => entry.endsWith(".xctest"));
197
+ return found === undefined ? null : join(dir, found);
198
+ }
199
+ /**
200
+ * Builds the tests once (ordinary automatic discovery — no `LinuxMain.swift`
201
+ * involved yet) and reads back `--dump-tests-json` from the resulting
202
+ * binary. A pre-existing Descry-generated `LinuxMain.swift` is removed
203
+ * first: left in place, this build would use last run's stale class list
204
+ * rather than discovering fresh, and could fail outright if a module it
205
+ * names has since been removed.
206
+ */
207
+ export function discoverSwiftTests(packageRoot) {
208
+ const linuxMain = join(packageRoot, "Tests", "LinuxMain.swift");
209
+ if (existsSync(linuxMain)) {
210
+ const content = readFileSync(linuxMain, "utf8");
211
+ if (content.startsWith(GENERATED_MARKER))
212
+ rmSync(linuxMain);
213
+ else {
214
+ return {
215
+ ok: false,
216
+ reason: `${linuxMain} already exists and was not written by this tool -- refusing to build over or replace a file this collector did not generate. Remove it, or move it aside, to use the XCTest observer.`,
217
+ };
218
+ }
219
+ }
220
+ const built = run("swift", ["build", "--build-tests"], packageRoot);
221
+ if (built.status !== 0) {
222
+ return { ok: false, reason: `swift build --build-tests failed:\n${built.stdout}${built.stderr}` };
223
+ }
224
+ const dir = binPath(packageRoot);
225
+ if (dir === null)
226
+ return { ok: false, reason: "swift build --show-bin-path failed to report a binary output directory" };
227
+ const binary = findXCTestBinary(dir);
228
+ if (binary === null)
229
+ return { ok: false, reason: `no .xctest binary found in ${dir} after a successful build --build-tests` };
230
+ const dumped = run(binary, ["--dump-tests-json"], packageRoot);
231
+ if (dumped.status !== 0) {
232
+ return { ok: false, reason: `${binary} --dump-tests-json failed:\n${dumped.stdout}${dumped.stderr}` };
233
+ }
234
+ let parsed;
235
+ try {
236
+ parsed = JSON.parse(dumped.stdout);
237
+ }
238
+ catch {
239
+ return { ok: false, reason: `${binary} --dump-tests-json did not produce valid JSON: ${dumped.stdout.slice(0, 500)}` };
240
+ }
241
+ const classes = discoverClasses(parsed);
242
+ if (classes.length === 0) {
243
+ return { ok: false, reason: "--dump-tests-json reported no XCTest classes (an empty test target, or every class had zero methods)" };
244
+ }
245
+ return { ok: true, classes };
246
+ }
247
+ /** Writes the generated file. Refuses (rather than overwrites) if a non-Descry `Tests/LinuxMain.swift` has appeared since `discoverSwiftTests` ran. */
248
+ export function writeLinuxMain(packageRoot, classes) {
249
+ const linuxMain = join(packageRoot, "Tests", "LinuxMain.swift");
250
+ if (existsSync(linuxMain) && !readFileSync(linuxMain, "utf8").startsWith(GENERATED_MARKER)) {
251
+ throw new Error(`${linuxMain} was created by something else between discovery and generation -- refusing to overwrite it.`);
252
+ }
253
+ writeFileSync(linuxMain, generateLinuxMain(classes), "utf8");
254
+ }
255
+ /** Removes a Descry-generated `Tests/LinuxMain.swift`, and only one — never a file this module did not write. */
256
+ export function removeGeneratedLinuxMain(packageRoot) {
257
+ const linuxMain = join(packageRoot, "Tests", "LinuxMain.swift");
258
+ if (existsSync(linuxMain) && readFileSync(linuxMain, "utf8").startsWith(GENERATED_MARKER)) {
259
+ rmSync(linuxMain);
260
+ }
261
+ }
262
+ function computeCapabilities() {
263
+ const reason = "SwiftXCTestCollector observes XCTest events (started/passed/failed) only -- the capability model has no field for that yet.";
264
+ const status = { availability: "unavailable", reason };
265
+ return {
266
+ domObservation: status,
267
+ consoleObservation: status,
268
+ networkObservation: status,
269
+ backendLogAccess: status,
270
+ distributedTrace: status,
271
+ sourceMapping: { availability: "available", reason: null },
272
+ stackCapture: status,
273
+ processLifecycle: status,
274
+ databaseObservation: status,
275
+ externalServiceObservation: status,
276
+ };
277
+ }
278
+ /**
279
+ * The two-pass XCTest collector. `start()` does the discover-then-generate
280
+ * work before spawning anything a caller would recognise as "the test run"
281
+ * — genuinely slower to become `available` than the single-spawn runners on
282
+ * this seam, and that latency is the cost of there being no reporter flag
283
+ * to inject instead.
284
+ */
285
+ export function createSwiftXCTestCollector(options) {
286
+ const capabilities = computeCapabilities();
287
+ let managed = null;
288
+ let completion = Promise.resolve();
289
+ let translator = null;
290
+ let generatedFile = false;
291
+ return {
292
+ collectorId: "swift-xctest-collector",
293
+ async start(ctx) {
294
+ const discovery = discoverSwiftTests(options.packageRoot);
295
+ if (!discovery.ok)
296
+ return { available: false, reason: discovery.reason };
297
+ try {
298
+ writeLinuxMain(options.packageRoot, discovery.classes);
299
+ generatedFile = true;
300
+ }
301
+ catch (error) {
302
+ return { available: false, reason: error instanceof Error ? error.message : String(error) };
303
+ }
304
+ const processId = `swift-xctest-${Date.now()}`;
305
+ managed = spawnProcess({
306
+ processId,
307
+ command: "swift",
308
+ args: ["test"],
309
+ cwd: options.packageRoot,
310
+ });
311
+ translator = createEventTranslator(ctx.emit, options.service, processId);
312
+ const activeTranslator = translator;
313
+ const gate = createEnvelopeGate();
314
+ const reportEnvelopeError = (reason) => {
315
+ ctx.emit({
316
+ timestamp: new Date().toISOString(),
317
+ source: "test-runner",
318
+ service: options.service ?? null,
319
+ process: processId,
320
+ traceId: null,
321
+ requestId: null,
322
+ correlationId: null,
323
+ graphNodeId: null,
324
+ stackTrace: null,
325
+ confidence: 1,
326
+ redactionStatus: "pending-redaction",
327
+ collectorVersion: COLLECTOR_VERSION,
328
+ eventType: "COLLECTOR_ERROR",
329
+ payload: { collector: "swift-xctest", reason },
330
+ sourceLocation: null,
331
+ });
332
+ };
333
+ completion = pumpLines(managed, (line) => {
334
+ if (line.trim() === "")
335
+ return;
336
+ let parsed;
337
+ try {
338
+ parsed = JSON.parse(line);
339
+ }
340
+ catch {
341
+ // swift test's own console output ("Test Suite 'X' started at...",
342
+ // the swift-testing banner, a compiler diagnostic) -- ordinary
343
+ // noise on the same stdout, not a parse failure of this reporter.
344
+ return;
345
+ }
346
+ if (!isNodeTestEvent(parsed)) {
347
+ const noise = gate.inspect(parsed, false);
348
+ if (noise.kind === "refuse")
349
+ reportEnvelopeError(noise.reason);
350
+ return;
351
+ }
352
+ const verdict = gate.inspect(parsed, true);
353
+ if (verdict.kind === "refuse") {
354
+ reportEnvelopeError(verdict.reason);
355
+ return;
356
+ }
357
+ if (verdict.kind !== "event")
358
+ return;
359
+ activeTranslator.handle(parsed);
360
+ }).then(() => {
361
+ activeTranslator.flush();
362
+ });
363
+ return { available: true };
364
+ },
365
+ async stop() {
366
+ if (managed !== null) {
367
+ await managed.kill();
368
+ }
369
+ await completion;
370
+ if (generatedFile)
371
+ removeGeneratedLinuxMain(options.packageRoot);
372
+ },
373
+ capabilities() {
374
+ return capabilities;
375
+ },
376
+ async waitForCompletion() {
377
+ await completion;
378
+ },
379
+ traceCoverage() {
380
+ return translator?.coverage() ?? { testsObserved: 0, idsPresent: 0, notRun: 0 };
381
+ },
382
+ };
383
+ }
384
+ //# sourceMappingURL=swift-xctest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swift-xctest.js","sourceRoot":"","sources":["../src/swift-xctest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAuB,MAAM,6BAA6B,CAAC;AAGhF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