@quenty/nevermore-cli 4.41.1 → 4.42.1-canary.783.30683193716.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/CHANGELOG.md +28 -0
- package/dist/args/global-args.d.ts +13 -0
- package/dist/args/global-args.d.ts.map +1 -1
- package/dist/commands/batch-command/batch-deploy-command.d.ts +3 -0
- package/dist/commands/batch-command/batch-deploy-command.d.ts.map +1 -1
- package/dist/commands/batch-command/batch-deploy-command.js +90 -1
- package/dist/commands/batch-command/batch-deploy-command.js.map +1 -1
- package/dist/commands/batch-command/batch-test-command.d.ts.map +1 -1
- package/dist/commands/batch-command/batch-test-command.js +25 -4
- package/dist/commands/batch-command/batch-test-command.js.map +1 -1
- package/dist/commands/deploy-command/deploy-init.js +1 -1
- package/dist/commands/deploy-command/deploy-init.js.map +1 -1
- package/dist/commands/deploy-command/index.d.ts +3 -0
- package/dist/commands/deploy-command/index.d.ts.map +1 -1
- package/dist/commands/deploy-command/index.js +297 -60
- package/dist/commands/deploy-command/index.js.map +1 -1
- package/dist/commands/deploy-command/select-target.js +1 -1
- package/dist/commands/deploy-command/select-target.js.map +1 -1
- package/dist/commands/deploy-command/version-command.d.ts.map +1 -1
- package/dist/commands/deploy-command/version-command.js +138 -12
- package/dist/commands/deploy-command/version-command.js.map +1 -1
- package/dist/commands/test-command/test-command.d.ts.map +1 -1
- package/dist/commands/test-command/test-command.js +23 -11
- package/dist/commands/test-command/test-command.js.map +1 -1
- package/dist/nevermore.js +17 -0
- package/dist/nevermore.js.map +1 -1
- package/dist/utils/batch/changed-packages-utils.d.ts +1 -1
- package/dist/utils/batch/changed-packages-utils.d.ts.map +1 -1
- package/dist/utils/batch/changed-packages-utils.js +1 -1
- package/dist/utils/batch/changed-packages-utils.js.map +1 -1
- package/dist/utils/build/base-place-resolver-factory.d.ts +25 -0
- package/dist/utils/build/base-place-resolver-factory.d.ts.map +1 -0
- package/dist/utils/build/base-place-resolver-factory.js +40 -0
- package/dist/utils/build/base-place-resolver-factory.js.map +1 -0
- package/dist/utils/build/build.d.ts +13 -2
- package/dist/utils/build/build.d.ts.map +1 -1
- package/dist/utils/build/build.js.map +1 -1
- package/dist/utils/build/upload.d.ts +1 -1
- package/dist/utils/build/upload.d.ts.map +1 -1
- package/dist/utils/deploy/deploy-metadata.d.ts +1 -1
- package/dist/utils/deploy/deploy-metadata.d.ts.map +1 -1
- package/dist/utils/job-context/base-job-context.d.ts +3 -1
- package/dist/utils/job-context/base-job-context.d.ts.map +1 -1
- package/dist/utils/job-context/base-job-context.js +45 -6
- package/dist/utils/job-context/base-job-context.js.map +1 -1
- package/dist/utils/job-context/batch-script-job-context.d.ts +6 -0
- package/dist/utils/job-context/batch-script-job-context.d.ts.map +1 -1
- package/dist/utils/job-context/batch-script-job-context.js +13 -0
- package/dist/utils/job-context/batch-script-job-context.js.map +1 -1
- package/dist/utils/job-context/cloud-job-context.d.ts +2 -1
- package/dist/utils/job-context/cloud-job-context.d.ts.map +1 -1
- package/dist/utils/job-context/cloud-job-context.js +2 -2
- package/dist/utils/job-context/cloud-job-context.js.map +1 -1
- package/dist/utils/job-context/local-job-context.d.ts +2 -1
- package/dist/utils/job-context/local-job-context.d.ts.map +1 -1
- package/dist/utils/job-context/local-job-context.js +2 -2
- package/dist/utils/job-context/local-job-context.js.map +1 -1
- package/dist/utils/open-cloud/open-cloud-client.d.ts +20 -2
- package/dist/utils/open-cloud/open-cloud-client.d.ts.map +1 -1
- package/dist/utils/open-cloud/open-cloud-client.js +78 -21
- package/dist/utils/open-cloud/open-cloud-client.js.map +1 -1
- package/dist/utils/open-cloud/open-cloud-client.test.js +89 -12
- package/dist/utils/open-cloud/open-cloud-client.test.js.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.d.ts +13 -5
- package/dist/utils/testing/parsers/batch-log-parser.d.ts.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.js +114 -68
- package/dist/utils/testing/parsers/batch-log-parser.js.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.test.js +57 -5
- package/dist/utils/testing/parsers/batch-log-parser.test.js.map +1 -1
- package/dist/utils/testing/parsers/traceback-parser.d.ts +31 -0
- package/dist/utils/testing/parsers/traceback-parser.d.ts.map +1 -0
- package/dist/utils/testing/parsers/traceback-parser.js +91 -0
- package/dist/utils/testing/parsers/traceback-parser.js.map +1 -0
- package/dist/utils/testing/parsers/traceback-parser.test.d.ts +2 -0
- package/dist/utils/testing/parsers/traceback-parser.test.d.ts.map +1 -0
- package/dist/utils/testing/parsers/traceback-parser.test.js +45 -0
- package/dist/utils/testing/parsers/traceback-parser.test.js.map +1 -0
- package/dist/utils/testing/runner/combined-project-generator.d.ts +1 -1
- package/dist/utils/testing/runner/combined-project-generator.d.ts.map +1 -1
- package/dist/utils/testing/runner/test-runner.d.ts +9 -1
- package/dist/utils/testing/runner/test-runner.d.ts.map +1 -1
- package/dist/utils/testing/runner/test-runner.js +28 -3
- package/dist/utils/testing/runner/test-runner.js.map +1 -1
- package/dist/utils/testing/runner/test-runner.test.d.ts +2 -0
- package/dist/utils/testing/runner/test-runner.test.d.ts.map +1 -0
- package/dist/utils/testing/runner/test-runner.test.js +18 -0
- package/dist/utils/testing/runner/test-runner.test.js.map +1 -0
- package/dist/utils/testing/test-log-parser.d.ts +32 -1
- package/dist/utils/testing/test-log-parser.d.ts.map +1 -1
- package/dist/utils/testing/test-log-parser.js +53 -9
- package/dist/utils/testing/test-log-parser.js.map +1 -1
- package/dist/utils/testing/test-log-parser.test.d.ts +2 -0
- package/dist/utils/testing/test-log-parser.test.d.ts.map +1 -0
- package/dist/utils/testing/test-log-parser.test.js +56 -0
- package/dist/utils/testing/test-log-parser.test.js.map +1 -0
- package/dist/utils/watch/github-context.d.ts +50 -0
- package/dist/utils/watch/github-context.d.ts.map +1 -0
- package/dist/utils/watch/github-context.js +125 -0
- package/dist/utils/watch/github-context.js.map +1 -0
- package/dist/utils/watch/github-context.test.d.ts +2 -0
- package/dist/utils/watch/github-context.test.d.ts.map +1 -0
- package/dist/utils/watch/github-context.test.js +112 -0
- package/dist/utils/watch/github-context.test.js.map +1 -0
- package/dist/utils/watch/http-watch-registry.d.ts +40 -0
- package/dist/utils/watch/http-watch-registry.d.ts.map +1 -0
- package/dist/utils/watch/http-watch-registry.js +262 -0
- package/dist/utils/watch/http-watch-registry.js.map +1 -0
- package/dist/utils/watch/http-watch-registry.test.d.ts +2 -0
- package/dist/utils/watch/http-watch-registry.test.d.ts.map +1 -0
- package/dist/utils/watch/http-watch-registry.test.js +211 -0
- package/dist/utils/watch/http-watch-registry.test.js.map +1 -0
- package/dist/utils/watch/local-watch-loop.d.ts +50 -0
- package/dist/utils/watch/local-watch-loop.d.ts.map +1 -0
- package/dist/utils/watch/local-watch-loop.js +103 -0
- package/dist/utils/watch/local-watch-loop.js.map +1 -0
- package/dist/utils/watch/local-watch-loop.test.d.ts +2 -0
- package/dist/utils/watch/local-watch-loop.test.d.ts.map +1 -0
- package/dist/utils/watch/local-watch-loop.test.js +170 -0
- package/dist/utils/watch/local-watch-loop.test.js.map +1 -0
- package/dist/utils/watch/register-notify-watches.d.ts +41 -0
- package/dist/utils/watch/register-notify-watches.d.ts.map +1 -0
- package/dist/utils/watch/register-notify-watches.js +159 -0
- package/dist/utils/watch/register-notify-watches.js.map +1 -0
- package/dist/utils/watch/register-notify-watches.test.d.ts +2 -0
- package/dist/utils/watch/register-notify-watches.test.d.ts.map +1 -0
- package/dist/utils/watch/register-notify-watches.test.js +225 -0
- package/dist/utils/watch/register-notify-watches.test.js.map +1 -0
- package/dist/utils/watch/register-watches.d.ts +68 -0
- package/dist/utils/watch/register-watches.d.ts.map +1 -0
- package/dist/utils/watch/register-watches.js +221 -0
- package/dist/utils/watch/register-watches.js.map +1 -0
- package/dist/utils/watch/register-watches.test.d.ts +2 -0
- package/dist/utils/watch/register-watches.test.d.ts.map +1 -0
- package/dist/utils/watch/register-watches.test.js +576 -0
- package/dist/utils/watch/register-watches.test.js.map +1 -0
- package/dist/utils/watch/stream-watch-loop.d.ts +54 -0
- package/dist/utils/watch/stream-watch-loop.d.ts.map +1 -0
- package/dist/utils/watch/stream-watch-loop.js +282 -0
- package/dist/utils/watch/stream-watch-loop.js.map +1 -0
- package/dist/utils/watch/stream-watch-loop.test.d.ts +2 -0
- package/dist/utils/watch/stream-watch-loop.test.d.ts.map +1 -0
- package/dist/utils/watch/stream-watch-loop.test.js +392 -0
- package/dist/utils/watch/stream-watch-loop.test.js.map +1 -0
- package/dist/utils/watch/websocket-watch-stream.d.ts +25 -0
- package/dist/utils/watch/websocket-watch-stream.d.ts.map +1 -0
- package/dist/utils/watch/websocket-watch-stream.js +306 -0
- package/dist/utils/watch/websocket-watch-stream.js.map +1 -0
- package/dist/utils/watch/websocket-watch-stream.test.d.ts +2 -0
- package/dist/utils/watch/websocket-watch-stream.test.d.ts.map +1 -0
- package/dist/utils/watch/websocket-watch-stream.test.js +475 -0
- package/dist/utils/watch/websocket-watch-stream.test.js.map +1 -0
- package/package.json +7 -4
- package/src/args/global-args.ts +13 -0
- package/src/commands/batch-command/batch-deploy-command.ts +105 -1
- package/src/commands/batch-command/batch-test-command.ts +86 -60
- package/src/commands/deploy-command/deploy-init.ts +1 -1
- package/src/commands/deploy-command/index.ts +327 -32
- package/src/commands/deploy-command/select-target.ts +1 -1
- package/src/commands/deploy-command/version-command.ts +215 -21
- package/src/commands/test-command/test-command.ts +31 -22
- package/src/nevermore.ts +19 -0
- package/src/utils/batch/changed-packages-utils.ts +1 -1
- package/src/utils/build/base-place-resolver-factory.ts +49 -0
- package/src/utils/build/build.ts +13 -2
- package/src/utils/build/upload.ts +1 -1
- package/src/utils/deploy/deploy-metadata.ts +1 -1
- package/src/utils/job-context/base-job-context.ts +68 -6
- package/src/utils/job-context/batch-script-job-context.ts +18 -0
- package/src/utils/job-context/cloud-job-context.ts +7 -2
- package/src/utils/job-context/local-job-context.ts +7 -2
- package/src/utils/open-cloud/open-cloud-client.test.ts +133 -14
- package/src/utils/open-cloud/open-cloud-client.ts +131 -35
- package/src/utils/testing/parsers/batch-log-parser.test.ts +70 -5
- package/src/utils/testing/parsers/batch-log-parser.ts +141 -80
- package/src/utils/testing/parsers/traceback-parser.test.ts +64 -0
- package/src/utils/testing/parsers/traceback-parser.ts +122 -0
- package/src/utils/testing/runner/combined-project-generator.ts +1 -1
- package/src/utils/testing/runner/test-runner.test.ts +29 -0
- package/src/utils/testing/runner/test-runner.ts +36 -4
- package/src/utils/testing/test-log-parser.test.ts +70 -0
- package/src/utils/testing/test-log-parser.ts +80 -10
- package/src/utils/watch/github-context.test.ts +154 -0
- package/src/utils/watch/github-context.ts +184 -0
- package/src/utils/watch/http-watch-registry.test.ts +330 -0
- package/src/utils/watch/http-watch-registry.ts +341 -0
- package/src/utils/watch/local-watch-loop.test.ts +197 -0
- package/src/utils/watch/local-watch-loop.ts +190 -0
- package/src/utils/watch/register-notify-watches.test.ts +282 -0
- package/src/utils/watch/register-notify-watches.ts +226 -0
- package/src/utils/watch/register-watches.test.ts +696 -0
- package/src/utils/watch/register-watches.ts +369 -0
- package/src/utils/watch/stream-watch-loop.test.ts +625 -0
- package/src/utils/watch/stream-watch-loop.ts +411 -0
- package/src/utils/watch/websocket-watch-stream.test.ts +581 -0
- package/src/utils/watch/websocket-watch-stream.ts +403 -0
- package/tsconfig.json +19 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/build/deploy-config.d.ts +0 -71
- package/dist/utils/build/deploy-config.d.ts.map +0 -1
- package/dist/utils/build/deploy-config.js +0 -164
- package/dist/utils/build/deploy-config.js.map +0 -1
- package/dist/utils/build/deploy-config.test.d.ts +0 -2
- package/dist/utils/build/deploy-config.test.d.ts.map +0 -1
- package/dist/utils/build/deploy-config.test.js +0 -126
- package/dist/utils/build/deploy-config.test.js.map +0 -1
- package/src/utils/build/deploy-config.test.ts +0 -149
- package/src/utils/build/deploy-config.ts +0 -259
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface AttributedTraceback {
|
|
2
|
+
/** First line of the error, before the stack. */
|
|
3
|
+
message: string;
|
|
4
|
+
/** Roblox instance path of the topmost frame, e.g. "ServerScriptService.Foo.Bar". */
|
|
5
|
+
source?: string;
|
|
6
|
+
/** Root of that path, which names the package the frame belongs to. */
|
|
7
|
+
owner?: string;
|
|
8
|
+
/** Frames kept for display, topmost first. */
|
|
9
|
+
frames: string[];
|
|
10
|
+
/** How many times this same traceback appeared. */
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Pull tracebacks out of log output and attribute each to its owning package.
|
|
15
|
+
*
|
|
16
|
+
* Attribution reads the script path in the frames rather than the position of
|
|
17
|
+
* the traceback in the log. Position is unreliable: a deferred callback can
|
|
18
|
+
* fire during a later package's section, which is why batch mode previously
|
|
19
|
+
* gave up on tracebacks entirely.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseTracebacks(rawOutput: string): AttributedTraceback[];
|
|
22
|
+
/**
|
|
23
|
+
* Name the package a script path belongs to.
|
|
24
|
+
*
|
|
25
|
+
* Batch places hold each package under its own root, so the segment below the
|
|
26
|
+
* service is the package.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ownerOf(scriptPath: string): string | undefined;
|
|
29
|
+
/** Render tracebacks for a human, newest information first and bounded. */
|
|
30
|
+
export declare function formatTracebacks(tracebacks: AttributedTraceback[], maxShown?: number): string;
|
|
31
|
+
//# sourceMappingURL=traceback-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceback-parser.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/parsers/traceback-parser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AASD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAmDxE;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG9D;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,mBAAmB,EAAE,EACjC,QAAQ,SAAI,GACX,MAAM,CAuBR"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
2
|
+
const STACK_BEGIN = /^\s*Stack Begin\s*$/;
|
|
3
|
+
const STACK_END = /^\s*Stack End\s*$/;
|
|
4
|
+
// Script 'ServerScriptService.EggHunt2026.game.Server.Foo', Line 365 - function bar
|
|
5
|
+
const FRAME = /Script\s+'(?:\[string\s+")?([^'"\]]+)/;
|
|
6
|
+
const MAX_FRAMES = 4;
|
|
7
|
+
/**
|
|
8
|
+
* Pull tracebacks out of log output and attribute each to its owning package.
|
|
9
|
+
*
|
|
10
|
+
* Attribution reads the script path in the frames rather than the position of
|
|
11
|
+
* the traceback in the log. Position is unreliable: a deferred callback can
|
|
12
|
+
* fire during a later package's section, which is why batch mode previously
|
|
13
|
+
* gave up on tracebacks entirely.
|
|
14
|
+
*/
|
|
15
|
+
export function parseTracebacks(rawOutput) {
|
|
16
|
+
if (!rawOutput) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const lines = OutputHelper.stripAnsi(rawOutput).split('\n');
|
|
20
|
+
const bySignature = new Map();
|
|
21
|
+
for (let i = 0; i < lines.length; i++) {
|
|
22
|
+
if (!STACK_BEGIN.test(lines[i])) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
// The error text sits on the line above "Stack Begin".
|
|
26
|
+
const message = (lines[i - 1] ?? '').trim();
|
|
27
|
+
const frames = [];
|
|
28
|
+
let source;
|
|
29
|
+
for (let j = i + 1; j < lines.length && !STACK_END.test(lines[j]); j++) {
|
|
30
|
+
const frame = lines[j].trim();
|
|
31
|
+
if (!frame) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (frames.length < MAX_FRAMES) {
|
|
35
|
+
frames.push(frame);
|
|
36
|
+
}
|
|
37
|
+
if (!source) {
|
|
38
|
+
source = FRAME.exec(frame)?.[1];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// One bug fires per player and per frame, so the same traceback can appear
|
|
42
|
+
// hundreds of times. Collapse by signature and count instead of printing
|
|
43
|
+
// every copy.
|
|
44
|
+
const signature = `${message}::${frames[0] ?? ''}`;
|
|
45
|
+
const existing = bySignature.get(signature);
|
|
46
|
+
if (existing) {
|
|
47
|
+
existing.count++;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
bySignature.set(signature, {
|
|
51
|
+
message,
|
|
52
|
+
source,
|
|
53
|
+
owner: source ? ownerOf(source) : undefined,
|
|
54
|
+
frames,
|
|
55
|
+
count: 1,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return [...bySignature.values()];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Name the package a script path belongs to.
|
|
62
|
+
*
|
|
63
|
+
* Batch places hold each package under its own root, so the segment below the
|
|
64
|
+
* service is the package.
|
|
65
|
+
*/
|
|
66
|
+
export function ownerOf(scriptPath) {
|
|
67
|
+
const parts = scriptPath.split('.');
|
|
68
|
+
return parts.length >= 2 ? parts[1] : undefined;
|
|
69
|
+
}
|
|
70
|
+
/** Render tracebacks for a human, newest information first and bounded. */
|
|
71
|
+
export function formatTracebacks(tracebacks, maxShown = 5) {
|
|
72
|
+
if (tracebacks.length === 0) {
|
|
73
|
+
return '';
|
|
74
|
+
}
|
|
75
|
+
const lines = [];
|
|
76
|
+
const shown = tracebacks.slice(0, maxShown);
|
|
77
|
+
for (const traceback of shown) {
|
|
78
|
+
const where = traceback.source ? ` (${traceback.source})` : '';
|
|
79
|
+
const times = traceback.count > 1 ? ` ×${traceback.count}` : '';
|
|
80
|
+
lines.push(` ${traceback.message}${where}${times}`);
|
|
81
|
+
for (const frame of traceback.frames) {
|
|
82
|
+
lines.push(` ${frame}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const hidden = tracebacks.length - shown.length;
|
|
86
|
+
if (hidden > 0) {
|
|
87
|
+
lines.push(` ...and ${hidden} more distinct traceback(s)`);
|
|
88
|
+
}
|
|
89
|
+
return lines.join('\n');
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=traceback-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceback-parser.js","sourceRoot":"","sources":["../../../../src/utils/testing/parsers/traceback-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAe1D,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,SAAS,GAAG,mBAAmB,CAAC;AACtC,oFAAoF;AACpF,MAAM,KAAK,GAAG,uCAAuC,CAAC;AAEtD,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;IAE3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE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,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAChD,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,6BAA6B,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceback-parser.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/parsers/traceback-parser.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { formatTracebacks, ownerOf, parseTracebacks, } from './traceback-parser.js';
|
|
3
|
+
const TRACEBACK = [
|
|
4
|
+
'PlayerBadgeHelper: attempt to index nil with UserId',
|
|
5
|
+
'Stack Begin',
|
|
6
|
+
'Script \'[string "ServerScriptService.egghunt2026.game.Server.PlayerBadgeHelper"]\', Line 365 - function _awardBadge',
|
|
7
|
+
'Script \'[string "ServerScriptService.egghunt2026.game.Server.PlayerBadgeHelper"]\', Line 138',
|
|
8
|
+
'Stack End',
|
|
9
|
+
].join('\n');
|
|
10
|
+
describe('parseTracebacks', () => {
|
|
11
|
+
it('attributes a traceback to the package that owns the failing script', () => {
|
|
12
|
+
const [traceback] = parseTracebacks(TRACEBACK);
|
|
13
|
+
expect(traceback.owner).toBe('egghunt2026');
|
|
14
|
+
expect(traceback.source).toContain('PlayerBadgeHelper');
|
|
15
|
+
expect(traceback.message).toContain('attempt to index nil');
|
|
16
|
+
});
|
|
17
|
+
it('collapses repeats of the same crash into one entry with a count', () => {
|
|
18
|
+
// One bug fires per player per frame, so raw output can hold hundreds of
|
|
19
|
+
// identical copies. Printing them all is what makes logs unreadable.
|
|
20
|
+
const repeated = [TRACEBACK, TRACEBACK, TRACEBACK].join('\n');
|
|
21
|
+
const tracebacks = parseTracebacks(repeated);
|
|
22
|
+
expect(tracebacks).toHaveLength(1);
|
|
23
|
+
expect(tracebacks[0].count).toBe(3);
|
|
24
|
+
});
|
|
25
|
+
it('keeps distinct crashes apart', () => {
|
|
26
|
+
const other = TRACEBACK.replace('PlayerBadgeHelper', 'TrainHelper');
|
|
27
|
+
expect(parseTracebacks([TRACEBACK, other].join('\n'))).toHaveLength(2);
|
|
28
|
+
});
|
|
29
|
+
it('finds nothing in clean output', () => {
|
|
30
|
+
expect(parseTracebacks('Tests: 10 passed, 10 total')).toEqual([]);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('ownerOf', () => {
|
|
34
|
+
it('names the package below the service', () => {
|
|
35
|
+
expect(ownerOf('ServerScriptService.brio.Foo.Bar')).toBe('brio');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('formatTracebacks', () => {
|
|
39
|
+
it('bounds how many it prints and says how many it withheld', () => {
|
|
40
|
+
const many = Array.from({ length: 8 }, (_, i) => TRACEBACK.replace('PlayerBadgeHelper:', `Helper${i}:`)).join('\n');
|
|
41
|
+
const formatted = formatTracebacks(parseTracebacks(many), 5);
|
|
42
|
+
expect(formatted).toContain('and 3 more distinct traceback(s)');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=traceback-parser.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceback-parser.test.js","sourceRoot":"","sources":["../../../../src/utils/testing/parsers/traceback-parser.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,SAAS,GAAG;IAChB,qDAAqD;IACrD,aAAa;IACb,sHAAsH;IACtH,+FAA+F;IAC/F,WAAW;CACZ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,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AAO,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC9C,SAAS,CAAC,OAAO,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG,CAAC,CACvD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,SAAS,GAAG,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7D,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuildContext } from '@quenty/nevermore-template-helpers';
|
|
2
|
-
import { type DeployTarget } from '
|
|
2
|
+
import { type DeployTarget } from '@quenty/nevermore-deploy';
|
|
3
3
|
import { type BatchTarget } from '../../batch/changed-packages-utils.js';
|
|
4
4
|
export interface CombinedProjectResult {
|
|
5
5
|
/** Absolute path to the combined .rbxl file. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combined-project-generator.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/runner/combined-project-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEb,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"combined-project-generator.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/runner/combined-project-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEb,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEzE,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,mFAAmF;IACnF,aAAa,EAAE,YAAY,CAAC;IAC5B,sFAAsF;IACtF,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,sBAAsB,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACnD,cAAc,CAAC,IAAI,IAAI,CAAC;IACxB,cAAc,CAAC,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;CAC/C;AASD;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAyGjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeployTarget } from '
|
|
1
|
+
import { type DeployTarget } from '@quenty/nevermore-deploy';
|
|
2
2
|
import { type JobContext } from '../../job-context/job-context.js';
|
|
3
3
|
import { type ParsedTestCounts } from '../test-log-parser.js';
|
|
4
4
|
export interface SingleTestResult {
|
|
@@ -14,6 +14,14 @@ export interface SingleTestResult {
|
|
|
14
14
|
/** Why the run failed, when the runner can say more than "it failed". */
|
|
15
15
|
error?: string;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Combine failure reasons from the job context with those read from the logs.
|
|
19
|
+
*
|
|
20
|
+
* In batch mode the context has already evaluated these same logs, so the two
|
|
21
|
+
* sources overlap. Merging on the individual reason keeps the overlap from
|
|
22
|
+
* reading as double the failures.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mergeFailureReasons(contextError: string | undefined, logReasons: string[]): string[];
|
|
17
25
|
export interface SingleTestOptions {
|
|
18
26
|
packagePath: string;
|
|
19
27
|
packageName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"test-runner.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,uBAAuB,CAAC;AAS/B,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,MAAM,EAAE,GACnB,MAAM,EAAE,CAOV;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CA6E3B;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
|
@@ -4,6 +4,21 @@ import { randomUUID } from 'crypto';
|
|
|
4
4
|
import { parseTestLogs, parseTestCounts, } from '../test-log-parser.js';
|
|
5
5
|
import { buildDeployMetadataAttributes, gatherGitDeployInfo, injectDeployMetadataInPlaceAsync, packageUsesManifestAsync, } from '../../deploy/deploy-metadata.js';
|
|
6
6
|
import { readPackageVersionAsync } from '../../nevermore-cli-utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Combine failure reasons from the job context with those read from the logs.
|
|
9
|
+
*
|
|
10
|
+
* In batch mode the context has already evaluated these same logs, so the two
|
|
11
|
+
* sources overlap. Merging on the individual reason keeps the overlap from
|
|
12
|
+
* reading as double the failures.
|
|
13
|
+
*/
|
|
14
|
+
export function mergeFailureReasons(contextError, logReasons) {
|
|
15
|
+
return [
|
|
16
|
+
...new Set([
|
|
17
|
+
...(contextError ? contextError.split('; ') : []),
|
|
18
|
+
...logReasons,
|
|
19
|
+
]),
|
|
20
|
+
];
|
|
21
|
+
}
|
|
7
22
|
/**
|
|
8
23
|
* Build, deploy, and run a test for a single package using the provided
|
|
9
24
|
* JobContext. The context determines the execution environment (cloud or local).
|
|
@@ -11,7 +26,11 @@ import { readPackageVersionAsync } from '../../nevermore-cli-utils.js';
|
|
|
11
26
|
* Creates and releases its own deployment handle — the caller owns the context lifetime.
|
|
12
27
|
*/
|
|
13
28
|
export async function runSingleTestAsync(context, options) {
|
|
14
|
-
const { packagePath, packageName,
|
|
29
|
+
const { packagePath, packageName,
|
|
30
|
+
// 300s is the Open Cloud maximum. The old 120s default failed real suites
|
|
31
|
+
// with no jest summary at all, so "--timeout 300" had become folklore
|
|
32
|
+
// everyone had to know before their first useful run.
|
|
33
|
+
timeoutMs = 300_000, scriptText, target, } = options;
|
|
15
34
|
const sessionId = randomUUID();
|
|
16
35
|
const builtPlace = await context.buildPlaceAsync({
|
|
17
36
|
target,
|
|
@@ -46,13 +65,19 @@ export async function runSingleTestAsync(context, options) {
|
|
|
46
65
|
timeoutMs,
|
|
47
66
|
});
|
|
48
67
|
const rawLogs = await context.getLogsAsync(deployment);
|
|
49
|
-
|
|
68
|
+
// A probe script is arbitrary Luau with no jest in it, so demanding a test
|
|
69
|
+
// report would fail every --script-text run. Everything else must prove a
|
|
70
|
+
// runner spoke before it can pass.
|
|
71
|
+
const parsed = parseTestLogs(rawLogs, {
|
|
72
|
+
requireTestReport: scriptText === undefined,
|
|
73
|
+
});
|
|
74
|
+
const reasons = mergeFailureReasons(result.errorMessage, parsed.failureReasons);
|
|
50
75
|
return {
|
|
51
76
|
success: result.success && parsed.success,
|
|
52
77
|
logs: parsed.logs,
|
|
53
78
|
testCounts: parseTestCounts(parsed.logs),
|
|
54
79
|
durationMs: result.durationMs,
|
|
55
|
-
error:
|
|
80
|
+
error: reasons.length > 0 ? reasons.join('; ') : undefined,
|
|
56
81
|
};
|
|
57
82
|
}
|
|
58
83
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner.js","sourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,OAAO,EAEL,aAAa,EACb,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"test-runner.js","sourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,OAAO,EAEL,aAAa,EACb,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAgBvE;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,YAAgC,EAChC,UAAoB;IAEpB,OAAO;QACL,GAAG,IAAI,GAAG,CAAC;YACT,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjD,GAAG,UAAU;SACd,CAAC;KACH,CAAC;AACJ,CAAC;AAeD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAmB,EACnB,OAA0B;IAE1B,M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ourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { mergeFailureReasons } from './test-runner.js';
|
|
3
|
+
describe('mergeFailureReasons', () => {
|
|
4
|
+
it('does not repeat reasons the context already reported', () => {
|
|
5
|
+
// Batch mode evaluates the same logs upstream, so both sources describe the
|
|
6
|
+
// same failures. Concatenating them read as double the failures.
|
|
7
|
+
const merged = mergeFailureReasons('3 test suite(s) failed; 19 test(s) failed', ['3 test suite(s) failed', '19 test(s) failed']);
|
|
8
|
+
expect(merged).toEqual(['3 test suite(s) failed', '19 test(s) failed']);
|
|
9
|
+
});
|
|
10
|
+
it('keeps reasons only one side knows about', () => {
|
|
11
|
+
const merged = mergeFailureReasons('the batch runner reported a Luau error', ['19 test(s) failed']);
|
|
12
|
+
expect(merged).toHaveLength(2);
|
|
13
|
+
});
|
|
14
|
+
it('is empty when nothing failed', () => {
|
|
15
|
+
expect(mergeFailureReasons(undefined, [])).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=test-runner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner.test.js","sourceRoot":"","sources":["../../../../src/utils/testing/runner/test-runner.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,4EAA4E;QAC5E,iEAAiE;QACjE,MAAM,MAAM,GAAG,mBAAmB,CAChC,2CAA2C,EAC3C,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAChD,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,MAAM,GAAG,mBAAmB,CAChC,wCAAwC,EACxC,CAAC,mBAAmB,CAAC,CACtB,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -7,12 +7,43 @@ export interface ParsedTestLogs {
|
|
|
7
7
|
success: boolean;
|
|
8
8
|
logs: string;
|
|
9
9
|
testCounts?: ParsedTestCounts;
|
|
10
|
+
/** Why the run is not a pass. Empty when it is. */
|
|
11
|
+
failureReasons: string[];
|
|
10
12
|
}
|
|
13
|
+
export interface TestOutcomeOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Require proof the runner ran. Off for probe scripts (--script-text), which
|
|
16
|
+
* legitimately produce no jest report.
|
|
17
|
+
*/
|
|
18
|
+
requireTestReport?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Decide whether test output represents a pass, and say why when it does not.
|
|
22
|
+
*
|
|
23
|
+
* The single definition of the rule. Both the single-package path and the batch
|
|
24
|
+
* path route through here — they previously carried divergent copies that
|
|
25
|
+
* disagreed about tracebacks, so the same commit could pass one and fail the
|
|
26
|
+
* other.
|
|
27
|
+
*/
|
|
28
|
+
export declare function evaluateTestOutcome(rawOutput: string, options?: TestOutcomeOptions): {
|
|
29
|
+
success: boolean;
|
|
30
|
+
failureReasons: string[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* True when jest reported at all, including reporting that it found nothing.
|
|
34
|
+
*
|
|
35
|
+
* "Ran and found no tests" is a legitimate answer for packages that ship
|
|
36
|
+
* without specs; "we never heard from jest" is not. Keying on the report
|
|
37
|
+
* rather than on a test count keeps `passWithNoTests` working.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hasTestReport(rawOutput: string): boolean;
|
|
40
|
+
/** Count Luau tracebacks in output. */
|
|
41
|
+
export declare function countTracebacks(rawOutput: string): number;
|
|
11
42
|
/**
|
|
12
43
|
* Analyze test output for Jest failures and Luau runtime errors.
|
|
13
44
|
* Shared by both Open Cloud log fetching and local run-in-roblox output.
|
|
14
45
|
*/
|
|
15
|
-
export declare function parseTestLogs(rawOutput: string): ParsedTestLogs;
|
|
46
|
+
export declare function parseTestLogs(rawOutput: string, options?: TestOutcomeOptions): ParsedTestLogs;
|
|
16
47
|
/**
|
|
17
48
|
* Parse Jest "Tests: N failed, N passed, N total" line into structured counts.
|
|
18
49
|
* Returns undefined if no test summary line is found.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-log-parser.d.ts","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-log-parser.d.ts","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,mDAAmD;IACnD,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,kBAAuB,GAC/B;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CA6BhD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAOxD;AAED,uCAAuC;AACvC,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,kBAAuB,GAC/B,cAAc,CAShB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAChB,gBAAgB,GAAG,SAAS,CAmB9B"}
|
|
@@ -1,19 +1,63 @@
|
|
|
1
1
|
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Decide whether test output represents a pass, and say why when it does not.
|
|
4
|
+
*
|
|
5
|
+
* The single definition of the rule. Both the single-package path and the batch
|
|
6
|
+
* path route through here — they previously carried divergent copies that
|
|
7
|
+
* disagreed about tracebacks, so the same commit could pass one and fail the
|
|
8
|
+
* other.
|
|
5
9
|
*/
|
|
6
|
-
export function
|
|
10
|
+
export function evaluateTestOutcome(rawOutput, options = {}) {
|
|
7
11
|
const cleanLogs = OutputHelper.stripAnsi(rawOutput);
|
|
8
|
-
|
|
12
|
+
const failureReasons = [];
|
|
9
13
|
const failedSuites = cleanLogs.match(/Test Suites:\s*(\d+)\s+failed/);
|
|
10
14
|
const failedTests = cleanLogs.match(/Tests:\s*(\d+)\s+failed/);
|
|
11
|
-
|
|
12
|
-
(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
if (failedSuites && parseInt(failedSuites[1], 10) > 0) {
|
|
16
|
+
failureReasons.push(`${failedSuites[1]} test suite(s) failed`);
|
|
17
|
+
}
|
|
18
|
+
if (failedTests && parseInt(failedTests[1], 10) > 0) {
|
|
19
|
+
failureReasons.push(`${failedTests[1]} test(s) failed`);
|
|
20
|
+
}
|
|
21
|
+
// Tracebacks always fail. They catch use-after-free bugs that jest cannot
|
|
22
|
+
// see, since a deferred-callback crash fires outside any test.
|
|
23
|
+
const tracebacks = countTracebacks(cleanLogs);
|
|
24
|
+
if (tracebacks > 0) {
|
|
25
|
+
failureReasons.push(`${tracebacks} Luau traceback(s) — see attributed errors below`);
|
|
26
|
+
}
|
|
27
|
+
if (options.requireTestReport && !hasTestReport(cleanLogs)) {
|
|
28
|
+
failureReasons.push('no jest report in output — nothing proves any test ran');
|
|
29
|
+
}
|
|
30
|
+
return { success: failureReasons.length === 0, failureReasons };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* True when jest reported at all, including reporting that it found nothing.
|
|
34
|
+
*
|
|
35
|
+
* "Ran and found no tests" is a legitimate answer for packages that ship
|
|
36
|
+
* without specs; "we never heard from jest" is not. Keying on the report
|
|
37
|
+
* rather than on a test count keeps `passWithNoTests` working.
|
|
38
|
+
*/
|
|
39
|
+
export function hasTestReport(rawOutput) {
|
|
40
|
+
const clean = OutputHelper.stripAnsi(rawOutput);
|
|
41
|
+
return (/Tests:\s+/.test(clean) ||
|
|
42
|
+
/Test Suites:\s+/.test(clean) ||
|
|
43
|
+
/No tests found/i.test(clean));
|
|
44
|
+
}
|
|
45
|
+
/** Count Luau tracebacks in output. */
|
|
46
|
+
export function countTracebacks(rawOutput) {
|
|
47
|
+
if (!rawOutput) {
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
return OutputHelper.stripAnsi(rawOutput).match(/Stack Begin\s/g)?.length ?? 0;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Analyze test output for Jest failures and Luau runtime errors.
|
|
54
|
+
* Shared by both Open Cloud log fetching and local run-in-roblox output.
|
|
55
|
+
*/
|
|
56
|
+
export function parseTestLogs(rawOutput, options = {}) {
|
|
57
|
+
const outcome = evaluateTestOutcome(rawOutput, options);
|
|
15
58
|
return {
|
|
16
|
-
success:
|
|
59
|
+
success: outcome.success,
|
|
60
|
+
failureReasons: outcome.failureReasons,
|
|
17
61
|
logs: rawOutput,
|
|
18
62
|
testCounts: parseTestCounts(rawOutput),
|
|
19
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-log-parser.js","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"test-log-parser.js","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAwB1D;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAiB,EACjB,UAA8B,EAAE;IAEhC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/D,IAAI,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACtD,cAA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AC,CAAC,CAAC;IAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-log-parser.test.d.ts","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { evaluateTestOutcome, hasTestReport } from './test-log-parser.js';
|
|
3
|
+
describe('evaluateTestOutcome', () => {
|
|
4
|
+
it('passes a clean jest report', () => {
|
|
5
|
+
const outcome = evaluateTestOutcome('Tests: 275 passed, 275 total', {
|
|
6
|
+
requireTestReport: true,
|
|
7
|
+
});
|
|
8
|
+
expect(outcome.success).toBe(true);
|
|
9
|
+
expect(outcome.failureReasons).toEqual([]);
|
|
10
|
+
});
|
|
11
|
+
it('refuses to pass output with no jest report in it', () => {
|
|
12
|
+
// Absence of failure was previously read as success, so an empty log passed.
|
|
13
|
+
const outcome = evaluateTestOutcome('some unrelated chatter', {
|
|
14
|
+
requireTestReport: true,
|
|
15
|
+
});
|
|
16
|
+
expect(outcome.success).toBe(false);
|
|
17
|
+
expect(outcome.failureReasons.join()).toContain('no jest report');
|
|
18
|
+
});
|
|
19
|
+
it('exempts probe runs, which have no jest in them at all', () => {
|
|
20
|
+
const outcome = evaluateTestOutcome('hello from a probe script');
|
|
21
|
+
expect(outcome.success).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it('fails on a traceback even when every test passed', () => {
|
|
24
|
+
// Jest cannot see a deferred-callback crash: it fires outside any test.
|
|
25
|
+
const logs = [
|
|
26
|
+
'Tests: 155 passed, 155 total',
|
|
27
|
+
'attempt to index nil',
|
|
28
|
+
'Stack Begin',
|
|
29
|
+
"Script 'ServerScriptService.egghunt2026.Foo', Line 12",
|
|
30
|
+
'Stack End',
|
|
31
|
+
].join('\n');
|
|
32
|
+
const outcome = evaluateTestOutcome(logs, { requireTestReport: true });
|
|
33
|
+
expect(outcome.success).toBe(false);
|
|
34
|
+
expect(outcome.failureReasons.join()).toContain('traceback');
|
|
35
|
+
});
|
|
36
|
+
it('reports every reason a run failed, not just the first', () => {
|
|
37
|
+
const logs = [
|
|
38
|
+
'Tests: 19 failed, 470 passed, 516 total',
|
|
39
|
+
'Stack Begin',
|
|
40
|
+
"Script 'ServerScriptService.egghunt2026.Foo', Line 12",
|
|
41
|
+
'Stack End',
|
|
42
|
+
].join('\n');
|
|
43
|
+
const outcome = evaluateTestOutcome(logs, { requireTestReport: true });
|
|
44
|
+
expect(outcome.failureReasons).toHaveLength(2);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('hasTestReport', () => {
|
|
48
|
+
it('accepts a runner that ran and found nothing', () => {
|
|
49
|
+
// Packages without specs are legitimate; passWithNoTests depends on this.
|
|
50
|
+
expect(hasTestReport('No tests found, exiting with code 0')).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
it('rejects silence', () => {
|
|
53
|
+
expect(hasTestReport('')).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=test-log-parser.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-log-parser.test.js","sourceRoot":"","sources":["../../../src/utils/testing/test-log-parser.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1E,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC,8BAA8B,EAAE;YAClE,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,OAAO,CAA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GAAG,EAAE;QAC/D,MAAM,IAAI,GAAG;YACX,yCAAyC;YACzC,aAAa;YACb,uDAAuD;YACvD,WAAW;SACZ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;QAEvE,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,0EAA0E;QAC1E,MAAM,CAAC,aAAa,CAAC,qCAAqC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Everything the watch service needs to dispatch a workflow back at us. */
|
|
2
|
+
export interface GithubDispatchContext {
|
|
3
|
+
/** `owner/repo`. */
|
|
4
|
+
repository: string;
|
|
5
|
+
/** Git ref the dispatched workflow should run on. */
|
|
6
|
+
ref: string;
|
|
7
|
+
/** Token the service dispatches with; absent when none was provided. */
|
|
8
|
+
token?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GithubContextOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Read the token from the GitHub CLI when no environment variable supplies
|
|
13
|
+
* one.
|
|
14
|
+
*
|
|
15
|
+
* Off unless asked for, and that is the whole point. Registering sends a PAT
|
|
16
|
+
* to the watch service and creates a monitor against the repository, so the
|
|
17
|
+
* credential has to be one the user handed over — an env var is handing it
|
|
18
|
+
* over, reading whatever `gh` happens to be holding is not. Nearly every
|
|
19
|
+
* developer machine has a logged-in `gh`, so defaulting this on would turn a
|
|
20
|
+
* command that used to watch locally into one that quietly ships a token.
|
|
21
|
+
*/
|
|
22
|
+
useGhAuth?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type GithubContextResult = {
|
|
25
|
+
success: true;
|
|
26
|
+
context: GithubDispatchContext;
|
|
27
|
+
} | {
|
|
28
|
+
success: false;
|
|
29
|
+
reason: 'no_repository' | 'no_ref' | 'undispatchable_ref';
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Work out which repo and ref a watch should dispatch.
|
|
33
|
+
*
|
|
34
|
+
* Prefers the Actions environment, which is authoritative when we are already
|
|
35
|
+
* running inside the workflow being registered, and falls back to the git
|
|
36
|
+
* remote so `--watch <url>` also works from a developer's machine. Best-effort:
|
|
37
|
+
* outside a git repo with no Actions env there is simply nothing to dispatch.
|
|
38
|
+
*/
|
|
39
|
+
export declare function tryResolveGithubDispatchContext(options?: GithubContextOptions): GithubContextResult;
|
|
40
|
+
/** Human-facing explanation for a failed context resolution. */
|
|
41
|
+
export declare function describeGithubContextFailure(reason: 'no_repository' | 'no_ref' | 'undispatchable_ref'): string;
|
|
42
|
+
/** Hint printed when a cloud registration has no credential to hand over. */
|
|
43
|
+
export declare function describeMissingWatchToken(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Pull `owner/repo` out of a git remote URL. Handles the HTTPS, SCP-style, and
|
|
46
|
+
* ssh:// spellings git hands out, and ignores non-GitHub hosts — a watch
|
|
47
|
+
* registration names a GitHub workflow, so anything else is not dispatchable.
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseGithubRepository(remoteUrl: string): string | undefined;
|
|
50
|
+
//# sourceMappingURL=github-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-context.d.ts","sourceRoot":"","sources":["../../../src/utils/watch/github-context.ts"],"names":[],"mappings":"AAUA,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAA;CAAE,GACjD;IACE,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,eAAe,GAAG,QAAQ,GAAG,oBAAoB,CAAC;CAC3D,CAAC;AAqBN;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAsBrB;AAED,gEAAgE;AAChE,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,eAAe,GAAG,QAAQ,GAAG,oBAAoB,GACxD,MAAM,CAoBR;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,IAAI,MAAM,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU3E"}
|