@empiricalrun/test-run 0.16.0 → 0.17.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 +18 -0
- package/dist/bin/commands/failed-list.js +1 -1
- package/dist/bin/commands/run.d.ts.map +1 -1
- package/dist/bin/commands/run.js +13 -14
- package/dist/bin/index.js +0 -4
- package/dist/dashboard.d.ts +1 -1
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/dashboard.js +4 -6
- package/dist/failed-test-list.d.ts +25 -2
- package/dist/failed-test-list.d.ts.map +1 -1
- package/dist/failed-test-list.js +115 -17
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/lib/cmd.d.ts.map +1 -1
- package/dist/lib/cmd.js +10 -39
- package/dist/lib/merge-reports/index.d.ts +4 -1
- package/dist/lib/merge-reports/index.d.ts.map +1 -1
- package/dist/lib/merge-reports/index.js +17 -9
- package/dist/lib/merge-reports/types.d.ts +1 -1
- package/dist/lib/run-all-tests.d.ts.map +1 -1
- package/dist/lib/run-all-tests.js +11 -5
- package/dist/lib/run-specific-test.d.ts.map +1 -1
- package/dist/lib/run-specific-test.js +13 -22
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -12
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.ts +7 -0
- package/dist/bin/commands/estimate-time-shard.d.ts +0 -3
- package/dist/bin/commands/estimate-time-shard.d.ts.map +0 -1
- package/dist/bin/commands/estimate-time-shard.js +0 -122
- package/dist/bin/commands/optimize-shards.d.ts +0 -3
- package/dist/bin/commands/optimize-shards.d.ts.map +0 -1
- package/dist/bin/commands/optimize-shards.js +0 -544
- package/dist/lib/cancellation-watcher.d.ts +0 -5
- package/dist/lib/cancellation-watcher.d.ts.map +0 -1
- package/dist/lib/cancellation-watcher.js +0 -49
- package/test-data/blob-report/report-1.zip +0 -0
- package/test-data/blob-report/report-2.zip +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @empiricalrun/test-run
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6fb8170: feat: playwright utils upgraded to use new core
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [6fb8170]
|
|
12
|
+
- @empiricalrun/reporter@0.29.0
|
|
13
|
+
|
|
14
|
+
## 0.16.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [3a315aa]
|
|
19
|
+
- @empiricalrun/reporter@0.28.1
|
|
20
|
+
|
|
3
21
|
## 0.16.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -23,7 +23,7 @@ function registerFailedListCommand(program) {
|
|
|
23
23
|
repoPath: options.repoPath,
|
|
24
24
|
verbose: options.verbose,
|
|
25
25
|
});
|
|
26
|
-
console.log(`Found ${result.
|
|
26
|
+
console.log(`Found ${result.testsToRun.length} failed tests`);
|
|
27
27
|
console.log(`Test list written to: ${result.outputPath}`);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QAiLlD"}
|
package/dist/bin/commands/run.js
CHANGED
|
@@ -50,10 +50,6 @@ function registerRunCommand(program) {
|
|
|
50
50
|
...options.project,
|
|
51
51
|
];
|
|
52
52
|
const pwOptions = command.args.filter((arg) => !optionsToStrip.includes(arg));
|
|
53
|
-
const projectName = process.env.PROJECT_NAME || (await (0, utils_1.pickNameFromPackageJson)());
|
|
54
|
-
if (!projectName) {
|
|
55
|
-
throw new Error("Project name is required");
|
|
56
|
-
}
|
|
57
53
|
const directory = options.dir || "tests";
|
|
58
54
|
const suites = options.suites && options.suites.trim() !== ""
|
|
59
55
|
? options.suites?.split(",")
|
|
@@ -70,16 +66,13 @@ function registerRunCommand(program) {
|
|
|
70
66
|
]
|
|
71
67
|
: undefined);
|
|
72
68
|
const environmentSlug = process.env.TEST_RUN_ENVIRONMENT || "";
|
|
73
|
-
const useEnvFilePrecedence = process.env.ENV_FILE_PRECEDENCE === "true";
|
|
74
69
|
const envOverrides = {};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
console.log(`Loaded environment variables: ${Object.keys(envOverrides).join(", ")}`);
|
|
82
|
-
}
|
|
70
|
+
const environmentVariables = await (0, dashboard_1.fetchEnvironmentVariables)();
|
|
71
|
+
environmentVariables.forEach((envVar) => {
|
|
72
|
+
envOverrides[envVar.name] = envVar.value;
|
|
73
|
+
});
|
|
74
|
+
if (Object.keys(envOverrides).length > 0) {
|
|
75
|
+
console.log(`Loaded environment variables: ${Object.keys(envOverrides).join(", ")}`);
|
|
83
76
|
}
|
|
84
77
|
if (environmentSlug) {
|
|
85
78
|
(0, env_files_1.writeEnvFiles)({
|
|
@@ -100,7 +93,7 @@ function registerRunCommand(program) {
|
|
|
100
93
|
let environmentIgnore = [];
|
|
101
94
|
try {
|
|
102
95
|
if (environmentSlug) {
|
|
103
|
-
const environment = await (0, dashboard_1.fetchEnvironment)(
|
|
96
|
+
const environment = await (0, dashboard_1.fetchEnvironment)(environmentSlug);
|
|
104
97
|
if (environment.playwright_projects_match &&
|
|
105
98
|
environment.playwright_projects_match.length > 0) {
|
|
106
99
|
environmentMatch = environment.playwright_projects_match;
|
|
@@ -124,6 +117,11 @@ function registerRunCommand(program) {
|
|
|
124
117
|
if (options.skipTeardown) {
|
|
125
118
|
await (0, utils_1.handleTeardownSkipFlag)(directory, repoDir);
|
|
126
119
|
}
|
|
120
|
+
const grepTags = process.env.GREP_TAGS
|
|
121
|
+
? process.env.GREP_TAGS.split(",")
|
|
122
|
+
.filter(Boolean)
|
|
123
|
+
.map((tag) => (tag.startsWith("@") ? tag : `@${tag}`))
|
|
124
|
+
: [];
|
|
127
125
|
const hasTestsFilter = tests && tests.length > 0;
|
|
128
126
|
let commandToRun;
|
|
129
127
|
if (hasTestsFilter) {
|
|
@@ -140,6 +138,7 @@ function registerRunCommand(program) {
|
|
|
140
138
|
projects: projectFilters,
|
|
141
139
|
passthroughArgs: pwOptions.join(" "),
|
|
142
140
|
envOverrides,
|
|
141
|
+
patternsToGrep: grepTags.length > 0 ? grepTags : undefined,
|
|
143
142
|
});
|
|
144
143
|
}
|
|
145
144
|
const { hasTestPassed } = await (0, cmd_1.runTestsForCmd)(commandToRun, repoDir);
|
package/dist/bin/index.js
CHANGED
|
@@ -6,10 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
|
-
const estimate_time_shard_1 = require("./commands/estimate-time-shard");
|
|
10
9
|
const failed_list_1 = require("./commands/failed-list");
|
|
11
10
|
const merge_1 = require("./commands/merge");
|
|
12
|
-
const optimize_shards_1 = require("./commands/optimize-shards");
|
|
13
11
|
const run_1 = require("./commands/run");
|
|
14
12
|
dotenv_1.default.config({
|
|
15
13
|
path: [".env.local", ".env"],
|
|
@@ -21,6 +19,4 @@ commander_1.program
|
|
|
21
19
|
(0, run_1.registerRunCommand)(commander_1.program);
|
|
22
20
|
(0, merge_1.registerMergeCommand)(commander_1.program);
|
|
23
21
|
(0, failed_list_1.registerFailedListCommand)(commander_1.program);
|
|
24
|
-
(0, estimate_time_shard_1.registerEstimateTimeShardCommand)(commander_1.program);
|
|
25
|
-
(0, optimize_shards_1.registerOptimizeShardsCommand)(commander_1.program);
|
|
26
22
|
commander_1.program.parse(process.argv);
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export type EnvironmentVariable = {
|
|
|
7
7
|
created_at: string;
|
|
8
8
|
updated_at: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const fetchEnvironment: (
|
|
10
|
+
export declare const fetchEnvironment: (environmentSlug: string) => Promise<Environment>;
|
|
11
11
|
export declare const fetchEnvironmentVariables: () => Promise<EnvironmentVariable[]>;
|
|
12
12
|
//# sourceMappingURL=dashboard.d.ts.map
|
package/dist/dashboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,MAAM,KACtB,OAAO,CAAC,WAAW,CAwDrB,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAa,OAAO,CACxD,mBAAmB,EAAE,CAkDtB,CAAC"}
|
package/dist/dashboard.js
CHANGED
|
@@ -5,16 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchEnvironmentVariables = exports.fetchEnvironment = void 0;
|
|
7
7
|
const async_retry_1 = __importDefault(require("async-retry"));
|
|
8
|
-
const utils_1 = require("./utils");
|
|
9
8
|
const DOMAIN = process.env.DASHBOARD_DOMAIN || "https://dash.empirical.run";
|
|
10
|
-
const fetchEnvironment = async (
|
|
11
|
-
const projectRepo = (0, utils_1.buildRepoName)(projectName);
|
|
9
|
+
const fetchEnvironment = async (environmentSlug) => {
|
|
12
10
|
const data = await (0, async_retry_1.default)(async (bail) => {
|
|
13
11
|
if (!process.env.EMPIRICALRUN_API_KEY) {
|
|
14
12
|
console.error("No API token found. Skipping fetch environment from dashboard.");
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
17
|
-
const resp = await fetch(`${DOMAIN}/api/environments/list?
|
|
15
|
+
const resp = await fetch(`${DOMAIN}/api/environments/list?environment_slug=${environmentSlug}&is_disabled=false`, {
|
|
18
16
|
method: "GET",
|
|
19
17
|
headers: {
|
|
20
18
|
"Content-Type": "application/json",
|
|
@@ -27,7 +25,7 @@ const fetchEnvironment = async (projectName, environmentSlug) => {
|
|
|
27
25
|
bail(new Error(erroredResponse?.error?.message));
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
30
|
-
throw new Error(`Failed to fetch environment from dashboard for
|
|
28
|
+
throw new Error(`Failed to fetch environment from dashboard for env slug: ${environmentSlug}`);
|
|
31
29
|
}
|
|
32
30
|
return (await resp.json());
|
|
33
31
|
}, {
|
|
@@ -38,7 +36,7 @@ const fetchEnvironment = async (projectName, environmentSlug) => {
|
|
|
38
36
|
});
|
|
39
37
|
const environment = data?.data?.environments?.find((env) => env.slug === environmentSlug);
|
|
40
38
|
if (!environment) {
|
|
41
|
-
throw new Error(`Failed to fetch environment from dashboard for
|
|
39
|
+
throw new Error(`Failed to fetch environment from dashboard for env slug: ${environmentSlug}.`);
|
|
42
40
|
}
|
|
43
41
|
return environment;
|
|
44
42
|
};
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Normalize a test line for comparison between manifest and ran tests.
|
|
3
|
+
* Strips `:line:col` suffixes from file paths.
|
|
4
|
+
*
|
|
5
|
+
* e.g. `[chromium] › foo/bar.spec.ts:4:5 › has title`
|
|
6
|
+
* → `[chromium] › foo/bar.spec.ts › has title`
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeTestLine(line: string): string;
|
|
9
|
+
export declare function parseTestListLine(line: string): TestList | null;
|
|
10
|
+
/**
|
|
11
|
+
* Runs `npx playwright test --list <file>` and returns all test lines for the file.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAllTestsForFile(file: string, repoPath: string): Promise<string[]>;
|
|
14
|
+
export interface TestList {
|
|
2
15
|
projectName: string;
|
|
3
16
|
file: string;
|
|
4
17
|
title: string;
|
|
5
18
|
suites: string[];
|
|
6
19
|
}
|
|
20
|
+
export interface SerialBlockInfo {
|
|
21
|
+
file: string;
|
|
22
|
+
serialDescribeName: string | null;
|
|
23
|
+
isFileSerial: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function getSerialBlockInfo(test: TestList, repoPath: string, verbose: boolean): Promise<SerialBlockInfo | null>;
|
|
7
26
|
export interface BuildTestListOptions {
|
|
8
27
|
outputPath?: string;
|
|
9
28
|
verbose?: boolean;
|
|
@@ -11,9 +30,13 @@ export interface BuildTestListOptions {
|
|
|
11
30
|
repoPath?: string;
|
|
12
31
|
}
|
|
13
32
|
export interface BuildTestListResult {
|
|
14
|
-
|
|
33
|
+
testsToRun: TestList[];
|
|
15
34
|
testListContent: string;
|
|
16
35
|
outputPath: string;
|
|
17
36
|
}
|
|
37
|
+
export declare function buildTestList(testsToRun: TestList[], allTests: TestList[], options: BuildTestListOptions & {
|
|
38
|
+
verbose: boolean;
|
|
39
|
+
}): Promise<BuildTestListResult>;
|
|
18
40
|
export declare function buildTestListFromFailedTestRun(runId: string, options?: BuildTestListOptions): Promise<BuildTestListResult>;
|
|
41
|
+
export declare function expandSerialDependencies(testListContent: string, outputPath: string, repoPath: string): Promise<string>;
|
|
19
42
|
//# sourceMappingURL=failed-test-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failed-test-list.d.ts","sourceRoot":"","sources":["../src/failed-test-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"failed-test-list.d.ts","sourceRoot":"","sources":["../src/failed-test-list.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAgB/D;AAID;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBnB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAmED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;CACvB;AAoBD,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA+CjC;AA0FD,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AA0DD,wBAAsB,aAAa,CACjC,UAAU,EAAE,QAAQ,EAAE,EACtB,QAAQ,EAAE,QAAQ,EAAE,EACpB,OAAO,EAAE,oBAAoB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACnD,OAAO,CAAC,mBAAmB,CAAC,CA0D9B;AAED,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAa9B;AAED,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAmCjB"}
|
package/dist/failed-test-list.js
CHANGED
|
@@ -3,13 +3,65 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.normalizeTestLine = normalizeTestLine;
|
|
7
|
+
exports.parseTestListLine = parseTestListLine;
|
|
8
|
+
exports.getAllTestsForFile = getAllTestsForFile;
|
|
9
|
+
exports.getSerialBlockInfo = getSerialBlockInfo;
|
|
10
|
+
exports.buildTestList = buildTestList;
|
|
6
11
|
exports.buildTestListFromFailedTestRun = buildTestListFromFailedTestRun;
|
|
12
|
+
exports.expandSerialDependencies = expandSerialDependencies;
|
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
|
14
|
+
const node_util_1 = require("node:util");
|
|
7
15
|
const reporter_1 = require("@empiricalrun/reporter");
|
|
8
16
|
const fs_1 = __importDefault(require("fs"));
|
|
9
17
|
const path_1 = __importDefault(require("path"));
|
|
10
18
|
const utils_1 = require("./utils");
|
|
11
19
|
const DOMAIN = process.env.DASHBOARD_DOMAIN || "https://dash.empirical.run";
|
|
12
20
|
const SUITES_DELIMITER = " › ";
|
|
21
|
+
/**
|
|
22
|
+
* Normalize a test line for comparison between manifest and ran tests.
|
|
23
|
+
* Strips `:line:col` suffixes from file paths.
|
|
24
|
+
*
|
|
25
|
+
* e.g. `[chromium] › foo/bar.spec.ts:4:5 › has title`
|
|
26
|
+
* → `[chromium] › foo/bar.spec.ts › has title`
|
|
27
|
+
*/
|
|
28
|
+
function normalizeTestLine(line) {
|
|
29
|
+
return line.replace(/(\.spec\.ts|\.test\.ts|\.ts|\.js):\d+:\d+/g, "$1");
|
|
30
|
+
}
|
|
31
|
+
function parseTestListLine(line) {
|
|
32
|
+
const trimmed = normalizeTestLine(line.trim());
|
|
33
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
34
|
+
return null;
|
|
35
|
+
const match = trimmed.match(/^\[(.*?)\]\s*[›>]\s*(.*)/);
|
|
36
|
+
if (!match?.[1] || !match[2])
|
|
37
|
+
return null;
|
|
38
|
+
const projectName = match[1];
|
|
39
|
+
const parts = match[2].split(/\s*[›>]\s*/);
|
|
40
|
+
if (parts.length < 2)
|
|
41
|
+
return null;
|
|
42
|
+
const file = parts[0].trim();
|
|
43
|
+
const suites = parts.slice(1, -1);
|
|
44
|
+
const title = parts[parts.length - 1].trim();
|
|
45
|
+
return { projectName, file, suites, title };
|
|
46
|
+
}
|
|
47
|
+
const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
48
|
+
/**
|
|
49
|
+
* Runs `npx playwright test --list <file>` and returns all test lines for the file.
|
|
50
|
+
*/
|
|
51
|
+
async function getAllTestsForFile(file, repoPath) {
|
|
52
|
+
try {
|
|
53
|
+
const playwrightCli = path_1.default.join(repoPath, "node_modules", "@playwright", "test", "cli.js");
|
|
54
|
+
const { stdout } = await execFileAsync("node", [playwrightCli, "test", "--list", file], { cwd: repoPath });
|
|
55
|
+
return stdout
|
|
56
|
+
.split("\n")
|
|
57
|
+
.map((line) => line.trim())
|
|
58
|
+
.filter((line) => line.includes(" › "));
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error(`Failed to list tests for file: ${file}`, error);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
13
65
|
async function fetchTestRun(runId, options) {
|
|
14
66
|
if (!process.env.EMPIRICALRUN_API_KEY) {
|
|
15
67
|
throw new Error("EMPIRICALRUN_API_KEY environment variable is required");
|
|
@@ -45,8 +97,12 @@ function getFailedTests(specs) {
|
|
|
45
97
|
const failedTests = [];
|
|
46
98
|
for (const spec of specs) {
|
|
47
99
|
for (const test of spec.tests) {
|
|
48
|
-
const
|
|
49
|
-
|
|
100
|
+
const retries = test.results.map((r) => ({
|
|
101
|
+
status: r.status ?? "unknown",
|
|
102
|
+
expectedStatus: test.expectedStatus,
|
|
103
|
+
}));
|
|
104
|
+
const status = (0, reporter_1.getTestStatusFromRetries)(retries);
|
|
105
|
+
if (status === "failed") {
|
|
50
106
|
const suites = spec.nesting.slice(1, -1);
|
|
51
107
|
failedTests.push({
|
|
52
108
|
projectName: test.projectName,
|
|
@@ -141,17 +197,12 @@ function isTestInSerialBlock(test, serialBlock) {
|
|
|
141
197
|
}
|
|
142
198
|
return false;
|
|
143
199
|
}
|
|
144
|
-
function generateTestListContent(
|
|
145
|
-
const lines = [
|
|
146
|
-
`# Failed tests from test run`,
|
|
147
|
-
`# Generated: ${new Date().toISOString()}`,
|
|
148
|
-
`# Total failed tests: ${failedTests.length}`,
|
|
149
|
-
"",
|
|
150
|
-
];
|
|
200
|
+
function generateTestListContent(testsToRun, allTests, serialBlocks = []) {
|
|
201
|
+
const lines = [];
|
|
151
202
|
const addedEntries = new Set();
|
|
152
203
|
for (const serialBlock of serialBlocks) {
|
|
153
204
|
const projectNames = [
|
|
154
|
-
...new Set(
|
|
205
|
+
...new Set(testsToRun
|
|
155
206
|
.filter((t) => t.file === serialBlock.file)
|
|
156
207
|
.map((t) => t.projectName)),
|
|
157
208
|
];
|
|
@@ -166,7 +217,7 @@ function generateTestListContent(failedTests, allTests, serialBlocks = []) {
|
|
|
166
217
|
}
|
|
167
218
|
}
|
|
168
219
|
}
|
|
169
|
-
for (const test of
|
|
220
|
+
for (const test of testsToRun) {
|
|
170
221
|
const isInSerialBlock = serialBlocks.some((s) => s.file === test.file);
|
|
171
222
|
if (!isInSerialBlock) {
|
|
172
223
|
const line = formatTestListLine(test);
|
|
@@ -178,8 +229,8 @@ function generateTestListContent(failedTests, allTests, serialBlocks = []) {
|
|
|
178
229
|
}
|
|
179
230
|
return lines.join("\n");
|
|
180
231
|
}
|
|
181
|
-
async function
|
|
182
|
-
const verbose = options
|
|
232
|
+
async function fetchFailedTestList(runId, options) {
|
|
233
|
+
const { verbose } = options;
|
|
183
234
|
const testRunResponse = await fetchTestRun(runId, {
|
|
184
235
|
verbose,
|
|
185
236
|
repoName: options.repoName,
|
|
@@ -214,12 +265,16 @@ async function buildTestListFromFailedTestRun(runId, options = {}) {
|
|
|
214
265
|
if (verbose) {
|
|
215
266
|
console.log(`Found ${failedTests.length} failed tests, ${allTests.length} total tests`);
|
|
216
267
|
}
|
|
268
|
+
return { failedTests, allTests };
|
|
269
|
+
}
|
|
270
|
+
async function buildTestList(testsToRun, allTests, options) {
|
|
271
|
+
const { verbose } = options;
|
|
217
272
|
const serialBlocks = [];
|
|
218
273
|
if (options.repoPath) {
|
|
219
274
|
if (verbose) {
|
|
220
275
|
console.log(`Checking for serial blocks in repo: ${options.repoPath}`);
|
|
221
276
|
}
|
|
222
|
-
for (const test of
|
|
277
|
+
for (const test of testsToRun) {
|
|
223
278
|
try {
|
|
224
279
|
const serialInfo = await getSerialBlockInfo(test, options.repoPath, verbose);
|
|
225
280
|
if (serialInfo) {
|
|
@@ -241,16 +296,59 @@ async function buildTestListFromFailedTestRun(runId, options = {}) {
|
|
|
241
296
|
console.log(`Found ${serialBlocks.length} serial blocks to expand`);
|
|
242
297
|
}
|
|
243
298
|
}
|
|
244
|
-
const testListContent = generateTestListContent(
|
|
245
|
-
const outputPath = options.outputPath || path_1.default.join(process.cwd(),
|
|
299
|
+
const testListContent = generateTestListContent(testsToRun, allTests, serialBlocks);
|
|
300
|
+
const outputPath = options.outputPath || path_1.default.join(process.cwd(), "failed-tests.txt");
|
|
246
301
|
const outputDir = path_1.default.dirname(outputPath);
|
|
247
302
|
if (!fs_1.default.existsSync(outputDir)) {
|
|
248
303
|
fs_1.default.mkdirSync(outputDir, { recursive: true });
|
|
249
304
|
}
|
|
250
305
|
fs_1.default.writeFileSync(outputPath, testListContent, "utf-8");
|
|
251
306
|
return {
|
|
252
|
-
|
|
307
|
+
testsToRun,
|
|
253
308
|
testListContent,
|
|
254
309
|
outputPath,
|
|
255
310
|
};
|
|
256
311
|
}
|
|
312
|
+
async function buildTestListFromFailedTestRun(runId, options = {}) {
|
|
313
|
+
const verbose = options.verbose ?? false;
|
|
314
|
+
const { failedTests, allTests } = await fetchFailedTestList(runId, {
|
|
315
|
+
verbose,
|
|
316
|
+
repoName: options.repoName,
|
|
317
|
+
});
|
|
318
|
+
return buildTestList(failedTests, allTests, {
|
|
319
|
+
...options,
|
|
320
|
+
verbose,
|
|
321
|
+
outputPath: options.outputPath ||
|
|
322
|
+
path_1.default.join(process.cwd(), `failed-tests-${runId}.txt`),
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
async function expandSerialDependencies(testListContent, outputPath, repoPath) {
|
|
326
|
+
const lines = testListContent.split("\n");
|
|
327
|
+
const testsToRun = [];
|
|
328
|
+
for (const line of lines) {
|
|
329
|
+
const parsed = parseTestListLine(line);
|
|
330
|
+
if (parsed)
|
|
331
|
+
testsToRun.push(parsed);
|
|
332
|
+
}
|
|
333
|
+
if (testsToRun.length === 0) {
|
|
334
|
+
console.log("testListContent could not be parsed. Returning original tests");
|
|
335
|
+
fs_1.default.writeFileSync(outputPath, testListContent, "utf-8");
|
|
336
|
+
return testListContent;
|
|
337
|
+
}
|
|
338
|
+
const uniqueFiles = [...new Set(testsToRun.map((t) => t.file))];
|
|
339
|
+
const allTests = [];
|
|
340
|
+
for (const file of uniqueFiles) {
|
|
341
|
+
const allLines = await getAllTestsForFile(file, repoPath);
|
|
342
|
+
for (const line of allLines) {
|
|
343
|
+
const parsed = parseTestListLine(line);
|
|
344
|
+
if (parsed)
|
|
345
|
+
allTests.push(parsed);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const result = await buildTestList(testsToRun, allTests, {
|
|
349
|
+
repoPath,
|
|
350
|
+
outputPath,
|
|
351
|
+
verbose: false,
|
|
352
|
+
});
|
|
353
|
+
return result.testListContent;
|
|
354
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,8 @@ import { parseTestListOutput } from "./stdout-parser";
|
|
|
5
5
|
import { TestCase } from "./types";
|
|
6
6
|
import { getProjectsFromPlaywrightConfig } from "./utils/config";
|
|
7
7
|
export { getProjectsFromPlaywrightConfig, parseTestListOutput, runSpecificTestsCmd, spawnCmd, };
|
|
8
|
-
export { type BuildTestListOptions, type BuildTestListResult, buildTestListFromFailedTestRun, type
|
|
8
|
+
export { type BuildTestListOptions, type BuildTestListResult, buildTestList, buildTestListFromFailedTestRun, expandSerialDependencies, getAllTestsForFile, normalizeTestLine, parseTestListLine, type TestList, } from "./failed-test-list";
|
|
9
9
|
export * from "./glob-matcher";
|
|
10
|
-
export { type CancellationWatcher, startCancellationWatcher, } from "./lib/cancellation-watcher";
|
|
11
10
|
export { filterArrayByGlobMatchersSet, generateProjectFilters, generateProjectFiltersV2, } from "./utils";
|
|
12
11
|
export declare function runSingleTest({ testName, suites, filePath, projects, envOverrides, repoDir, stdout, stderr, }: {
|
|
13
12
|
testName: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAI/E,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,GACT,CAAC;AACF,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,8BAA8B,EAC9B,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAI/E,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,GACT,CAAC;AACF,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,aAAa,EACb,8BAA8B,EAC9B,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,QAAQ,GACd,MAAM,oBAAoB,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAQjB,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,MAAM,EACN,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAChC,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC,CAmBD;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACjD,CAAC,CAeD"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.generateProjectFiltersV2 = exports.generateProjectFilters = exports.filterArrayByGlobMatchersSet = exports.
|
|
20
|
+
exports.generateProjectFiltersV2 = exports.generateProjectFilters = exports.filterArrayByGlobMatchersSet = exports.parseTestListLine = exports.normalizeTestLine = exports.getAllTestsForFile = exports.expandSerialDependencies = exports.buildTestListFromFailedTestRun = exports.buildTestList = exports.spawnCmd = exports.runSpecificTestsCmd = exports.parseTestListOutput = exports.getProjectsFromPlaywrightConfig = void 0;
|
|
21
21
|
exports.runSingleTest = runSingleTest;
|
|
22
22
|
exports.listProjectsAndTests = listProjectsAndTests;
|
|
23
23
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -31,10 +31,13 @@ Object.defineProperty(exports, "parseTestListOutput", { enumerable: true, get: f
|
|
|
31
31
|
const config_1 = require("./utils/config");
|
|
32
32
|
Object.defineProperty(exports, "getProjectsFromPlaywrightConfig", { enumerable: true, get: function () { return config_1.getProjectsFromPlaywrightConfig; } });
|
|
33
33
|
var failed_test_list_1 = require("./failed-test-list");
|
|
34
|
+
Object.defineProperty(exports, "buildTestList", { enumerable: true, get: function () { return failed_test_list_1.buildTestList; } });
|
|
34
35
|
Object.defineProperty(exports, "buildTestListFromFailedTestRun", { enumerable: true, get: function () { return failed_test_list_1.buildTestListFromFailedTestRun; } });
|
|
36
|
+
Object.defineProperty(exports, "expandSerialDependencies", { enumerable: true, get: function () { return failed_test_list_1.expandSerialDependencies; } });
|
|
37
|
+
Object.defineProperty(exports, "getAllTestsForFile", { enumerable: true, get: function () { return failed_test_list_1.getAllTestsForFile; } });
|
|
38
|
+
Object.defineProperty(exports, "normalizeTestLine", { enumerable: true, get: function () { return failed_test_list_1.normalizeTestLine; } });
|
|
39
|
+
Object.defineProperty(exports, "parseTestListLine", { enumerable: true, get: function () { return failed_test_list_1.parseTestListLine; } });
|
|
35
40
|
__exportStar(require("./glob-matcher"), exports);
|
|
36
|
-
var cancellation_watcher_1 = require("./lib/cancellation-watcher");
|
|
37
|
-
Object.defineProperty(exports, "startCancellationWatcher", { enumerable: true, get: function () { return cancellation_watcher_1.startCancellationWatcher; } });
|
|
38
41
|
var utils_1 = require("./utils");
|
|
39
42
|
Object.defineProperty(exports, "filterArrayByGlobMatchersSet", { enumerable: true, get: function () { return utils_1.filterArrayByGlobMatchersSet; } });
|
|
40
43
|
Object.defineProperty(exports, "generateProjectFilters", { enumerable: true, get: function () { return utils_1.generateProjectFilters; } });
|
package/dist/lib/cmd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAeA;AAED,wBAAsB,cAAc,CAClC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,YAAY,EACpC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;CAChC;;;GAqBF;AAED,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;CACxC,GACA,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAiD5C"}
|
package/dist/lib/cmd.js
CHANGED
|
@@ -5,7 +5,6 @@ exports.runTestsForCmd = runTestsForCmd;
|
|
|
5
5
|
exports.spawnCmd = spawnCmd;
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
|
-
const cancellation_watcher_1 = require("./cancellation-watcher");
|
|
9
8
|
function getCommandFromString(command) {
|
|
10
9
|
const regex = /[^\s"']+|"([^"]*)"|'([^']*)'/g;
|
|
11
10
|
const matches = command.match(regex) || [];
|
|
@@ -22,37 +21,8 @@ function getCommandFromString(command) {
|
|
|
22
21
|
}
|
|
23
22
|
async function runTestsForCmd({ command, args, env }, cwd, options) {
|
|
24
23
|
logger_1.logger.debug(`Running cmd: ${command} with args: ${args}`);
|
|
25
|
-
const testRunId = process.env.TEST_RUN_GITHUB_ACTION_ID;
|
|
26
|
-
const apiKey = process.env.EMPIRICALRUN_API_KEY;
|
|
27
|
-
console.log(`[CancellationWatcher] Environment: TEST_RUN_GITHUB_ACTION_ID=${testRunId}, EMPIRICALRUN_API_KEY=${apiKey ? "***" : "undefined"}`);
|
|
28
24
|
let hasTestPassed = true;
|
|
29
25
|
let wasCancelled = false;
|
|
30
|
-
let cancellationWatcher;
|
|
31
|
-
let childProcess;
|
|
32
|
-
const cancelHandler = () => {
|
|
33
|
-
wasCancelled = true;
|
|
34
|
-
console.log(`[CancellationWatcher] Cancel handler invoked, killing child process (pid: ${childProcess?.pid})`);
|
|
35
|
-
if (childProcess && !childProcess.killed) {
|
|
36
|
-
// Use SIGTERM for more forceful termination that propagates to child processes
|
|
37
|
-
childProcess.kill("SIGTERM");
|
|
38
|
-
// Also try to kill the process group to ensure Playwright workers are stopped
|
|
39
|
-
if (childProcess.pid) {
|
|
40
|
-
try {
|
|
41
|
-
process.kill(-childProcess.pid, "SIGTERM");
|
|
42
|
-
console.log(`[CancellationWatcher] Sent SIGTERM to process group ${childProcess.pid}`);
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
// Process group kill may fail if not a group leader
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
if (testRunId && apiKey) {
|
|
51
|
-
cancellationWatcher = (0, cancellation_watcher_1.startCancellationWatcher)(testRunId, apiKey, cancelHandler);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
console.log("[CancellationWatcher] Not starting watcher - missing testRunId or apiKey");
|
|
55
|
-
}
|
|
56
26
|
try {
|
|
57
27
|
await spawnCmd(command, args, {
|
|
58
28
|
cwd,
|
|
@@ -61,17 +31,11 @@ async function runTestsForCmd({ command, args, env }, cwd, options) {
|
|
|
61
31
|
throwOnError: true,
|
|
62
32
|
stdout: options?.stdout,
|
|
63
33
|
stderr: options?.stderr,
|
|
64
|
-
onSpawn: (proc) => {
|
|
65
|
-
childProcess = proc;
|
|
66
|
-
},
|
|
67
34
|
});
|
|
68
35
|
}
|
|
69
36
|
catch {
|
|
70
37
|
hasTestPassed = false;
|
|
71
38
|
}
|
|
72
|
-
finally {
|
|
73
|
-
cancellationWatcher?.stop();
|
|
74
|
-
}
|
|
75
39
|
return { hasTestPassed, wasCancelled };
|
|
76
40
|
}
|
|
77
41
|
async function spawnCmd(command, args, options) {
|
|
@@ -122,9 +86,16 @@ async function spawnCmd(command, args, options) {
|
|
|
122
86
|
function setupProcessSignalHandlers(proc) {
|
|
123
87
|
const handleSignal = async (signal) => {
|
|
124
88
|
logger_1.logger.debug(`\nReceived ${signal}, gracefully shutting down...`);
|
|
125
|
-
if (proc && !proc.killed) {
|
|
126
|
-
// Forward the signal to the
|
|
127
|
-
|
|
89
|
+
if (proc && !proc.killed && proc.pid) {
|
|
90
|
+
// Forward the signal to the entire process group so all children
|
|
91
|
+
// (including Playwright workers and reporters) receive it
|
|
92
|
+
try {
|
|
93
|
+
process.kill(-proc.pid, signal);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Process group may have already exited
|
|
97
|
+
proc.kill(signal);
|
|
98
|
+
}
|
|
128
99
|
// Wait for the child process to exit
|
|
129
100
|
await new Promise((resolve) => {
|
|
130
101
|
proc.once("exit", () => {
|
|
@@ -6,7 +6,10 @@ export declare function runPlaywrightMergeReports(options: MergeReportsOptions):
|
|
|
6
6
|
success: boolean;
|
|
7
7
|
}>;
|
|
8
8
|
export declare function extractUrlMappingsFromBlobs(blobDir: string): Promise<Record<string, string>>;
|
|
9
|
-
export declare function uploadMergedReports(
|
|
9
|
+
export declare function uploadMergedReports({ outputDir, uploadOptions, }: {
|
|
10
|
+
outputDir: string;
|
|
11
|
+
uploadOptions: UploadOptions;
|
|
12
|
+
}): Promise<void>;
|
|
10
13
|
export declare function mergeReports(options: {
|
|
11
14
|
blobDir?: string;
|
|
12
15
|
cwd?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/merge-reports/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA0DlE,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/merge-reports/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA0DlE,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAsC/B;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoCjC;AAED,wBAAsB,mBAAmB,CAAC,EACxC,SAAS,EACT,aAAa,GACd,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;CAC9B,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDhB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAgFhC"}
|