@alwaysmeticulous/cli 2.45.3 → 2.47.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 +12 -0
- package/dist/command-utils/common-options.js +7 -0
- package/dist/commands/replay/replay.command.d.ts +6 -0
- package/dist/commands/replay/replay.command.js +3 -1
- package/dist/commands/run-all-tests/run-all-tests.command.d.ts +6 -5
- package/dist/commands/run-all-tests/run-all-tests.command.js +2 -13
- package/package.json +10 -11
- package/dist/api/test-run.api.d.ts +0 -7
- package/dist/api/test-run.api.js +0 -21
|
@@ -78,6 +78,12 @@ export declare const OPTIONS: {
|
|
|
78
78
|
readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
|
|
79
79
|
readonly default: false;
|
|
80
80
|
};
|
|
81
|
+
readonly logPossibleNonDeterminism: {
|
|
82
|
+
readonly boolean: true;
|
|
83
|
+
readonly description: "Enable logging of non-determinism events";
|
|
84
|
+
readonly default: false;
|
|
85
|
+
readonly hidden: true;
|
|
86
|
+
};
|
|
81
87
|
};
|
|
82
88
|
export declare const SCREENSHOT_DIFF_OPTIONS: {
|
|
83
89
|
diffThreshold: {
|
|
@@ -153,4 +159,10 @@ export declare const COMMON_REPLAY_OPTIONS: {
|
|
|
153
159
|
readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
|
|
154
160
|
readonly default: false;
|
|
155
161
|
};
|
|
162
|
+
logPossibleNonDeterminism: {
|
|
163
|
+
readonly boolean: true;
|
|
164
|
+
readonly description: "Enable logging of non-determinism events";
|
|
165
|
+
readonly default: false;
|
|
166
|
+
readonly hidden: true;
|
|
167
|
+
};
|
|
156
168
|
};
|
|
@@ -91,6 +91,12 @@ exports.OPTIONS = {
|
|
|
91
91
|
description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.",
|
|
92
92
|
default: false,
|
|
93
93
|
},
|
|
94
|
+
logPossibleNonDeterminism: {
|
|
95
|
+
boolean: true,
|
|
96
|
+
description: "Enable logging of non-determinism events",
|
|
97
|
+
default: false,
|
|
98
|
+
hidden: true,
|
|
99
|
+
},
|
|
94
100
|
};
|
|
95
101
|
exports.SCREENSHOT_DIFF_OPTIONS = {
|
|
96
102
|
diffThreshold: exports.OPTIONS.diffThreshold,
|
|
@@ -112,4 +118,5 @@ exports.COMMON_REPLAY_OPTIONS = {
|
|
|
112
118
|
maxDurationMs: exports.OPTIONS.maxDurationMs,
|
|
113
119
|
maxEventCount: exports.OPTIONS.maxEventCount,
|
|
114
120
|
essentialFeaturesOnly: exports.OPTIONS.essentialFeaturesOnly,
|
|
121
|
+
logPossibleNonDeterminism: exports.OPTIONS.logPossibleNonDeterminism,
|
|
115
122
|
};
|
|
@@ -73,6 +73,12 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
|
|
|
73
73
|
readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
|
|
74
74
|
readonly default: false;
|
|
75
75
|
};
|
|
76
|
+
logPossibleNonDeterminism: {
|
|
77
|
+
readonly boolean: true;
|
|
78
|
+
readonly description: "Enable logging of non-determinism events";
|
|
79
|
+
readonly default: false;
|
|
80
|
+
readonly hidden: true;
|
|
81
|
+
};
|
|
76
82
|
apiToken: {
|
|
77
83
|
readonly string: true;
|
|
78
84
|
};
|
|
@@ -7,7 +7,7 @@ const command_builder_1 = require("../../command-utils/command-builder");
|
|
|
7
7
|
const common_options_1 = require("../../command-utils/common-options");
|
|
8
8
|
const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
|
|
9
9
|
const replay_debugger_ui_1 = require("./utils/replay-debugger.ui");
|
|
10
|
-
const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }) => {
|
|
10
|
+
const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, logPossibleNonDeterminism, debugger: enableStepThroughDebugger, }) => {
|
|
11
11
|
if (!screenshot && storyboard) {
|
|
12
12
|
throw new Error("Cannot take storyboard screenshots without taking end state screenshots. Please set '--screenshot' to true, or '--storyboard' to false.");
|
|
13
13
|
}
|
|
@@ -27,6 +27,7 @@ const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, si
|
|
|
27
27
|
maxDurationMs: maxDurationMs !== null && maxDurationMs !== void 0 ? maxDurationMs : null,
|
|
28
28
|
maxEventCount: maxEventCount !== null && maxEventCount !== void 0 ? maxEventCount : null,
|
|
29
29
|
essentialFeaturesOnly,
|
|
30
|
+
logPossibleNonDeterminism
|
|
30
31
|
};
|
|
31
32
|
const generatedByOption = { type: "replayCommand" };
|
|
32
33
|
const storyboardOptions = storyboard
|
|
@@ -61,6 +62,7 @@ const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, si
|
|
|
61
62
|
commitSha,
|
|
62
63
|
cookiesFile,
|
|
63
64
|
sessionId,
|
|
65
|
+
logPossibleNonDeterminism,
|
|
64
66
|
generatedBy: generatedByOption,
|
|
65
67
|
testRunId: null,
|
|
66
68
|
suppressScreenshotDiffLogging: false,
|
|
@@ -68,6 +68,12 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
|
|
|
68
68
|
readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
|
|
69
69
|
readonly default: false;
|
|
70
70
|
};
|
|
71
|
+
readonly logPossibleNonDeterminism: {
|
|
72
|
+
readonly boolean: true;
|
|
73
|
+
readonly description: "Enable logging of non-determinism events";
|
|
74
|
+
readonly default: false;
|
|
75
|
+
readonly hidden: true;
|
|
76
|
+
};
|
|
71
77
|
readonly apiToken: {
|
|
72
78
|
readonly string: true;
|
|
73
79
|
};
|
|
@@ -107,11 +113,6 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
|
|
|
107
113
|
readonly description: "If set to a value greater than 0 then will re-run all replays the specified number of times and mark them as a flake if the screenshot generated on one of the retryed replays differs from that in the first replay.";
|
|
108
114
|
readonly default: 0;
|
|
109
115
|
};
|
|
110
|
-
readonly useCache: {
|
|
111
|
-
readonly boolean: true;
|
|
112
|
-
readonly description: "Use result cache";
|
|
113
|
-
readonly default: false;
|
|
114
|
-
};
|
|
115
116
|
readonly testsFile: {
|
|
116
117
|
readonly string: true;
|
|
117
118
|
readonly description: string;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runAllTestsCommand = void 0;
|
|
4
|
-
const client_1 = require("@alwaysmeticulous/client");
|
|
5
4
|
const common_1 = require("@alwaysmeticulous/common");
|
|
6
5
|
const replay_orchestrator_launcher_1 = require("@alwaysmeticulous/replay-orchestrator-launcher");
|
|
7
|
-
const test_run_api_1 = require("../../api/test-run.api");
|
|
8
6
|
const command_builder_1 = require("../../command-utils/command-builder");
|
|
9
7
|
const common_options_1 = require("../../command-utils/common-options");
|
|
10
8
|
const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
|
|
11
|
-
const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, githubSummary, parallelize, parallelTasks: parrelelTasks_, maxRetriesOnFailure, rerunTestsNTimes,
|
|
9
|
+
const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, githubSummary, parallelize, parallelTasks: parrelelTasks_, maxRetriesOnFailure, rerunTestsNTimes, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeClick, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, logPossibleNonDeterminism, baseTestRunId, }) => {
|
|
12
10
|
const executionOptions = {
|
|
13
11
|
headless,
|
|
14
12
|
devTools,
|
|
@@ -21,6 +19,7 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
|
|
|
21
19
|
moveBeforeClick,
|
|
22
20
|
maxDurationMs: maxDurationMs !== null && maxDurationMs !== void 0 ? maxDurationMs : null,
|
|
23
21
|
maxEventCount: maxEventCount !== null && maxEventCount !== void 0 ? maxEventCount : null,
|
|
22
|
+
logPossibleNonDeterminism,
|
|
24
23
|
essentialFeaturesOnly,
|
|
25
24
|
};
|
|
26
25
|
const storyboardOptions = storyboard
|
|
@@ -33,10 +32,6 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
|
|
|
33
32
|
};
|
|
34
33
|
const parrelelTasks = parallelize ? parrelelTasks_ : 1;
|
|
35
34
|
const commitSha = (await (0, common_1.getCommitSha)(commitSha_)) || "unknown";
|
|
36
|
-
const client = (0, client_1.createClient)({ apiToken });
|
|
37
|
-
const cachedTestRunResults = useCache
|
|
38
|
-
? await (0, test_run_api_1.getCachedTestRunResults)({ client, commitSha })
|
|
39
|
-
: [];
|
|
40
35
|
try {
|
|
41
36
|
const { testRun } = await (0, replay_orchestrator_launcher_1.executeTestRun)({
|
|
42
37
|
testsFile: testsFile !== null && testsFile !== void 0 ? testsFile : null,
|
|
@@ -50,7 +45,6 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
|
|
|
50
45
|
parallelTasks: parrelelTasks !== null && parrelelTasks !== void 0 ? parrelelTasks : null,
|
|
51
46
|
maxRetriesOnFailure,
|
|
52
47
|
rerunTestsNTimes,
|
|
53
|
-
cachedTestRunResults,
|
|
54
48
|
githubSummary,
|
|
55
49
|
maxSemanticVersionSupported: 1,
|
|
56
50
|
});
|
|
@@ -110,11 +104,6 @@ exports.runAllTestsCommand = (0, command_builder_1.buildCommand)("run-all-tests"
|
|
|
110
104
|
description: "If set to a value greater than 0 then will re-run all replays the specified number of times and mark them as a flake if the screenshot generated on one of the retryed replays differs from that in the first replay.",
|
|
111
105
|
default: 0,
|
|
112
106
|
},
|
|
113
|
-
useCache: {
|
|
114
|
-
boolean: true,
|
|
115
|
-
description: "Use result cache",
|
|
116
|
-
default: false,
|
|
117
|
-
},
|
|
118
107
|
testsFile: {
|
|
119
108
|
string: true,
|
|
120
109
|
description: "The path to the meticulous.json file containing the list of tests you want to run." +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
4
4
|
"description": "The Meticulous CLI",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,17 +27,16 @@
|
|
|
27
27
|
"depcheck": "depcheck --ignore-patterns=dist"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@alwaysmeticulous/api": "^2.
|
|
31
|
-
"@alwaysmeticulous/client": "^2.
|
|
32
|
-
"@alwaysmeticulous/common": "^2.
|
|
33
|
-
"@alwaysmeticulous/downloading-helpers": "^2.
|
|
34
|
-
"@alwaysmeticulous/record": "^2.
|
|
35
|
-
"@alwaysmeticulous/replay-debugger-ui": "^2.
|
|
36
|
-
"@alwaysmeticulous/replay-orchestrator-launcher": "^2.
|
|
37
|
-
"@alwaysmeticulous/sdk-bundles-api": "^2.
|
|
30
|
+
"@alwaysmeticulous/api": "^2.46.0",
|
|
31
|
+
"@alwaysmeticulous/client": "^2.46.0",
|
|
32
|
+
"@alwaysmeticulous/common": "^2.46.0",
|
|
33
|
+
"@alwaysmeticulous/downloading-helpers": "^2.46.0",
|
|
34
|
+
"@alwaysmeticulous/record": "^2.46.0",
|
|
35
|
+
"@alwaysmeticulous/replay-debugger-ui": "^2.46.0",
|
|
36
|
+
"@alwaysmeticulous/replay-orchestrator-launcher": "^2.47.0",
|
|
37
|
+
"@alwaysmeticulous/sdk-bundles-api": "^2.47.0",
|
|
38
38
|
"@alwaysmeticulous/sentry": "^2.40.0",
|
|
39
39
|
"@sentry/node": "^7.36.0",
|
|
40
|
-
"axios": "^1.2.6",
|
|
41
40
|
"loglevel": "^1.8.0",
|
|
42
41
|
"puppeteer": "19.7.5",
|
|
43
42
|
"yargs": "^17.5.1"
|
|
@@ -79,5 +78,5 @@
|
|
|
79
78
|
"coverageDirectory": "../coverage",
|
|
80
79
|
"testEnvironment": "node"
|
|
81
80
|
},
|
|
82
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "43b9ec5e4280fce86eff065f3e3999854427e75f"
|
|
83
82
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TestCaseResult } from "@alwaysmeticulous/api";
|
|
2
|
-
import { AxiosInstance } from "axios";
|
|
3
|
-
export interface GetCachedTestRunResultsOptions {
|
|
4
|
-
client: AxiosInstance;
|
|
5
|
-
commitSha: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const getCachedTestRunResults: ({ client, commitSha, }: GetCachedTestRunResultsOptions) => Promise<TestCaseResult[]>;
|
package/dist/api/test-run.api.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCachedTestRunResults = void 0;
|
|
7
|
-
const client_1 = require("@alwaysmeticulous/client");
|
|
8
|
-
const common_1 = require("@alwaysmeticulous/common");
|
|
9
|
-
const loglevel_1 = __importDefault(require("loglevel"));
|
|
10
|
-
const getCachedTestRunResults = async ({ client, commitSha, }) => {
|
|
11
|
-
var _a, _b, _c;
|
|
12
|
-
const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
|
|
13
|
-
if (!commitSha || commitSha === "unknown") {
|
|
14
|
-
logger.warn("Test run cache not supported: no commit hash");
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
const results = (_c = (_b = (_a = (await (0, client_1.getLatestTestRunResults)({ client, commitSha }))) === null || _a === void 0 ? void 0 : _a.resultData) === null || _b === void 0 ? void 0 : _b.results) !== null && _c !== void 0 ? _c : [];
|
|
18
|
-
// Only return passing tests
|
|
19
|
-
return results.filter(({ result }) => result === "pass");
|
|
20
|
-
};
|
|
21
|
-
exports.getCachedTestRunResults = getCachedTestRunResults;
|