@alwaysmeticulous/cli 2.303.1 → 2.305.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/dist/command-utils/common-options.d.ts +5 -0
- package/dist/command-utils/common-options.d.ts.map +1 -1
- package/dist/command-utils/common-options.js +7 -2
- package/dist/command-utils/common-options.js.map +1 -1
- package/dist/command-utils/json-args.d.ts +14 -0
- package/dist/command-utils/json-args.d.ts.map +1 -0
- package/dist/command-utils/json-args.js +40 -0
- package/dist/command-utils/json-args.js.map +1 -0
- package/dist/command-utils/json-args.spec.d.ts +2 -0
- package/dist/command-utils/json-args.spec.d.ts.map +1 -0
- package/dist/command-utils/json-args.spec.js +37 -0
- package/dist/command-utils/json-args.spec.js.map +1 -0
- package/dist/command-utils/print-json.d.ts +7 -0
- package/dist/command-utils/print-json.d.ts.map +1 -0
- package/dist/command-utils/print-json.js +16 -0
- package/dist/command-utils/print-json.js.map +1 -0
- package/dist/commands/agent/build-git-options.d.ts +25 -20
- package/dist/commands/agent/build-git-options.d.ts.map +1 -1
- package/dist/commands/agent/build-git-options.js +62 -54
- package/dist/commands/agent/build-git-options.js.map +1 -1
- package/dist/commands/agent/build-git-options.spec.js +96 -62
- package/dist/commands/agent/build-git-options.spec.js.map +1 -1
- package/dist/commands/agent/index.d.ts.map +1 -1
- package/dist/commands/agent/index.js +11 -4
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/js-coverage-diff.command.d.ts +1 -1
- package/dist/commands/agent/js-coverage-diff.command.d.ts.map +1 -1
- package/dist/commands/agent/js-coverage-diff.command.js +31 -38
- package/dist/commands/agent/js-coverage-diff.command.js.map +1 -1
- package/dist/commands/agent/js-coverage.command.d.ts +7 -4
- package/dist/commands/agent/js-coverage.command.d.ts.map +1 -1
- package/dist/commands/agent/js-coverage.command.js +104 -66
- package/dist/commands/agent/js-coverage.command.js.map +1 -1
- package/dist/commands/agent/js-coverage.command.spec.js +48 -2
- package/dist/commands/agent/js-coverage.command.spec.js.map +1 -1
- package/dist/commands/agent/screenshot-dom-diff.command.d.ts +1 -0
- package/dist/commands/agent/screenshot-dom-diff.command.d.ts.map +1 -1
- package/dist/commands/agent/screenshot-dom-diff.command.js +26 -18
- package/dist/commands/agent/screenshot-dom-diff.command.js.map +1 -1
- package/dist/commands/agent/screenshot-image-files.command.d.ts +1 -0
- package/dist/commands/agent/screenshot-image-files.command.d.ts.map +1 -1
- package/dist/commands/agent/screenshot-image-files.command.js +18 -5
- package/dist/commands/agent/screenshot-image-files.command.js.map +1 -1
- package/dist/commands/agent/screenshot-image.command.d.ts +1 -0
- package/dist/commands/agent/screenshot-image.command.d.ts.map +1 -1
- package/dist/commands/agent/screenshot-image.command.js +9 -4
- package/dist/commands/agent/screenshot-image.command.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.command.d.ts +1 -0
- package/dist/commands/agent/test-run-diffs.command.d.ts.map +1 -1
- package/dist/commands/agent/test-run-diffs.command.js +40 -24
- package/dist/commands/agent/test-run-diffs.command.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.utils.d.ts +7 -0
- package/dist/commands/agent/test-run-diffs.utils.d.ts.map +1 -1
- package/dist/commands/agent/test-run-diffs.utils.js +48 -3
- package/dist/commands/agent/test-run-diffs.utils.js.map +1 -1
- package/dist/commands/agent/test-run-diffs.utils.spec.js +145 -2
- package/dist/commands/agent/test-run-diffs.utils.spec.js.map +1 -1
- package/dist/commands/agent/test-run-for-commit.command.d.ts.map +1 -1
- package/dist/commands/agent/test-run-for-commit.command.js +12 -14
- package/dist/commands/agent/test-run-for-commit.command.js.map +1 -1
- package/dist/commands/agent/timeline.command.d.ts +1 -0
- package/dist/commands/agent/timeline.command.d.ts.map +1 -1
- package/dist/commands/agent/timeline.command.js +21 -7
- package/dist/commands/agent/timeline.command.js.map +1 -1
- package/dist/commands/agent/timeline.command.spec.d.ts +2 -0
- package/dist/commands/agent/timeline.command.spec.d.ts.map +1 -0
- package/dist/commands/agent/timeline.command.spec.js +77 -0
- package/dist/commands/agent/timeline.command.spec.js.map +1 -0
- package/dist/commands/agent/trigger-test-run.command.d.ts +27 -1
- package/dist/commands/agent/trigger-test-run.command.d.ts.map +1 -1
- package/dist/commands/agent/trigger-test-run.command.js +64 -53
- package/dist/commands/agent/trigger-test-run.command.js.map +1 -1
- package/dist/commands/agent/trigger-test-run.command.spec.d.ts +2 -0
- package/dist/commands/agent/trigger-test-run.command.spec.d.ts.map +1 -0
- package/dist/commands/agent/trigger-test-run.command.spec.js +88 -0
- package/dist/commands/agent/trigger-test-run.command.spec.js.map +1 -0
- package/dist/commands/agent/upload-build.command.d.ts +0 -1
- package/dist/commands/agent/upload-build.command.d.ts.map +1 -1
- package/dist/commands/agent/upload-build.command.js +12 -17
- package/dist/commands/agent/upload-build.command.js.map +1 -1
- package/dist/commands/all-commands.d.ts +38 -0
- package/dist/commands/all-commands.d.ts.map +1 -0
- package/dist/commands/all-commands.js +65 -0
- package/dist/commands/all-commands.js.map +1 -0
- package/dist/commands/auth/__tests__/list-projects.command.spec.js +22 -12
- package/dist/commands/auth/__tests__/list-projects.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/login.command.spec.js +9 -7
- package/dist/commands/auth/__tests__/login.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/logout.command.spec.js +4 -8
- package/dist/commands/auth/__tests__/logout.command.spec.js.map +1 -1
- package/dist/commands/auth/__tests__/whoami.command.spec.js +71 -21
- package/dist/commands/auth/__tests__/whoami.command.spec.js.map +1 -1
- package/dist/commands/auth/list-projects.command.d.ts.map +1 -1
- package/dist/commands/auth/list-projects.command.js +17 -14
- package/dist/commands/auth/list-projects.command.js.map +1 -1
- package/dist/commands/auth/login.command.d.ts.map +1 -1
- package/dist/commands/auth/login.command.js +4 -5
- package/dist/commands/auth/login.command.js.map +1 -1
- package/dist/commands/auth/logout.command.d.ts +1 -5
- package/dist/commands/auth/logout.command.d.ts.map +1 -1
- package/dist/commands/auth/logout.command.js +4 -9
- package/dist/commands/auth/logout.command.js.map +1 -1
- package/dist/commands/auth/set-project.command.d.ts.map +1 -1
- package/dist/commands/auth/set-project.command.js +7 -5
- package/dist/commands/auth/set-project.command.js.map +1 -1
- package/dist/commands/auth/unset-project.command.js +5 -5
- package/dist/commands/auth/unset-project.command.js.map +1 -1
- package/dist/commands/auth/whoami.command.d.ts +5 -1
- package/dist/commands/auth/whoami.command.d.ts.map +1 -1
- package/dist/commands/auth/whoami.command.js +75 -32
- package/dist/commands/auth/whoami.command.js.map +1 -1
- package/dist/commands/ci/prepare.command.d.ts.map +1 -1
- package/dist/commands/ci/prepare.command.js +3 -2
- package/dist/commands/ci/prepare.command.js.map +1 -1
- package/dist/commands/ci/run-local.command.d.ts.map +1 -1
- package/dist/commands/ci/run-local.command.js +6 -4
- package/dist/commands/ci/run-local.command.js.map +1 -1
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.d.ts.map +1 -1
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.js +6 -3
- package/dist/commands/ci/run-with-uploaded-asset-chunks.command.js.map +1 -1
- package/dist/commands/ci/run.command.d.ts.map +1 -1
- package/dist/commands/ci/run.command.js +3 -2
- package/dist/commands/ci/run.command.js.map +1 -1
- package/dist/commands/ci/start-tunnel.command.d.ts.map +1 -1
- package/dist/commands/ci/start-tunnel.command.js +4 -2
- package/dist/commands/ci/start-tunnel.command.js.map +1 -1
- package/dist/commands/ci/trigger-test-run.core.d.ts.map +1 -1
- package/dist/commands/ci/trigger-test-run.core.js +6 -3
- package/dist/commands/ci/trigger-test-run.core.js.map +1 -1
- package/dist/commands/ci/upload-assets.command.d.ts +1 -0
- package/dist/commands/ci/upload-assets.command.d.ts.map +1 -1
- package/dist/commands/ci/upload-assets.command.js +3 -2
- package/dist/commands/ci/upload-assets.command.js.map +1 -1
- package/dist/commands/ci/upload-container.command.d.ts +1 -0
- package/dist/commands/ci/upload-container.command.d.ts.map +1 -1
- package/dist/commands/ci/upload-container.command.js +3 -2
- package/dist/commands/ci/upload-container.command.js.map +1 -1
- package/dist/commands/debug/index.d.ts.map +1 -1
- package/dist/commands/debug/index.js +43 -36
- package/dist/commands/debug/index.js.map +1 -1
- package/dist/commands/local/relevant-sessions.command.d.ts.map +1 -1
- package/dist/commands/local/relevant-sessions.command.js +6 -3
- package/dist/commands/local/relevant-sessions.command.js.map +1 -1
- package/dist/commands/project/show.command.d.ts.map +1 -1
- package/dist/commands/project/show.command.js +6 -3
- package/dist/commands/project/show.command.js.map +1 -1
- package/dist/commands/record/__tests__/login.command.spec.d.ts +2 -0
- package/dist/commands/record/__tests__/login.command.spec.d.ts.map +1 -0
- package/dist/commands/record/__tests__/login.command.spec.js +72 -0
- package/dist/commands/record/__tests__/login.command.spec.js.map +1 -0
- package/dist/commands/record/__tests__/session.command.spec.d.ts +2 -0
- package/dist/commands/record/__tests__/session.command.spec.d.ts.map +1 -0
- package/dist/commands/record/__tests__/session.command.spec.js +86 -0
- package/dist/commands/record/__tests__/session.command.spec.js.map +1 -0
- package/dist/commands/record/login.command.d.ts.map +1 -1
- package/dist/commands/record/login.command.js +9 -3
- package/dist/commands/record/login.command.js.map +1 -1
- package/dist/commands/record/session.command.d.ts.map +1 -1
- package/dist/commands/record/session.command.js +9 -3
- package/dist/commands/record/session.command.js.map +1 -1
- package/dist/commands/replay.command.d.ts.map +1 -1
- package/dist/commands/replay.command.js +11 -15
- package/dist/commands/replay.command.js.map +1 -1
- package/dist/commands/schema.command.d.ts +53 -0
- package/dist/commands/schema.command.d.ts.map +1 -1
- package/dist/commands/schema.command.js +232 -106
- package/dist/commands/schema.command.js.map +1 -1
- package/dist/commands/schema.command.spec.d.ts +2 -0
- package/dist/commands/schema.command.spec.d.ts.map +1 -0
- package/dist/commands/schema.command.spec.js +198 -0
- package/dist/commands/schema.command.spec.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +60 -48
- package/dist/main.js.map +1 -1
- package/dist/utils/__tests__/select-project.spec.js +6 -12
- package/dist/utils/__tests__/select-project.spec.js.map +1 -1
- package/dist/utils/select-project.d.ts +1 -3
- package/dist/utils/select-project.d.ts.map +1 -1
- package/dist/utils/select-project.js +6 -5
- package/dist/utils/select-project.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-run-for-commit.command.js","sources":["../../../src/commands/agent/test-run-for-commit.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAIkC;AAClC,qDAAgF;AAEhF,mEAA+D;AAC/D,+DAA0D;AAC1D,uFAAkF;AAClF,2FAIkD;AASlD,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,SAAS,EACT,4BAA4B,EAC5B,IAAI,GACI,EAAiB,EAAE;IAC3B,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,iBAAiB,GAAG,MAAM,IAAA,qBAAY,EAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,6BAAY,CACpB,oFAAoF,CACrF,CAAC;IACJ,CAAC;IACD,4EAA4E;IAC5E,+EAA+E;IAC/E,kBAAkB;IAClB,MAAM,IAAA,mDAAoB,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAEzD,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAwB,EAAC;QAC/C,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IACH,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,qDAAwB,EAAC,SAAS,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAmB,EAAC,MAAM,EAAE,iBAAiB,EAAE;QAClE,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,IAAI,EAAE,CAAC;YACT,
|
|
1
|
+
{"version":3,"file":"test-run-for-commit.command.js","sources":["../../../src/commands/agent/test-run-for-commit.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAIkC;AAClC,qDAAgF;AAEhF,+DAA2D;AAC3D,mEAA+D;AAC/D,+DAA0D;AAC1D,uFAAkF;AAClF,2FAIkD;AASlD,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,SAAS,EACT,4BAA4B,EAC5B,IAAI,GACI,EAAiB,EAAE;IAC3B,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,iBAAiB,GAAG,MAAM,IAAA,qBAAY,EAAC,SAAS,CAAC,CAAC;IACxD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,6BAAY,CACpB,oFAAoF,CACrF,CAAC;IACJ,CAAC;IACD,4EAA4E;IAC5E,+EAA+E;IAC/E,kBAAkB;IAClB,MAAM,IAAA,mDAAoB,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAEzD,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAwB,EAAC;QAC/C,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IACH,6EAA6E;IAC7E,wDAAwD;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,qDAAwB,EAAC,SAAS,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAmB,EAAC,MAAM,EAAE,iBAAiB,EAAE;QAClE,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,IAAI,EAAE,CAAC;YACT,IAAA,sBAAS,EAAC,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OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;YACd,WAAW,EACT,6IAA6I;SAChJ;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"c142afd6-1d1d-5f65-885f-bb7beba18fd4"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/timeline.command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"timeline.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/timeline.command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,OAAO;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACf;AAuDD,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CAa/D,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="42f088b2-4165-5272-b23f-2e5778ddc850")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.timelineDiffCommand = void 0;
|
|
6
6
|
const client_1 = require("@alwaysmeticulous/client");
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
|
+
const print_json_1 = require("../../command-utils/print-json");
|
|
8
9
|
const sentry_utils_1 = require("../../command-utils/sentry.utils");
|
|
9
10
|
const STATUS_PREFIX = {
|
|
10
11
|
identical: " ",
|
|
@@ -12,15 +13,28 @@ const STATUS_PREFIX = {
|
|
|
12
13
|
added: "+",
|
|
13
14
|
changed: "!",
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
// The JSON `diff` field mirrors STATUS_PREFIX but uses "=" for identical, where
|
|
17
|
+
// the TSV keeps a space.
|
|
18
|
+
const STATUS_SYMBOL = {
|
|
19
|
+
...STATUS_PREFIX,
|
|
20
|
+
identical: "=",
|
|
21
|
+
};
|
|
22
|
+
const handler = async ({ apiToken, replayDiffId, json, }) => {
|
|
16
23
|
(0, common_1.initLogger)();
|
|
17
24
|
const client = await (0, client_1.createClientWithOAuth)({
|
|
18
25
|
apiToken,
|
|
19
26
|
enableOAuthLogin: true,
|
|
20
27
|
});
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
const { entries } = await (0, client_1.getTimelineDiff)(client, replayDiffId);
|
|
29
|
+
if (json) {
|
|
30
|
+
(0, print_json_1.printJson)(entries.map((entry) => ({
|
|
31
|
+
diff: STATUS_SYMBOL[entry.status] ?? entry.status,
|
|
32
|
+
timeMs: entry.timeMs,
|
|
33
|
+
event: entry.eventKind,
|
|
34
|
+
description: entry.description,
|
|
35
|
+
})));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
24
38
|
console.log(["diff", "timeMs", "event", "description"].join("\t"));
|
|
25
39
|
for (const entry of entries) {
|
|
26
40
|
console.log([
|
|
@@ -33,7 +47,7 @@ const handler = async ({ apiToken, replayDiffId }) => {
|
|
|
33
47
|
};
|
|
34
48
|
exports.timelineDiffCommand = {
|
|
35
49
|
command: "timeline-diff",
|
|
36
|
-
describe: "Get timeline diff for a replay diff",
|
|
50
|
+
describe: "Get the timeline diff for a replay diff. Outputs TSV, one row per timeline entry: diff, timeMs, event, description (or JSON with --json).",
|
|
37
51
|
builder: {
|
|
38
52
|
apiToken: { string: true, description: "Meticulous API token" },
|
|
39
53
|
replayDiffId: {
|
|
@@ -45,4 +59,4 @@ exports.timelineDiffCommand = {
|
|
|
45
59
|
handler: (0, sentry_utils_1.wrapHandler)(handler),
|
|
46
60
|
};
|
|
47
61
|
//# sourceMappingURL=timeline.command.js.map
|
|
48
|
-
//# debugId=
|
|
62
|
+
//# debugId=42f088b2-4165-5272-b23f-2e5778ddc850
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.command.js","sources":["../../../src/commands/agent/timeline.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAsD;AAEtD,mEAA+D;
|
|
1
|
+
{"version":3,"file":"timeline.command.js","sources":["../../../src/commands/agent/timeline.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAsD;AAEtD,+DAA2D;AAC3D,mEAA+D;AAQ/D,MAAM,aAAa,GAA2B;IAC5C,SAAS,EAAE,GAAG;IACd,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,GAAG;CACb,CAAC;AAEF,gFAAgF;AAChF,yBAAyB;AACzB,MAAM,aAAa,GAA2B;IAC5C,GAAG,aAAa;IAChB,SAAS,EAAE,GAAG;CACf,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,YAAY,EACZ,IAAI,GACI,EAAiB,EAAE;IAC3B,IAAA,mBAAU,GAAE,CAAC;IACb,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,wBAAe,EAAC,MAAM,EAAE,YAA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../../src/commands/agent/timeline.command.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5e4f54bf-e814-5f9c-9e61-929b4335d70f")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const timeline_command_1 = require("./timeline.command");
|
|
7
|
+
// Make wrapHandler a passthrough so handler errors propagate directly to tests
|
|
8
|
+
// rather than being swallowed by process.exit().
|
|
9
|
+
vitest_1.vi.mock("../../command-utils/sentry.utils", () => ({
|
|
10
|
+
wrapHandler: (fn) => fn,
|
|
11
|
+
}));
|
|
12
|
+
const loggerMock = {
|
|
13
|
+
info: vitest_1.vi.fn(),
|
|
14
|
+
warn: vitest_1.vi.fn(),
|
|
15
|
+
error: vitest_1.vi.fn(),
|
|
16
|
+
debug: vitest_1.vi.fn(),
|
|
17
|
+
};
|
|
18
|
+
const mocks = vitest_1.vi.hoisted(() => ({
|
|
19
|
+
createClientWithOAuth: vitest_1.vi.fn(),
|
|
20
|
+
getTimelineDiff: vitest_1.vi.fn(),
|
|
21
|
+
}));
|
|
22
|
+
vitest_1.vi.mock("@alwaysmeticulous/common", () => ({
|
|
23
|
+
initLogger: () => loggerMock,
|
|
24
|
+
}));
|
|
25
|
+
vitest_1.vi.mock("@alwaysmeticulous/client", () => ({
|
|
26
|
+
createClientWithOAuth: mocks.createClientWithOAuth,
|
|
27
|
+
getTimelineDiff: mocks.getTimelineDiff,
|
|
28
|
+
}));
|
|
29
|
+
const runHandler = (args = {}) => timeline_command_1.timelineDiffCommand.handler({
|
|
30
|
+
replayDiffId: "rd-1",
|
|
31
|
+
json: false,
|
|
32
|
+
...args,
|
|
33
|
+
});
|
|
34
|
+
let logSpy;
|
|
35
|
+
const stdoutText = () => logSpy.mock.calls.flat().join("\n");
|
|
36
|
+
const ENTRIES = [
|
|
37
|
+
{ status: "identical", timeMs: 0, eventKind: "click", description: "a" },
|
|
38
|
+
{ status: "changed", timeMs: 10, eventKind: "nav", description: "b" },
|
|
39
|
+
{ status: "added", timeMs: 20, eventKind: "type", description: "c" },
|
|
40
|
+
{ status: "removed", timeMs: 30, eventKind: "scroll", description: "d" },
|
|
41
|
+
];
|
|
42
|
+
(0, vitest_1.describe)("timeline-diff command", () => {
|
|
43
|
+
(0, vitest_1.beforeEach)(() => {
|
|
44
|
+
vitest_1.vi.clearAllMocks();
|
|
45
|
+
mocks.createClientWithOAuth.mockResolvedValue({});
|
|
46
|
+
mocks.getTimelineDiff.mockResolvedValue({ entries: ENTRIES });
|
|
47
|
+
logSpy = vitest_1.vi.spyOn(console, "log").mockImplementation(() => { });
|
|
48
|
+
});
|
|
49
|
+
(0, vitest_1.afterEach)(() => {
|
|
50
|
+
logSpy.mockRestore();
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.it)("emits JSON using '=' for identical entries and the mapped fields", async () => {
|
|
53
|
+
await runHandler({ json: true });
|
|
54
|
+
(0, vitest_1.expect)(JSON.parse(stdoutText())).toEqual([
|
|
55
|
+
{ diff: "=", timeMs: 0, event: "click", description: "a" },
|
|
56
|
+
{ diff: "!", timeMs: 10, event: "nav", description: "b" },
|
|
57
|
+
{ diff: "+", timeMs: 20, event: "type", description: "c" },
|
|
58
|
+
{ diff: "-", timeMs: 30, event: "scroll", description: "d" },
|
|
59
|
+
]);
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.it)("emits a TSV header and one row per entry, using a space for identical", async () => {
|
|
62
|
+
await runHandler({ json: false });
|
|
63
|
+
const lines = stdoutText().split("\n");
|
|
64
|
+
(0, vitest_1.expect)(lines[0]).toBe(["diff", "timeMs", "event", "description"].join("\t"));
|
|
65
|
+
// Identical rows keep a space prefix in the TSV (unlike the JSON "=").
|
|
66
|
+
(0, vitest_1.expect)(lines[1]).toBe([" ", 0, "click", "a"].join("\t"));
|
|
67
|
+
(0, vitest_1.expect)(lines[2]).toBe(["!", 10, "nav", "b"].join("\t"));
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.it)("emits an empty JSON array (not a message) when there are no entries", async () => {
|
|
70
|
+
mocks.getTimelineDiff.mockResolvedValue({ entries: [] });
|
|
71
|
+
await runHandler({ json: true });
|
|
72
|
+
// A table-shaped command always emits valid JSON on stdout — [] when empty.
|
|
73
|
+
(0, vitest_1.expect)(JSON.parse(stdoutText())).toEqual([]);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=timeline.command.spec.js.map
|
|
77
|
+
//# debugId=5e4f54bf-e814-5f9c-9e61-929b4335d70f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.command.spec.js","sources":["../../../src/commands/agent/timeline.command.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;AAAA,mCAAyE;AACzE,yDAAyD;AAEzD,+EAA+E;AAC/E,iDAAiD;AACjD,WAAE,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,WAAW,EAAE,CAAC,EAAyC,EAAE,EAAE,CAAC,EAAE;CAC/D,CAAC,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAE,CAAC,EAAE,EAAE;IACb,IAAI,EAAE,WAAE,CAAC,EAAE,EAAE;IACb,KAAK,EAAE,WAAE,CAAC,EAAE,EAAE;IACd,KAAK,EAAE,WAAE,CAAC,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,KAAK,GAAG,WAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9B,qBAAqB,EAAE,WAAE,CAAC,EAAE,EAAE;IAC9B,eAAe,EAAE,WAAE,CAAC,EAAE,EA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AElC,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACnB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtD,CAAC;QACF,uEAAuE;QACvE,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;QACnF,KAAK,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzD,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAEjC,4EAA4E;QAC5E,IAAA,eAAM,EAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debugId":"5e4f54bf-e814-5f9c-9e61-929b4335d70f"}
|
|
@@ -5,12 +5,38 @@ interface Options {
|
|
|
5
5
|
commitSha?: string | undefined;
|
|
6
6
|
baseSha?: string | undefined;
|
|
7
7
|
gitDiffOutput?: string | undefined;
|
|
8
|
-
repoDirectory?: string | undefined;
|
|
9
8
|
sessionIds?: string | undefined;
|
|
10
9
|
dontWaitForTestRunToComplete: boolean;
|
|
11
10
|
json: boolean;
|
|
12
11
|
dryRun?: boolean;
|
|
13
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether the "nothing to test" short-circuit should fire: base equals head
|
|
15
|
+
* with no diff to attach. Requires `commitSha` (--commitSha mode, explicit or
|
|
16
|
+
* inferred): in --deploymentId mode `effectiveHead` is only a local proxy for
|
|
17
|
+
* the deployment's actual commit, so an empty local diff doesn't prove
|
|
18
|
+
* there's nothing to test there (the backend may already have a diff
|
|
19
|
+
* uploaded separately for that deployment and base). Also skipped for a
|
|
20
|
+
* pinned --sessionIds re-run, which deliberately proceeds head-only.
|
|
21
|
+
*/
|
|
22
|
+
export declare const shouldSkipAsNothingToTest: ({ commitSha, effectiveHead, baseSha, gitDiffOutput, hasPinnedSessionIds, }: {
|
|
23
|
+
commitSha: string | undefined;
|
|
24
|
+
effectiveHead: string | undefined;
|
|
25
|
+
baseSha: string;
|
|
26
|
+
gitDiffOutput: string | undefined;
|
|
27
|
+
hasPinnedSessionIds: boolean;
|
|
28
|
+
}) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to warn that the diff computed pre-trigger may not match what the
|
|
31
|
+
* deployment actually executed. Skipped for ephemeral heads (a `git stash
|
|
32
|
+
* create` SHA differs between invocations for identical content, so the
|
|
33
|
+
* comparison would be a false positive) or when either commit is unknown.
|
|
34
|
+
*/
|
|
35
|
+
export declare const shouldWarnOfHeadDrift: ({ headIsEphemeral, head, headCommitSha, }: {
|
|
36
|
+
headIsEphemeral: boolean;
|
|
37
|
+
head: string | undefined;
|
|
38
|
+
headCommitSha: string | null;
|
|
39
|
+
}) => boolean;
|
|
14
40
|
export declare const triggerTestRunCommand: CommandModule<unknown, Options>;
|
|
15
41
|
export {};
|
|
16
42
|
//# sourceMappingURL=trigger-test-run.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-test-run.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/trigger-test-run.command.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger-test-run.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/trigger-test-run.command.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgB3C,UAAU,OAAO;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,4BAA4B,EAAE,OAAO,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,+EAMnC;IACD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,KAAG,OAKkB,CAAC;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,8CAI/B;IACD,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,KAAG,OAIoB,CAAC;AAqLzB,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CAuDjE,CAAC"}
|
|
@@ -1,19 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="df8907fb-ae7b-5530-a9fd-0350d1ce14d5")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.triggerTestRunCommand = void 0;
|
|
5
|
+
exports.triggerTestRunCommand = exports.shouldWarnOfHeadDrift = exports.shouldSkipAsNothingToTest = void 0;
|
|
6
6
|
const client_1 = require("@alwaysmeticulous/client");
|
|
7
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
8
8
|
const remote_replay_launcher_1 = require("@alwaysmeticulous/remote-replay-launcher");
|
|
9
9
|
const common_options_1 = require("../../command-utils/common-options");
|
|
10
|
+
const print_json_1 = require("../../command-utils/print-json");
|
|
10
11
|
const sentry_utils_1 = require("../../command-utils/sentry.utils");
|
|
11
12
|
const cli_user_error_1 = require("../../utils/cli-user-error");
|
|
12
13
|
const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
|
|
13
14
|
const resolve_project_identifier_1 = require("../../utils/resolve-project-identifier");
|
|
14
15
|
const resolve_test_run_from_commit_1 = require("../../utils/resolve-test-run-from-commit");
|
|
15
16
|
const build_git_options_1 = require("./build-git-options");
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Whether the "nothing to test" short-circuit should fire: base equals head
|
|
19
|
+
* with no diff to attach. Requires `commitSha` (--commitSha mode, explicit or
|
|
20
|
+
* inferred): in --deploymentId mode `effectiveHead` is only a local proxy for
|
|
21
|
+
* the deployment's actual commit, so an empty local diff doesn't prove
|
|
22
|
+
* there's nothing to test there (the backend may already have a diff
|
|
23
|
+
* uploaded separately for that deployment and base). Also skipped for a
|
|
24
|
+
* pinned --sessionIds re-run, which deliberately proceeds head-only.
|
|
25
|
+
*/
|
|
26
|
+
const shouldSkipAsNothingToTest = ({ commitSha, effectiveHead, baseSha, gitDiffOutput, hasPinnedSessionIds, }) => Boolean(commitSha) &&
|
|
27
|
+
Boolean(effectiveHead) &&
|
|
28
|
+
baseSha === effectiveHead &&
|
|
29
|
+
!gitDiffOutput &&
|
|
30
|
+
!hasPinnedSessionIds;
|
|
31
|
+
exports.shouldSkipAsNothingToTest = shouldSkipAsNothingToTest;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to warn that the diff computed pre-trigger may not match what the
|
|
34
|
+
* deployment actually executed. Skipped for ephemeral heads (a `git stash
|
|
35
|
+
* create` SHA differs between invocations for identical content, so the
|
|
36
|
+
* comparison would be a false positive) or when either commit is unknown.
|
|
37
|
+
*/
|
|
38
|
+
const shouldWarnOfHeadDrift = ({ headIsEphemeral, head, headCommitSha, }) => !headIsEphemeral &&
|
|
39
|
+
Boolean(head) &&
|
|
40
|
+
Boolean(headCommitSha) &&
|
|
41
|
+
head !== headCommitSha;
|
|
42
|
+
exports.shouldWarnOfHeadDrift = shouldWarnOfHeadDrift;
|
|
43
|
+
const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha: baseSha_, gitDiffOutput: gitDiffOutput_, sessionIds: sessionIds_, dontWaitForTestRunToComplete, json, dryRun, }) => {
|
|
17
44
|
if (deploymentId && commitSha_) {
|
|
18
45
|
throw new cli_user_error_1.CliUserError("--deploymentId and --commitSha are mutually exclusive. Pass --deploymentId for a build from 'agent upload-build', " +
|
|
19
46
|
"or --commitSha to find an existing deployment already uploaded for that commit.");
|
|
@@ -22,7 +49,7 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
22
49
|
// assumption a deployment was already uploaded for it elsewhere (e.g. by CI).
|
|
23
50
|
let commitSha = commitSha_;
|
|
24
51
|
if (!deploymentId && !commitSha) {
|
|
25
|
-
commitSha = await (0, build_git_options_1.resolveHeadCommitShaForLookup)(
|
|
52
|
+
commitSha = await (0, build_git_options_1.resolveHeadCommitShaForLookup)();
|
|
26
53
|
}
|
|
27
54
|
// Session IDs never contain commas (they are `<ISO timestamp>_<nanoid>` with
|
|
28
55
|
// optional `_p`/`_sl`/`_mut` suffixes), so a comma split is unambiguous.
|
|
@@ -44,48 +71,40 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
44
71
|
];
|
|
45
72
|
throw new cli_user_error_1.CliUserError(`--sessionIds contains duplicate session ID(s): ${duplicates.join(", ")}`);
|
|
46
73
|
}
|
|
74
|
+
// Every custom trigger gets a git diff (used by Relevant Session Execution),
|
|
75
|
+
// computed against `commitSha` when we have one (--commitSha mode, explicit
|
|
76
|
+
// or inferred above) or freshly resolved from local HEAD otherwise
|
|
77
|
+
// (--deploymentId mode).
|
|
47
78
|
const { baseSha, gitDiffOutput, head, headIsEphemeral } = await (0, build_git_options_1.resolveComparisonOptions)({
|
|
48
79
|
baseSha: baseSha_,
|
|
49
80
|
gitDiffOutput: gitDiffOutput_,
|
|
50
|
-
|
|
81
|
+
commitSha,
|
|
51
82
|
});
|
|
52
|
-
// A
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
// --
|
|
56
|
-
if (gitDiffOutput && !deploymentId) {
|
|
57
|
-
throw new cli_user_error_1.CliUserError("A git diff requires an explicit --deploymentId (from 'agent upload-build'); it cannot be combined with --commitSha. " +
|
|
58
|
-
"Pass --baseSha instead of --repoDirectory (or without any repo-inference flags) to avoid inferring a diff.");
|
|
59
|
-
}
|
|
60
|
-
// A --baseSha value is always required up front, even though it may end up
|
|
61
|
-
// unused for comparison below (a same-SHA re-run with pinned --sessionIds
|
|
62
|
-
// runs head-only with no base).
|
|
83
|
+
// A test run is only useful with a base to compare against, and the backend
|
|
84
|
+
// refuses to create a baseless run, so require a base up front — even
|
|
85
|
+
// though it may end up unused for comparison below (a same-SHA re-run with
|
|
86
|
+
// pinned --sessionIds runs head-only with no base).
|
|
63
87
|
if (!baseSha) {
|
|
64
|
-
throw new cli_user_error_1.CliUserError("A base is required: pass --baseSha, or
|
|
88
|
+
throw new cli_user_error_1.CliUserError("A base is required: pass --baseSha, or run from a local git checkout so it can be inferred from the merge-base with the origin default branch.");
|
|
65
89
|
}
|
|
66
90
|
// When the head is the base itself and there's no diff (e.g. running on the
|
|
67
91
|
// default branch with no new commits), there is nothing to test — report it
|
|
68
|
-
// clearly instead of letting the backend reject with a 422
|
|
69
|
-
//
|
|
70
|
-
// is an explicit alternative source of the head commit that lets us catch
|
|
71
|
-
// this early too, without a network round trip to resolve the deployment
|
|
72
|
-
// first (gitDiffOutput is already guaranteed absent when commitSha is used,
|
|
73
|
-
// per the check above).
|
|
74
|
-
// An explicit --sessionIds list is exempted: a same-SHA re-run with pinned
|
|
75
|
-
// sessions is a deliberate "check these sessions against the current code"
|
|
76
|
-
// request (e.g. coverage impact), not a missing base, so it's allowed to
|
|
77
|
-
// proceed and run head-only, with no base comparison.
|
|
92
|
+
// clearly instead of letting the backend reject with a 422 (see
|
|
93
|
+
// shouldSkipAsNothingToTest for the exemptions).
|
|
78
94
|
const effectiveHead = head ?? commitSha;
|
|
79
95
|
const hasPinnedSessionIds = sessionIds != null && sessionIds.length > 0;
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
if ((0, exports.shouldSkipAsNothingToTest)({
|
|
97
|
+
commitSha,
|
|
98
|
+
effectiveHead,
|
|
99
|
+
baseSha,
|
|
100
|
+
gitDiffOutput,
|
|
101
|
+
hasPinnedSessionIds,
|
|
102
|
+
})) {
|
|
84
103
|
(0, common_1.logNotice)("Base SHA equals head SHA and there are no changes to test — nothing to do.");
|
|
85
104
|
// Keep stdout machine-readable: emit the empty result so `--json` callers
|
|
86
105
|
// that JSON.parse(stdout) don't crash on an empty short-circuit.
|
|
87
106
|
if (json) {
|
|
88
|
-
|
|
107
|
+
(0, print_json_1.printJson)({ testRunId: null, status: null });
|
|
89
108
|
}
|
|
90
109
|
return;
|
|
91
110
|
}
|
|
@@ -98,7 +117,7 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
98
117
|
? ` for ${sessionIds.length} explicitly-specified session(s)`
|
|
99
118
|
: ""));
|
|
100
119
|
if (json) {
|
|
101
|
-
|
|
120
|
+
(0, print_json_1.printJson)({ testRunId: null, status: null });
|
|
102
121
|
}
|
|
103
122
|
return;
|
|
104
123
|
}
|
|
@@ -122,10 +141,9 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
122
141
|
// The diff was computed against `head`, but the run executes the
|
|
123
142
|
// deployment's commit. If they differ (e.g. the working tree changed
|
|
124
143
|
// between 'upload-build' and 'trigger-test-run'), the diff may not match
|
|
125
|
-
// the build that actually ran
|
|
126
|
-
// ephemeral
|
|
127
|
-
|
|
128
|
-
if (!headIsEphemeral && head && headCommitSha && head !== headCommitSha) {
|
|
144
|
+
// the build that actually ran (see shouldWarnOfHeadDrift for the
|
|
145
|
+
// ephemeral-head exemption).
|
|
146
|
+
if ((0, exports.shouldWarnOfHeadDrift)({ headIsEphemeral, head, headCommitSha })) {
|
|
129
147
|
(0, common_1.logNotice)(`Warning: git diff was computed against ${head}, but the deployment runs ${headCommitSha}. ` +
|
|
130
148
|
`The diff may not match the build under test — re-run 'agent upload-build' for the current tree if this is unexpected.`);
|
|
131
149
|
}
|
|
@@ -153,7 +171,7 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
153
171
|
(0, common_1.logProgress)(`Status: ${status} (${status === "Failure" ? "has" : "no"} diffs)`);
|
|
154
172
|
}
|
|
155
173
|
if (json) {
|
|
156
|
-
|
|
174
|
+
(0, print_json_1.printJson)({ testRunId, status });
|
|
157
175
|
return;
|
|
158
176
|
}
|
|
159
177
|
if (testRunId) {
|
|
@@ -162,7 +180,7 @@ const handler = async ({ apiToken, deploymentId, commitSha: commitSha_, baseSha:
|
|
|
162
180
|
};
|
|
163
181
|
exports.triggerTestRunCommand = {
|
|
164
182
|
command: "trigger-test-run",
|
|
165
|
-
describe: "Trigger a test run against a deployment created by 'agent upload-build'",
|
|
183
|
+
describe: "Trigger a test run against a deployment created by 'agent upload-build'. Outputs the testRunId (or JSON with --json).",
|
|
166
184
|
builder: {
|
|
167
185
|
apiToken: common_options_1.OPTIONS.apiToken,
|
|
168
186
|
deploymentId: {
|
|
@@ -174,21 +192,19 @@ exports.triggerTestRunCommand = {
|
|
|
174
192
|
string: true,
|
|
175
193
|
description: "Alternative to --deploymentId: finds the most recent deployment already uploaded for this commit in the project " +
|
|
176
194
|
"(e.g. by an earlier CI run). Useful for re-running against a commit that has already gone through Meticulous, " +
|
|
177
|
-
"e.g. to test the coverage impact of --sessionIds.
|
|
195
|
+
"e.g. to test the coverage impact of --sessionIds. A git diff against --baseSha is computed for this commit " +
|
|
196
|
+
"(git history must have it locally) unless you pass --gitDiffOutput yourself. " +
|
|
178
197
|
"When both this and --deploymentId are omitted, defaults to the local repo's HEAD commit (requires a clean working tree).",
|
|
179
198
|
},
|
|
180
199
|
baseSha: {
|
|
181
200
|
string: true,
|
|
182
|
-
description: "The base commit SHA to compare against.
|
|
183
|
-
"
|
|
201
|
+
description: "The base commit SHA to compare against. If omitted, it's inferred from the local repo (the current directory) as the merge-base " +
|
|
202
|
+
"with the origin default branch. Every trigger gets a git diff against this base (used by Relevant Session Execution) — " +
|
|
203
|
+
"against --commitSha when using it, or the local repo's head commit with --deploymentId — unless you pass --gitDiffOutput yourself.",
|
|
184
204
|
},
|
|
185
205
|
gitDiffOutput: {
|
|
186
206
|
string: true,
|
|
187
|
-
description: "Raw git diff output between the base and the deployment's commit
|
|
188
|
-
},
|
|
189
|
-
repoDirectory: {
|
|
190
|
-
string: true,
|
|
191
|
-
description: "Path to a git repository. Infers --baseSha (merge-base with the origin default branch) and --gitDiffOutput (base..head). Cannot be combined with --baseSha or --gitDiffOutput. Defaults to the current directory when no comparison inputs are given.",
|
|
207
|
+
description: "Raw git diff output between the base and the head commit (the deployment's commit, or --commitSha). Requires --baseSha.",
|
|
192
208
|
},
|
|
193
209
|
sessionIds: {
|
|
194
210
|
string: true,
|
|
@@ -202,11 +218,6 @@ exports.triggerTestRunCommand = {
|
|
|
202
218
|
description: "Return as soon as the run is triggered, instead of the default of blocking until it finishes. " +
|
|
203
219
|
"The base test run is set up by the backend in parallel with the head, so there is no separate base-wait step.",
|
|
204
220
|
},
|
|
205
|
-
json: {
|
|
206
|
-
boolean: true,
|
|
207
|
-
default: false,
|
|
208
|
-
description: "Output the result ({ testRunId, status }) as JSON.",
|
|
209
|
-
},
|
|
210
221
|
dryRun: {
|
|
211
222
|
boolean: true,
|
|
212
223
|
default: false,
|
|
@@ -216,4 +227,4 @@ exports.triggerTestRunCommand = {
|
|
|
216
227
|
handler: (0, sentry_utils_1.wrapHandler)(handler),
|
|
217
228
|
};
|
|
218
229
|
//# sourceMappingURL=trigger-test-run.command.js.map
|
|
219
|
-
//# debugId=
|
|
230
|
+
//# debugId=df8907fb-ae7b-5530-a9fd-0350d1ce14d5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-test-run.command.js","sources":["../../../src/commands/agent/trigger-test-run.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAkE;AAClE,qFAA0E;AAE1E,uEAA6D;AAC7D,mEAA+D;AAC/D,+DAA0D;AAC1D,mFAG8C;AAC9C,uFAAkF;AAClF,2FAAkF;AAClF,2DAG6B;
|
|
1
|
+
{"version":3,"file":"trigger-test-run.command.js","sources":["../../../src/commands/agent/trigger-test-run.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAkE;AAClE,qFAA0E;AAE1E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,IAAI;YACb,OAAO,EAAE,KAAK;YACd,WAAW,EACT,gGAAgG;gBAChG,+GAA+G;SAClH;QACD,MAAM,EAAE;YACN,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;YACd,WAAW,EACT,+DAA+D;SAClE;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"df8907fb-ae7b-5530-a9fd-0350d1ce14d5"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-test-run.command.spec.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/trigger-test-run.command.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="82f49921-91c1-5be5-b223-fb6b0890e54d")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const vitest_1 = require("vitest");
|
|
6
|
+
const trigger_test_run_command_1 = require("./trigger-test-run.command");
|
|
7
|
+
(0, vitest_1.describe)("shouldSkipAsNothingToTest", () => {
|
|
8
|
+
(0, vitest_1.test)("skips in --commitSha mode when base equals head with no diff", () => {
|
|
9
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldSkipAsNothingToTest)({
|
|
10
|
+
commitSha: "sha-1",
|
|
11
|
+
effectiveHead: "sha-1",
|
|
12
|
+
baseSha: "sha-1",
|
|
13
|
+
gitDiffOutput: undefined,
|
|
14
|
+
hasPinnedSessionIds: false,
|
|
15
|
+
})).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.test)("does not skip in --deploymentId mode (commitSha undefined), even when base equals head", () => {
|
|
18
|
+
// An empty local diff is only a proxy for the deployment's actual
|
|
19
|
+
// commit — the backend may already have a diff uploaded separately for
|
|
20
|
+
// this deployment and base, so the CLI must not short-circuit locally.
|
|
21
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldSkipAsNothingToTest)({
|
|
22
|
+
commitSha: undefined,
|
|
23
|
+
effectiveHead: "headsha",
|
|
24
|
+
baseSha: "headsha",
|
|
25
|
+
gitDiffOutput: undefined,
|
|
26
|
+
hasPinnedSessionIds: false,
|
|
27
|
+
})).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
(0, vitest_1.test)("does not skip when a diff is present", () => {
|
|
30
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldSkipAsNothingToTest)({
|
|
31
|
+
commitSha: "sha-1",
|
|
32
|
+
effectiveHead: "sha-1",
|
|
33
|
+
baseSha: "sha-1",
|
|
34
|
+
gitDiffOutput: "some diff",
|
|
35
|
+
hasPinnedSessionIds: false,
|
|
36
|
+
})).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
(0, vitest_1.test)("does not skip when sessionIds are pinned (deliberate head-only re-run)", () => {
|
|
39
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldSkipAsNothingToTest)({
|
|
40
|
+
commitSha: "sha-1",
|
|
41
|
+
effectiveHead: "sha-1",
|
|
42
|
+
baseSha: "sha-1",
|
|
43
|
+
gitDiffOutput: undefined,
|
|
44
|
+
hasPinnedSessionIds: true,
|
|
45
|
+
})).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
(0, vitest_1.test)("does not skip when base and head differ", () => {
|
|
48
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldSkipAsNothingToTest)({
|
|
49
|
+
commitSha: "sha-1",
|
|
50
|
+
effectiveHead: "sha-1",
|
|
51
|
+
baseSha: "base-sha",
|
|
52
|
+
gitDiffOutput: undefined,
|
|
53
|
+
hasPinnedSessionIds: false,
|
|
54
|
+
})).toBe(false);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.describe)("shouldWarnOfHeadDrift", () => {
|
|
58
|
+
(0, vitest_1.test)("warns when the computed head differs from the deployment's actual commit", () => {
|
|
59
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldWarnOfHeadDrift)({
|
|
60
|
+
headIsEphemeral: false,
|
|
61
|
+
head: "headsha",
|
|
62
|
+
headCommitSha: "differentsha",
|
|
63
|
+
})).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.test)("does not warn when they match", () => {
|
|
66
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldWarnOfHeadDrift)({
|
|
67
|
+
headIsEphemeral: false,
|
|
68
|
+
head: "headsha",
|
|
69
|
+
headCommitSha: "headsha",
|
|
70
|
+
})).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
(0, vitest_1.test)("does not warn for an ephemeral head (stash SHA differs across invocations by design)", () => {
|
|
73
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldWarnOfHeadDrift)({
|
|
74
|
+
headIsEphemeral: true,
|
|
75
|
+
head: "stashsha",
|
|
76
|
+
headCommitSha: "differentsha",
|
|
77
|
+
})).toBe(false);
|
|
78
|
+
});
|
|
79
|
+
(0, vitest_1.test)("does not warn when head is unknown (explicit --gitDiffOutput was passed)", () => {
|
|
80
|
+
(0, vitest_1.expect)((0, trigger_test_run_command_1.shouldWarnOfHeadDrift)({
|
|
81
|
+
headIsEphemeral: false,
|
|
82
|
+
head: undefined,
|
|
83
|
+
headCommitSha: "anysha",
|
|
84
|
+
})).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=trigger-test-run.command.spec.js.map
|
|
88
|
+
//# debugId=82f49921-91c1-5be5-b223-fb6b0890e54d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-test-run.command.spec.js","sources":["../../../src/commands/agent/trigger-test-run.command.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;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QACpF,IAAA,eAAM,EACJ,IAAA,gDAAqB,EAAC;YACpB,eAAe,EAAE,KAAK;YACtB,IAAI,EAAE,SAAS;YACf,aAAa,EAAE,QAAQ;SACxB,CAAC,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debugId":"82f49921-91c1-5be5-b223-fb6b0890e54d"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-build.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/upload-build.command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"upload-build.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/upload-build.command.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAc3C,UAAU,OAAO;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,YAAY,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC;IAClD,4BAA4B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAmFD,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CAyD9D,CAAC"}
|