@quenty/nevermore-cli 4.41.0 → 4.42.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 +12 -0
- package/dist/commands/batch-command/batch-test-command.d.ts.map +1 -1
- package/dist/commands/batch-command/batch-test-command.js +20 -2
- package/dist/commands/batch-command/batch-test-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 +6 -4
- package/dist/commands/test-command/test-command.js.map +1 -1
- package/dist/utils/job-context/batch-script-job-context.d.ts.map +1 -1
- package/dist/utils/job-context/batch-script-job-context.js +5 -1
- package/dist/utils/job-context/batch-script-job-context.js.map +1 -1
- package/dist/utils/open-cloud/open-cloud-client.d.ts.map +1 -1
- package/dist/utils/open-cloud/open-cloud-client.js +23 -2
- package/dist/utils/open-cloud/open-cloud-client.js.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.d.ts +24 -0
- package/dist/utils/testing/parsers/batch-log-parser.d.ts.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.js +159 -40
- package/dist/utils/testing/parsers/batch-log-parser.js.map +1 -1
- package/dist/utils/testing/parsers/batch-log-parser.test.d.ts +2 -0
- package/dist/utils/testing/parsers/batch-log-parser.test.d.ts.map +1 -0
- package/dist/utils/testing/parsers/batch-log-parser.test.js +117 -0
- package/dist/utils/testing/parsers/batch-log-parser.test.js.map +1 -0
- 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/reporting/test-github-columns.d.ts.map +1 -1
- package/dist/utils/testing/reporting/test-github-columns.js +1 -0
- package/dist/utils/testing/reporting/test-github-columns.js.map +1 -1
- package/dist/utils/testing/runner/test-runner.d.ts +10 -0
- package/dist/utils/testing/runner/test-runner.d.ts.map +1 -1
- package/dist/utils/testing/runner/test-runner.js +28 -2
- 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/package.json +6 -6
- package/src/commands/batch-command/batch-test-command.ts +80 -58
- package/src/commands/test-command/test-command.ts +7 -4
- package/src/utils/job-context/batch-script-job-context.ts +5 -1
- package/src/utils/open-cloud/open-cloud-client.ts +28 -2
- package/src/utils/testing/parsers/batch-log-parser.test.ts +150 -0
- package/src/utils/testing/parsers/batch-log-parser.ts +201 -49
- 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/reporting/test-github-columns.ts +1 -0
- package/src/utils/testing/runner/test-runner.test.ts +29 -0
- package/src/utils/testing/runner/test-runner.ts +37 -2
- package/src/utils/testing/test-log-parser.test.ts +70 -0
- package/src/utils/testing/test-log-parser.ts +80 -10
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -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,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAE/C,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACxD,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC9D,CAAC,CAAC,CA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K,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-github-columns.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/reporting/test-github-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAG9B,MAAM,sCAAsC,CAAC;AAG9C,yEAAyE;AACzE,wBAAgB,iBAAiB,IAAI,mBAAmB,EAAE,CAEzD;AAED,kEAAkE;AAClE,wBAAgB,uBAAuB,IAAI,wBAAwB,
|
|
1
|
+
{"version":3,"file":"test-github-columns.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing/reporting/test-github-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAG9B,MAAM,sCAAsC,CAAC;AAG9C,yEAAyE;AACzE,wBAAgB,iBAAiB,IAAI,mBAAmB,EAAE,CAEzD;AAED,kEAAkE;AAClE,wBAAgB,uBAAuB,IAAI,wBAAwB,CASlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-github-columns.js","sourceRoot":"","sources":["../../../../src/utils/testing/reporting/test-github-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,GACf,MAAM,sCAAsC,CAAC;AAG9C,yEAAyE;AACzE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,iBAAiB,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,iCAAiC;QAChD,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,iBAAiB,EAAE;QACjC,YAAY,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"test-github-columns.js","sourceRoot":"","sources":["../../../../src/utils/testing/reporting/test-github-columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,GACf,MAAM,sCAAsC,CAAC;AAG9C,yEAAyE;AACzE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,iBAAiB,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,iCAAiC;QAChD,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,iBAAiB,EAAE;QACjC,YAAY,EAAE,cAAc;QAC5B,iBAAiB,EAAE,IAAI;KACxB,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;QACL,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,MAAM;QAClB,MAAM,CAAC,GAAiB;YACtB,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACtC,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBACrB,OAAO,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,aAAa,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,MAAM,CAAC,GAAiB;YACtB,MAAM,OAAO,GAAI,GAAG,CAAC,MAAsC,EAAE,OAAO,IAAI,CAAC,CAAC;YAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,OAAO,GAAG,gCAAgC,OAAO,EAAE,CAAC;YAC1D,MAAM,OAAO,GAAG,8CAA8C,OAAO,EAAE,CAAC;YACxE,OAAO,UAAU,OAAO,gBAAgB,OAAO,GAAG,CAAC;QACrD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -11,7 +11,17 @@ export interface SingleTestResult {
|
|
|
11
11
|
* non-aggregated cloud/local runs — callers should fall back to wall-clock.
|
|
12
12
|
*/
|
|
13
13
|
durationMs?: number;
|
|
14
|
+
/** Why the run failed, when the runner can say more than "it failed". */
|
|
15
|
+
error?: string;
|
|
14
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[];
|
|
15
25
|
export interface SingleTestOptions {
|
|
16
26
|
packagePath: string;
|
|
17
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,8BAA8B,CAAC;AACjE,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;
|
|
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,8BAA8B,CAAC;AACjE,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,12 +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,
|
|
80
|
+
error: reasons.length > 0 ? reasons.join('; ') : undefined,
|
|
55
81
|
};
|
|
56
82
|
}
|
|
57
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;A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C,CAAC;IACzC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,UAA8B;IAE9B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,mDAAmD,WAAW,2EAA2E,CAC1I,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner.test.d.ts","sourceRoot":"","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;
|
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G,KAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC5D,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAC;IAElC,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,6EAA6E;QAC7E,MAAM,OAAO,GAAG,mBAAmB,CAAC,wBAAwB,EAAE;YAC5D,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,OAAO,GAAG,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;QAEjE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,I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C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/nevermore-cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.42.0",
|
|
4
4
|
"description": "CLI interface for Nevermore",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/cli-output-helpers": "1.17.
|
|
29
|
-
"@quenty/nevermore-cli-helpers": "1.16.
|
|
30
|
-
"@quenty/nevermore-template-helpers": "1.18.
|
|
31
|
-
"@quenty/studio-bridge": "0.17.
|
|
28
|
+
"@quenty/cli-output-helpers": "1.17.1",
|
|
29
|
+
"@quenty/nevermore-cli-helpers": "1.16.1",
|
|
30
|
+
"@quenty/nevermore-template-helpers": "1.18.1",
|
|
31
|
+
"@quenty/studio-bridge": "0.17.1",
|
|
32
32
|
"execa": "^9.6.1",
|
|
33
33
|
"find-git-root": "^1.0.4",
|
|
34
34
|
"inquirer": "^13.2.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=16"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "481392a58dedd5ee476d66c90c14e2f429e23df8"
|
|
61
61
|
}
|
|
@@ -60,64 +60,84 @@ export const batchTestCommand: CommandModule<
|
|
|
60
60
|
command: 'test',
|
|
61
61
|
describe: 'Run tests for changed packages with test targets',
|
|
62
62
|
builder: (yargs) => {
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
63
|
+
return (
|
|
64
|
+
yargs
|
|
65
|
+
.option('cloud', {
|
|
66
|
+
describe: 'Run tests via Open Cloud instead of locally',
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
default: false,
|
|
69
|
+
})
|
|
70
|
+
.option('api-key', {
|
|
71
|
+
describe: 'Roblox Open Cloud API key (--cloud only)',
|
|
72
|
+
type: 'string',
|
|
73
|
+
})
|
|
74
|
+
.option('all', {
|
|
75
|
+
describe: 'Test all packages with test targets, not just changed',
|
|
76
|
+
type: 'boolean',
|
|
77
|
+
default: false,
|
|
78
|
+
})
|
|
79
|
+
.option('base', {
|
|
80
|
+
describe: 'Git ref to diff against for change detection',
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: 'origin/main',
|
|
83
|
+
})
|
|
84
|
+
.option('concurrency', {
|
|
85
|
+
describe: 'Max parallel tests (0 = unlimited, default: unlimited)',
|
|
86
|
+
type: 'number',
|
|
87
|
+
})
|
|
88
|
+
.option('output', {
|
|
89
|
+
describe: 'Write JSON results to this file',
|
|
90
|
+
type: 'string',
|
|
91
|
+
})
|
|
92
|
+
.option('limit', {
|
|
93
|
+
describe: 'Max number of packages to test (for local debugging)',
|
|
94
|
+
type: 'number',
|
|
95
|
+
})
|
|
96
|
+
.option('logs', {
|
|
97
|
+
describe: 'Show execution logs for all packages (not just failures)',
|
|
98
|
+
type: 'boolean',
|
|
99
|
+
default: false,
|
|
100
|
+
})
|
|
101
|
+
.option('aggregated', {
|
|
102
|
+
describe:
|
|
103
|
+
'Build all packages into a single place and execute one batch script',
|
|
104
|
+
type: 'boolean',
|
|
105
|
+
default: true,
|
|
106
|
+
})
|
|
107
|
+
.option('batch-place-id', {
|
|
108
|
+
describe:
|
|
109
|
+
'Override placeId for the aggregated batch upload (--aggregated only)',
|
|
110
|
+
type: 'number',
|
|
111
|
+
})
|
|
112
|
+
.option('batch-universe-id', {
|
|
113
|
+
describe:
|
|
114
|
+
'Override universeId for the aggregated batch upload (--aggregated only)',
|
|
115
|
+
type: 'number',
|
|
116
|
+
})
|
|
117
|
+
.option('timeout', {
|
|
118
|
+
describe:
|
|
119
|
+
'Max script execution time in seconds for the whole batch. Sent to the Open Cloud API so Roblox cancels server-side on overrun. Max 300s (API limit). (default: 300)',
|
|
120
|
+
type: 'number',
|
|
121
|
+
})
|
|
122
|
+
// Accepted only to fail with a useful message. A batch runs one shared
|
|
123
|
+
// script across packages, so there is nothing for arbitrary Luau to mean
|
|
124
|
+
// here — but yargs strict mode would otherwise reject it with a bare
|
|
125
|
+
// "Unknown argument" that does not say where to go instead.
|
|
126
|
+
.option('script-text', {
|
|
127
|
+
hidden: true,
|
|
128
|
+
type: 'string',
|
|
129
|
+
})
|
|
130
|
+
.check((args) => {
|
|
131
|
+
if (args.scriptText !== undefined) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
'--script-text is not supported by "batch test", which runs one shared script for all packages.\n' +
|
|
134
|
+
'Run it against a single package instead:\n' +
|
|
135
|
+
' cd <package> && nevermore test --cloud --script-text \'print("hi")\''
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
})
|
|
140
|
+
);
|
|
121
141
|
},
|
|
122
142
|
handler: async (args) => {
|
|
123
143
|
try {
|
|
@@ -171,6 +191,7 @@ async function _runAsync(args: BatchTestArgs): Promise<void> {
|
|
|
171
191
|
showLogs: args.logs ?? false,
|
|
172
192
|
verbose: args.verbose,
|
|
173
193
|
actionVerb: 'Testing',
|
|
194
|
+
expectsTestCounts: true,
|
|
174
195
|
})
|
|
175
196
|
: new SpinnerReporter(state, {
|
|
176
197
|
showLogs: args.logs ?? false,
|
|
@@ -251,6 +272,7 @@ async function _runAsync(args: BatchTestArgs): Promise<void> {
|
|
|
251
272
|
progressSummary: result.testCounts
|
|
252
273
|
? { kind: 'test-counts' as const, ...result.testCounts }
|
|
253
274
|
: undefined,
|
|
275
|
+
error: result.error,
|
|
254
276
|
};
|
|
255
277
|
},
|
|
256
278
|
});
|