@descryy/runtime-test-runner 0.3.0 → 0.4.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.
- package/LICENSE +6 -0
- package/dist/collector-version.d.ts +2 -6
- package/dist/collector-version.d.ts.map +1 -1
- package/dist/collector-version.js +2 -6
- package/dist/collector-version.js.map +1 -1
- package/dist/go-test.d.ts +24 -50
- package/dist/go-test.d.ts.map +1 -1
- package/dist/go-test.js +30 -68
- package/dist/go-test.js.map +1 -1
- package/dist/graph-mapping.d.ts +10 -28
- package/dist/graph-mapping.d.ts.map +1 -1
- package/dist/graph-mapping.js +16 -43
- package/dist/graph-mapping.js.map +1 -1
- package/dist/jest-reporter.d.ts +20 -46
- package/dist/jest-reporter.d.ts.map +1 -1
- package/dist/jest-reporter.js +28 -71
- package/dist/jest-reporter.js.map +1 -1
- package/dist/playwright-reporter.d.ts +16 -34
- package/dist/playwright-reporter.d.ts.map +1 -1
- package/dist/playwright-reporter.js +22 -51
- package/dist/playwright-reporter.js.map +1 -1
- package/dist/reporter.d.ts +7 -19
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +18 -52
- package/dist/reporter.js.map +1 -1
- package/dist/swift-xctest.d.ts +40 -94
- package/dist/swift-xctest.d.ts.map +1 -1
- package/dist/swift-xctest.js +47 -105
- package/dist/swift-xctest.js.map +1 -1
- package/dist/vitest-reporter.d.ts +19 -43
- package/dist/vitest-reporter.d.ts.map +1 -1
- package/dist/vitest-reporter.js +30 -82
- package/dist/vitest-reporter.js.map +1 -1
- package/package.json +11 -6
package/LICENSE
ADDED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `Evidence.collectorVersion`
|
|
3
|
-
*
|
|
4
|
-
* itself rather than hand-duplicated into a second string that can drift
|
|
5
|
-
* from what actually shipped. Same idea as `nodeVersion` elsewhere in this
|
|
6
|
-
* repo (`process.version`, always known, never probed) applied to a
|
|
7
|
-
* package instead of the Node runtime.
|
|
2
|
+
* `Evidence.collectorVersion` for every collector here: read from
|
|
3
|
+
* package.json directly so it can't drift from what shipped.
|
|
8
4
|
*/
|
|
9
5
|
export declare const COLLECTOR_VERSION: string;
|
|
10
6
|
//# sourceMappingURL=collector-version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collector-version.d.ts","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,iBAAiB,EAAE,MAA6E,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `Evidence.collectorVersion`
|
|
3
|
-
*
|
|
4
|
-
* itself rather than hand-duplicated into a second string that can drift
|
|
5
|
-
* from what actually shipped. Same idea as `nodeVersion` elsewhere in this
|
|
6
|
-
* repo (`process.version`, always known, never probed) applied to a
|
|
7
|
-
* package instead of the Node runtime.
|
|
2
|
+
* `Evidence.collectorVersion` for every collector here: read from
|
|
3
|
+
* package.json directly so it can't drift from what shipped.
|
|
8
4
|
*/
|
|
9
5
|
import { createRequire } from "node:module";
|
|
10
6
|
const require = createRequire(import.meta.url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collector-version.js","sourceRoot":"","sources":["../src/collector-version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAY,OAAO,CAAC,iBAAiB,CAAkC,CAAC,OAAO,CAAC"}
|
package/dist/go-test.d.ts
CHANGED
|
@@ -1,54 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §17
|
|
3
|
-
*
|
|
4
|
-
* streams one NDJSON line per real event as the run happens — no report
|
|
5
|
-
* file, no end-of-run artifact, the same streaming-first shape every other
|
|
6
|
-
* runner on this seam already has.
|
|
2
|
+
* §17 Go row (RT closed by evaluating `go test -json`): streams one NDJSON line
|
|
3
|
+
* per event as the run happens, no report file.
|
|
7
4
|
*
|
|
8
|
-
*
|
|
5
|
+
* Standalone collector, not a `PROFILES` entry: `go test -json` writes its own
|
|
6
|
+
* shape (`{"Action": "run", "Package": ..., "Test": ...}`), not a Descry envelope,
|
|
7
|
+
* and never will be — so translation happens on the reading side via a dedicated
|
|
8
|
+
* collector rather than branching the shared read-loop mid-stream. No envelope
|
|
9
|
+
* version gate needed either: this translator compiles with `createEventTranslator`
|
|
10
|
+
* under the same `tsc -b`, so it can't drift without the build failing.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* bolting that into the shared pipeline would have made one runner's single
|
|
18
|
-
* shared read-loop branch on which format it is mid-stream. A dedicated
|
|
19
|
-
* collector keeps that branch from existing at all.
|
|
12
|
+
* Container problem, Go's shape: a table test's `t.Run` subtests each report
|
|
13
|
+
* their own pass/fail, AND the parent reports too — forwarding the parent would
|
|
14
|
+
* double-count, same defect refused for JUnit/node:test. Measured: every child's
|
|
15
|
+
* `run` arrives while the parent is still open, and the parent's result always
|
|
16
|
+
* arrives last, so parentage is detected by name prefix (`Parent/child`) while
|
|
17
|
+
* streaming, no lookahead needed. A test with children is a container: its own
|
|
18
|
+
* pass/fail is suppressed.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* TypeScript, compiled by the same `tsc -b` as `createEventTranslator`, so
|
|
25
|
-
* it cannot drift from it without the build itself failing.
|
|
26
|
-
*
|
|
27
|
-
* ## The container problem, Go's own shape of it
|
|
28
|
-
*
|
|
29
|
-
* A table test's `t.Run("case", ...)` subtests each get their own
|
|
30
|
-
* `run`/`pass`/`fail` — AND the parent `TestTable` gets its own `pass`/`fail`
|
|
31
|
-
* too, reporting purely whether any child failed. Forwarding it would be
|
|
32
|
-
* the exact defect this checklist already refused for JUnit's containers and
|
|
33
|
-
* node:test's `describe` blocks: one child failure counted twice. Measured
|
|
34
|
-
* directly (not assumed): Go emits every child's own `run` while the parent
|
|
35
|
-
* is still open, and the parent's result always arrives last — so parentage
|
|
36
|
-
* is detected by name prefix (`Parent/child`) while streaming, with no
|
|
37
|
-
* lookahead needed. A test with children is a container: its own eventual
|
|
38
|
-
* pass/fail is suppressed here, never handed to the shared translator.
|
|
39
|
-
*
|
|
40
|
-
* ## No source location, and that is disclosed rather than scraped
|
|
41
|
-
*
|
|
42
|
-
* `go test -json` carries no `file`/`line` field. The only place a location
|
|
43
|
-
* appears is inside a captured `Output` line's own text
|
|
44
|
-
* (`probe_test.go:13: message`) — exactly the "scrape formatted text" this
|
|
45
|
-
* codebase already refuses for `cargo test`'s TAP-shaped prose. Not done
|
|
46
|
-
* here either: `sourceLocation` stays null, an honest gap instead of a
|
|
47
|
-
* guess with a filename in it that might be a helper's, not the test's own.
|
|
20
|
+
* No source location: `go test -json` has no `file`/`line` field, only a
|
|
21
|
+
* possible mention inside captured `Output` text — not scraped (same refusal as
|
|
22
|
+
* `cargo test`'s prose). `sourceLocation` stays null: an honest gap, not a guess.
|
|
48
23
|
*/
|
|
49
24
|
import type { Collector } from "@descryy/runtime-contracts";
|
|
50
25
|
import { type NodeTestEvent, type TraceCoverage } from "./test-runner-collector.ts";
|
|
51
|
-
/** One line of `go test -json`
|
|
26
|
+
/** One line of `go test -json` NDJSON — undocumented as a contract but stable in shape since Go 1.10. */
|
|
52
27
|
export interface GoTestEvent {
|
|
53
28
|
readonly Action: "start" | "run" | "pause" | "cont" | "bench" | "pass" | "fail" | "skip" | "output";
|
|
54
29
|
readonly Package?: string;
|
|
@@ -58,11 +33,10 @@ export interface GoTestEvent {
|
|
|
58
33
|
}
|
|
59
34
|
export declare function isGoTestEvent(value: unknown): value is GoTestEvent;
|
|
60
35
|
/**
|
|
61
|
-
* Go-native JSON in, shared `NodeTestEvent`
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* as having children before the parent's own result arrives.
|
|
36
|
+
* Go-native JSON in, shared `NodeTestEvent` out (or null for a suppressed
|
|
37
|
+
* container or package-level line with no `Test`). Keeps one open entry per
|
|
38
|
+
* in-flight test name (`Parent`, `Parent/child`) so a child's `run` can mark
|
|
39
|
+
* its parent as having children before the parent's result arrives.
|
|
66
40
|
*/
|
|
67
41
|
export declare function createGoEventTranslator(): {
|
|
68
42
|
translate(event: GoTestEvent): NodeTestEvent | null;
|
|
@@ -70,7 +44,7 @@ export declare function createGoEventTranslator(): {
|
|
|
70
44
|
export interface GoTestCollectorOptions {
|
|
71
45
|
readonly command: string;
|
|
72
46
|
readonly cwd: string;
|
|
73
|
-
/** Joins emitted Evidence
|
|
47
|
+
/** Joins emitted Evidence to a named service; omit for a standalone run with no corresponding service. */
|
|
74
48
|
readonly service?: string;
|
|
75
49
|
}
|
|
76
50
|
export interface GoTestCollector extends Collector {
|
package/dist/go-test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go-test.d.ts","sourceRoot":"","sources":["../src/go-test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"go-test.d.ts","sourceRoot":"","sources":["../src/go-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAiE,MAAM,4BAA4B,CAAC;AAE3H,OAAO,EAAoC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEtH,yGAAyG;AACzG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI;IAAE,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAAA;CAAE,CAwEjG;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0GAA0G;IAC1G,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAmBD,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,aAAa,IAAI,aAAa,CAAC;CAChC;AAOD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAoEtF"}
|
package/dist/go-test.js
CHANGED
|
@@ -1,50 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §17
|
|
3
|
-
*
|
|
4
|
-
* streams one NDJSON line per real event as the run happens — no report
|
|
5
|
-
* file, no end-of-run artifact, the same streaming-first shape every other
|
|
6
|
-
* runner on this seam already has.
|
|
2
|
+
* §17 Go row (RT closed by evaluating `go test -json`): streams one NDJSON line
|
|
3
|
+
* per event as the run happens, no report file.
|
|
7
4
|
*
|
|
8
|
-
*
|
|
5
|
+
* Standalone collector, not a `PROFILES` entry: `go test -json` writes its own
|
|
6
|
+
* shape (`{"Action": "run", "Package": ..., "Test": ...}`), not a Descry envelope,
|
|
7
|
+
* and never will be — so translation happens on the reading side via a dedicated
|
|
8
|
+
* collector rather than branching the shared read-loop mid-stream. No envelope
|
|
9
|
+
* version gate needed either: this translator compiles with `createEventTranslator`
|
|
10
|
+
* under the same `tsc -b`, so it can't drift without the build failing.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* bolting that into the shared pipeline would have made one runner's single
|
|
18
|
-
* shared read-loop branch on which format it is mid-stream. A dedicated
|
|
19
|
-
* collector keeps that branch from existing at all.
|
|
12
|
+
* Container problem, Go's shape: a table test's `t.Run` subtests each report
|
|
13
|
+
* their own pass/fail, AND the parent reports too — forwarding the parent would
|
|
14
|
+
* double-count, same defect refused for JUnit/node:test. Measured: every child's
|
|
15
|
+
* `run` arrives while the parent is still open, and the parent's result always
|
|
16
|
+
* arrives last, so parentage is detected by name prefix (`Parent/child`) while
|
|
17
|
+
* streaming, no lookahead needed. A test with children is a container: its own
|
|
18
|
+
* pass/fail is suppressed.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* TypeScript, compiled by the same `tsc -b` as `createEventTranslator`, so
|
|
25
|
-
* it cannot drift from it without the build itself failing.
|
|
26
|
-
*
|
|
27
|
-
* ## The container problem, Go's own shape of it
|
|
28
|
-
*
|
|
29
|
-
* A table test's `t.Run("case", ...)` subtests each get their own
|
|
30
|
-
* `run`/`pass`/`fail` — AND the parent `TestTable` gets its own `pass`/`fail`
|
|
31
|
-
* too, reporting purely whether any child failed. Forwarding it would be
|
|
32
|
-
* the exact defect this checklist already refused for JUnit's containers and
|
|
33
|
-
* node:test's `describe` blocks: one child failure counted twice. Measured
|
|
34
|
-
* directly (not assumed): Go emits every child's own `run` while the parent
|
|
35
|
-
* is still open, and the parent's result always arrives last — so parentage
|
|
36
|
-
* is detected by name prefix (`Parent/child`) while streaming, with no
|
|
37
|
-
* lookahead needed. A test with children is a container: its own eventual
|
|
38
|
-
* pass/fail is suppressed here, never handed to the shared translator.
|
|
39
|
-
*
|
|
40
|
-
* ## No source location, and that is disclosed rather than scraped
|
|
41
|
-
*
|
|
42
|
-
* `go test -json` carries no `file`/`line` field. The only place a location
|
|
43
|
-
* appears is inside a captured `Output` line's own text
|
|
44
|
-
* (`probe_test.go:13: message`) — exactly the "scrape formatted text" this
|
|
45
|
-
* codebase already refuses for `cargo test`'s TAP-shaped prose. Not done
|
|
46
|
-
* here either: `sourceLocation` stays null, an honest gap instead of a
|
|
47
|
-
* guess with a filename in it that might be a helper's, not the test's own.
|
|
20
|
+
* No source location: `go test -json` has no `file`/`line` field, only a
|
|
21
|
+
* possible mention inside captured `Output` text — not scraped (same refusal as
|
|
22
|
+
* `cargo test`'s prose). `sourceLocation` stays null: an honest gap, not a guess.
|
|
48
23
|
*/
|
|
49
24
|
import { spawnProcess } from "@descryy/runtime-controller";
|
|
50
25
|
import { createEventTranslator, pumpLines } from "./test-runner-collector.js";
|
|
@@ -52,11 +27,10 @@ export function isGoTestEvent(value) {
|
|
|
52
27
|
return typeof value === "object" && value !== null && "Action" in value;
|
|
53
28
|
}
|
|
54
29
|
/**
|
|
55
|
-
* Go-native JSON in, shared `NodeTestEvent`
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* as having children before the parent's own result arrives.
|
|
30
|
+
* Go-native JSON in, shared `NodeTestEvent` out (or null for a suppressed
|
|
31
|
+
* container or package-level line with no `Test`). Keeps one open entry per
|
|
32
|
+
* in-flight test name (`Parent`, `Parent/child`) so a child's `run` can mark
|
|
33
|
+
* its parent as having children before the parent's result arrives.
|
|
60
34
|
*/
|
|
61
35
|
export function createGoEventTranslator() {
|
|
62
36
|
const open = new Map();
|
|
@@ -68,7 +42,7 @@ export function createGoEventTranslator() {
|
|
|
68
42
|
translate(event) {
|
|
69
43
|
const name = event.Test;
|
|
70
44
|
if (name === undefined)
|
|
71
|
-
return null; // package-level line
|
|
45
|
+
return null; // package-level line, no single test to attribute it to
|
|
72
46
|
const qualifiedName = event.Package !== undefined ? `${event.Package}.${name}` : name;
|
|
73
47
|
switch (event.Action) {
|
|
74
48
|
case "run": {
|
|
@@ -90,9 +64,7 @@ export function createGoEventTranslator() {
|
|
|
90
64
|
case "skip": {
|
|
91
65
|
const entry = open.get(name);
|
|
92
66
|
open.delete(name);
|
|
93
|
-
//
|
|
94
|
-
// were already reported individually -- forwarding it would be the
|
|
95
|
-
// same double-count RT-074/RT-092 refused for JUnit and node:test.
|
|
67
|
+
// container result redundant with children's, already reported (RT-074/RT-092)
|
|
96
68
|
if (entry?.hasChildren === true)
|
|
97
69
|
return null;
|
|
98
70
|
if (event.Action === "skip") {
|
|
@@ -102,24 +74,15 @@ export function createGoEventTranslator() {
|
|
|
102
74
|
name,
|
|
103
75
|
qualifiedName,
|
|
104
76
|
skip: true,
|
|
105
|
-
// Go's JSON
|
|
106
|
-
//
|
|
107
|
-
// would be a guess this translator refuses to make.
|
|
77
|
+
// Go's JSON doesn't distinguish unconditional t.Skip() from a
|
|
78
|
+
// conditional bail -- not guessed which.
|
|
108
79
|
skipReason: "unspecified",
|
|
109
80
|
},
|
|
110
81
|
};
|
|
111
82
|
}
|
|
112
83
|
const message = (entry?.output ?? []).join("").trim();
|
|
113
84
|
const durationMs = event.Elapsed !== undefined ? { duration_ms: event.Elapsed * 1000 } : {};
|
|
114
|
-
// `error`
|
|
115
|
-
// `NodeTestEvent` type -- only `code`/`failureType`/`cause`.
|
|
116
|
-
// Jest's own reporter (`jest-reporter.ts`) is not held to this
|
|
117
|
-
// check at all: it emits raw JSON via `console.log`, never an
|
|
118
|
-
// object literal typed as `NodeTestEvent`, so it can and does put
|
|
119
|
-
// arbitrary fields under `error`. This translator constructs a
|
|
120
|
-
// typed literal directly, so it uses the two real, declared
|
|
121
|
-
// fields instead: `failureType` names the kind, `cause` (typed
|
|
122
|
-
// `unknown`) carries the captured Output text verbatim.
|
|
85
|
+
// NodeTestEvent's `error` has no free-form `message`, only code/failureType/cause.
|
|
123
86
|
const errorField = event.Action === "fail" ? { error: { failureType: "test", cause: message } } : {};
|
|
124
87
|
return {
|
|
125
88
|
type: event.Action === "pass" ? "test:pass" : "test:fail",
|
|
@@ -152,7 +115,7 @@ function computeCapabilities() {
|
|
|
152
115
|
externalServiceObservation: status,
|
|
153
116
|
};
|
|
154
117
|
}
|
|
155
|
-
/** Splits `command` on whitespace,
|
|
118
|
+
/** Splits `command` on whitespace, same as `discoverRunner` elsewhere -- no shell quoting support. */
|
|
156
119
|
function splitCommand(command) {
|
|
157
120
|
return command.trim().split(/\s+/).filter((s) => s.length > 0);
|
|
158
121
|
}
|
|
@@ -190,9 +153,8 @@ export function createGoTestCollector(options) {
|
|
|
190
153
|
parsed = JSON.parse(line);
|
|
191
154
|
}
|
|
192
155
|
catch {
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
// not a parse failure of this collector's own reporter.
|
|
156
|
+
// go build/vet diagnostics print as plain text ahead of the JSON stream
|
|
157
|
+
// on a build failure -- ordinary noise, not a real parse failure.
|
|
196
158
|
return;
|
|
197
159
|
}
|
|
198
160
|
if (!isGoTestEvent(parsed))
|
package/dist/go-test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"go-test.js","sourceRoot":"","sources":["../src/go-test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"go-test.js","sourceRoot":"","sources":["../src/go-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,YAAY,EAAuB,MAAM,6BAA6B,CAAC;AAGhF,OAAO,EAAE,qBAAqB,EAAE,SAAS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AAM,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;KACF,CAAC;AACJ,CAAC"}
|
package/dist/graph-mapping.d.ts
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §17
|
|
3
|
-
*
|
|
4
|
-
* `resolveTestCaseNode` (`@descryy/runtime-graph-correlator`) already knows
|
|
5
|
-
* how to find.
|
|
2
|
+
* §17 TEST_CASE graph mapping (RT-076): resolves observed-test evidence to the
|
|
3
|
+
* real `TEST_CASE` node via `resolveTestCaseNode` (`@descryy/runtime-graph-correlator`).
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* has two names -- `payload.name` (node:test's own, unprefixed) and
|
|
13
|
-
* `payload.qualifiedName` (suite-prefixed, matching the graph's own
|
|
14
|
-
* convention) -- and using the wrong one is a silent, plausible-looking
|
|
15
|
-
* miss (see `test-runner-collector.ts`'s own `SuiteStack` comment). This
|
|
16
|
-
* function is the one place that decision is made, so it cannot be made
|
|
17
|
-
* wrong at each call site independently.
|
|
5
|
+
* A thin translation, not a new abstraction — exists only because
|
|
6
|
+
* TEST_STARTED/PASSED/FAILED carries two names, `payload.name` (node:test's own,
|
|
7
|
+
* unprefixed) and `payload.qualifiedName` (suite-prefixed, matching the graph's
|
|
8
|
+
* convention), and picking the wrong one is a silent plausible-looking miss.
|
|
9
|
+
* Centralized here so that decision is made once.
|
|
18
10
|
*
|
|
19
|
-
* Does not call `EvidenceStore.attribute()
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* other collector's `graphNodeId: null`. The caller that already holds
|
|
23
|
-
* both the store and the graph `driver` (the same one `vertical-slice`'s
|
|
24
|
-
* tests already are) attributes; this only resolves.
|
|
11
|
+
* Does not call `EvidenceStore.attribute()`: that needs `evidenceId`, which only
|
|
12
|
+
* exists after `store.write()` returns — outside this collector's reach. The
|
|
13
|
+
* caller holding both store and graph `driver` attributes; this only resolves.
|
|
25
14
|
*/
|
|
26
15
|
import type { SqlDriver } from "@descryy/core";
|
|
27
16
|
import { type TestCaseResolution } from "@descryy/runtime-graph-correlator";
|
|
@@ -30,13 +19,6 @@ export type ObservedTestCaseResolution = TestCaseResolution | {
|
|
|
30
19
|
readonly outcome: "no-location";
|
|
31
20
|
readonly reason: string;
|
|
32
21
|
};
|
|
33
|
-
/**
|
|
34
|
-
* Refuses (returns `"no-location"`, never throws) for anything that isn't
|
|
35
|
-
* TEST_STARTED/PASSED/FAILED evidence with a real `sourceLocation.file` --
|
|
36
|
-
* the same "wrong input, refuse rather than guess" shape every resolver in
|
|
37
|
-
* `graph-correlator` already uses for a missing `repoRoot` or an evidence
|
|
38
|
-
* item outside the declared repo.
|
|
39
|
-
*/
|
|
40
22
|
export declare function resolveObservedTestCase(driver: SqlDriver, evidence: Pick<Evidence, "eventType" | "payload" | "sourceLocation">, repo: string, options?: {
|
|
41
23
|
readonly repoRoot?: string;
|
|
42
24
|
readonly producerScanLimit?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-mapping.d.ts","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"graph-mapping.d.ts","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,4BAA4B,CAAC;AAO7E,MAAM,MAAM,0BAA0B,GAClC,kBAAkB,GAClB;IAAE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAKjE,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,gBAAgB,CAAC,EACpE,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAO,GAChF,0BAA0B,CA2B5B"}
|
package/dist/graph-mapping.js
CHANGED
|
@@ -1,52 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §17
|
|
3
|
-
*
|
|
4
|
-
* `resolveTestCaseNode` (`@descryy/runtime-graph-correlator`) already knows
|
|
5
|
-
* how to find.
|
|
2
|
+
* §17 TEST_CASE graph mapping (RT-076): resolves observed-test evidence to the
|
|
3
|
+
* real `TEST_CASE` node via `resolveTestCaseNode` (`@descryy/runtime-graph-correlator`).
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* has two names -- `payload.name` (node:test's own, unprefixed) and
|
|
13
|
-
* `payload.qualifiedName` (suite-prefixed, matching the graph's own
|
|
14
|
-
* convention) -- and using the wrong one is a silent, plausible-looking
|
|
15
|
-
* miss (see `test-runner-collector.ts`'s own `SuiteStack` comment). This
|
|
16
|
-
* function is the one place that decision is made, so it cannot be made
|
|
17
|
-
* wrong at each call site independently.
|
|
5
|
+
* A thin translation, not a new abstraction — exists only because
|
|
6
|
+
* TEST_STARTED/PASSED/FAILED carries two names, `payload.name` (node:test's own,
|
|
7
|
+
* unprefixed) and `payload.qualifiedName` (suite-prefixed, matching the graph's
|
|
8
|
+
* convention), and picking the wrong one is a silent plausible-looking miss.
|
|
9
|
+
* Centralized here so that decision is made once.
|
|
18
10
|
*
|
|
19
|
-
* Does not call `EvidenceStore.attribute()
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* other collector's `graphNodeId: null`. The caller that already holds
|
|
23
|
-
* both the store and the graph `driver` (the same one `vertical-slice`'s
|
|
24
|
-
* tests already are) attributes; this only resolves.
|
|
11
|
+
* Does not call `EvidenceStore.attribute()`: that needs `evidenceId`, which only
|
|
12
|
+
* exists after `store.write()` returns — outside this collector's reach. The
|
|
13
|
+
* caller holding both store and graph `driver` attributes; this only resolves.
|
|
25
14
|
*/
|
|
26
15
|
import { resolveTestCaseNode } from "@descryy/runtime-graph-correlator";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* RT-124's own commit message said a skipped test "resolves to the same
|
|
31
|
-
* `TEST_CASE` node a run test does". That was true of the payload — it
|
|
32
|
-
* carries `sourceLocation` and `qualifiedName` exactly like a pass — and
|
|
33
|
-
* false of this set, which refused it with the message a *wrong input*
|
|
34
|
-
* gets. The type was a counter with extra steps, which is precisely what
|
|
35
|
-
* the proposal argued against, and the claim was never checked against
|
|
36
|
-
* this line.
|
|
37
|
-
*
|
|
38
|
-
* The point of making it an event was that "the function you changed has a
|
|
39
|
-
* test and it is disabled" is expressible. It is not expressible if the
|
|
40
|
-
* evidence cannot reach a node.
|
|
41
|
-
*/
|
|
16
|
+
// TEST_SKIPPED belongs in this set and was missing (RT-129) — its payload carries
|
|
17
|
+
// `sourceLocation`/`qualifiedName` just like a pass, so it must resolve to a node too,
|
|
18
|
+
// otherwise "this test exists and is disabled" can't be expressed.
|
|
42
19
|
const TEST_CASE_EVENT_TYPES = new Set(["TEST_STARTED", "TEST_PASSED", "TEST_FAILED", "TEST_SKIPPED"]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* the same "wrong input, refuse rather than guess" shape every resolver in
|
|
47
|
-
* `graph-correlator` already uses for a missing `repoRoot` or an evidence
|
|
48
|
-
* item outside the declared repo.
|
|
49
|
-
*/
|
|
20
|
+
// Refuses (`"no-location"`, never throws) for anything that isn't TEST_STARTED/PASSED/FAILED/SKIPPED
|
|
21
|
+
// with a real `sourceLocation.file` — same refuse-rather-than-guess shape as every
|
|
22
|
+
// `graph-correlator` resolver.
|
|
50
23
|
export function resolveObservedTestCase(driver, evidence, repo, options = {}) {
|
|
51
24
|
if (!TEST_CASE_EVENT_TYPES.has(evidence.eventType)) {
|
|
52
25
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-mapping.js","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"graph-mapping.js","sourceRoot":"","sources":["../src/graph-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,mBAAmB,EAA2B,MAAM,mCAAmC,CAAC;AAGjG,kFAAkF;AAClF,uFAAuF;AACvF,mEAAmE;AACnE,MAAM,qBAAqB,GAAkC,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AAMrI,qGAAqG;AACrG,mFAAmF;AACnF,+BAA+B;AAC/B,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,QAAoE,EACpE,IAAY,EACZ,UAA+E,EAAE;IAEjF,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACnD,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,0BAA0B,QAAQ,CAAC,SAAS,2HAA2H;SAChL,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,EAAE,IAAI,IAAI,IAAI,CAAC;IACnD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,sFAAsF,EAAE,CAAC;IACpI,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAA+C,CAAC;IACzE,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/F,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,sIAAsI;SAC/I,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,EAAE,IAAI,IAAI,IAAI,CAAC;IACnD,OAAO,mBAAmB,CACxB,MAAM,EACN,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EACrE,IAAI,EACJ,OAAO,CACR,CAAC;AACJ,CAAC"}
|
package/dist/jest-reporter.d.ts
CHANGED
|
@@ -1,50 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `testCaseResult.ancestorTitles` is the real `describe()` chain, so
|
|
23
|
-
* `qualifiedName` is exact rather than reconstructed — node:test forced
|
|
24
|
-
* `SuiteStack` to rebuild it from `nesting` because its events carry only
|
|
25
|
-
* the innermost title (RT-076). Emitting it directly is why the translator
|
|
26
|
-
* prefers a supplied `qualifiedName` over its own reconstruction.
|
|
27
|
-
*
|
|
28
|
-
* **Jest's own `fullName` is the same space-joined string** and is used
|
|
29
|
-
* here in preference to re-joining, since it is what Jest itself
|
|
30
|
-
* considers the test's full name. It matches `adapter-typescript`'s
|
|
31
|
-
* TEST_CASE convention (`[...suite, title].join(" ")`) exactly — verified
|
|
32
|
-
* against a real run, not assumed. Vitest's `fullName` does **not** (it
|
|
33
|
-
* joins with `" > "`), which is why `vitest-reporter.ts` rebuilds it and
|
|
34
|
-
* this one does not.
|
|
35
|
-
*
|
|
36
|
-
* **`onTestCaseStart` carries no location** — measured. Only
|
|
37
|
-
* `onTestCaseResult` does, and only when `--testLocationInResults` is
|
|
38
|
-
* passed. So TEST_STARTED for Jest has a `file` but null `line`/`column`,
|
|
39
|
-
* where node:test's has all three. Disclosed rather than filled in.
|
|
40
|
-
*
|
|
41
|
-
* ## `--testLocationInResults` is load-bearing, and its absence is silent
|
|
42
|
-
*
|
|
43
|
-
* Measured directly: without it, `testCaseResult.location` is `undefined`
|
|
44
|
-
* on every result. The collector still runs, still emits every event, and
|
|
45
|
-
* every one silently has no line or column — the same shape as RT-073's
|
|
46
|
-
* reporter-flag ordering bug, where the failure was "no error, wrong
|
|
47
|
-
* output". `withReporterFlags` injects it; it is not left to the caller.
|
|
2
|
+
* Jest custom reporter (`--reporters=`), emitting the same NDJSON envelope
|
|
3
|
+
* `reporter.ts` emits for node:test.
|
|
4
|
+
*
|
|
5
|
+
* Three reporters, one envelope, not three collectors: each runner speaks its
|
|
6
|
+
* own API and writes the shape `test-runner-collector.ts` reads
|
|
7
|
+
* (`{type: "test:start"|"test:pass"|"test:fail", data: {...}}`, kept as
|
|
8
|
+
* node:test's own names since it was first). `createEventTranslator` needs no
|
|
9
|
+
* per-runner branch; everything Jest-specific lives here.
|
|
10
|
+
*
|
|
11
|
+
* `testCaseResult.ancestorTitles` gives the real `describe()` chain, so
|
|
12
|
+
* `qualifiedName` is exact, not reconstructed (contrast node:test's `SuiteStack`,
|
|
13
|
+
* RT-076). Jest's `fullName` is used directly since it matches
|
|
14
|
+
* `adapter-typescript`'s TEST_CASE convention (`[...suite, title].join(" ")`)
|
|
15
|
+
* exactly (verified against a real run) — Vitest's `fullName` does not (joins
|
|
16
|
+
* with `" > "`), which is why `vitest-reporter.ts` rebuilds it and this doesn't.
|
|
17
|
+
*
|
|
18
|
+
* `onTestCaseStart` carries no location (measured); only `onTestCaseResult`
|
|
19
|
+
* does, and only with `--testLocationInResults`. Without that flag,
|
|
20
|
+
* `location` is silently `undefined` on every result (same failure shape as
|
|
21
|
+
* RT-073) — `withReporterFlags` injects it rather than leaving it to the caller.
|
|
48
22
|
*/
|
|
49
23
|
interface JestTestCaseStartInfo {
|
|
50
24
|
readonly title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest-reporter.d.ts","sourceRoot":"","sources":["../src/jest-reporter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"jest-reporter.d.ts","sourceRoot":"","sources":["../src/jest-reporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED,UAAU,kBAAmB,SAAQ,qBAAqB;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/E;AAED,UAAU,QAAQ;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAaD,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACrC,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAUlE,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI;CAyBnE"}
|