@crvy/rprtr 0.2.3 → 0.3.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 +41 -0
- package/README.md +33 -0
- package/dist/{chunk-HAFWYUNO.js → chunk-4YJL655E.js} +16 -4
- package/dist/{chunk-473CWZ4V.js → chunk-IFHYWPXG.js} +710 -281
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +57 -6
- package/dist/index.css +7 -0
- package/dist/index.js +152 -105
- package/dist/reporter-artifact-ops.d.ts +0 -2
- package/dist/reporter-artifact-ops.d.ts.map +1 -1
- package/dist/reporter.cjs +32 -38
- package/dist/reporter.d.ts +2 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +27 -43
- package/dist/schemas/http.d.ts +2 -0
- package/dist/schemas/http.d.ts.map +1 -1
- package/dist/schemas.d.ts +14 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/server/app.d.ts +6 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/artifact-routes.d.ts.map +1 -1
- package/dist/server/docker-launcher.d.ts +27 -0
- package/dist/server/docker-launcher.d.ts.map +1 -0
- package/dist/server/docker-support.d.ts +66 -0
- package/dist/server/docker-support.d.ts.map +1 -0
- package/dist/server/handlers.d.ts +1 -1
- package/dist/server/handlers.d.ts.map +1 -1
- package/dist/server/launcher-resolver.d.ts +23 -0
- package/dist/server/launcher-resolver.d.ts.map +1 -0
- package/dist/server/playwright-config.d.ts +6 -0
- package/dist/server/playwright-config.d.ts.map +1 -1
- package/dist/server/routes-context.d.ts +6 -1
- package/dist/server/routes-context.d.ts.map +1 -1
- package/dist/server/routes.d.ts +7 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/run-controller.d.ts +19 -19
- package/dist/server/run-controller.d.ts.map +1 -1
- package/dist/server/run-launcher.d.ts +45 -0
- package/dist/server/run-launcher.d.ts.map +1 -0
- package/dist/server/run-mode.d.ts +15 -0
- package/dist/server/run-mode.d.ts.map +1 -0
- package/dist/server/server-factories.d.ts +21 -0
- package/dist/server/server-factories.d.ts.map +1 -0
- package/dist/server.cjs +885 -446
- package/dist/server.js +2 -2
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/reporter.cjs
CHANGED
|
@@ -55,6 +55,7 @@ var logError = (...args) => {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
// src/reporter-artifact-ops.ts
|
|
58
|
+
var import_crypto = require("crypto");
|
|
58
59
|
var import_promises2 = require("fs/promises");
|
|
59
60
|
var import_path2 = require("path");
|
|
60
61
|
var import_p_limit = __toESM(require("p-limit"), 1);
|
|
@@ -292,13 +293,14 @@ var RunTestDescriptorSchema = import_zod.z.object({
|
|
|
292
293
|
titlePath: import_zod.z.array(import_zod.z.string())
|
|
293
294
|
});
|
|
294
295
|
var RunRequestBodySchema = import_zod.z.object({
|
|
295
|
-
tests: import_zod.z.array(RunTestDescriptorSchema).optional()
|
|
296
|
+
tests: import_zod.z.array(RunTestDescriptorSchema).optional(),
|
|
297
|
+
update: import_zod.z.boolean().optional()
|
|
296
298
|
});
|
|
297
299
|
var RunResponseSchema = import_zod.z.discriminatedUnion("ok", [
|
|
298
300
|
import_zod.z.object({ ok: import_zod.z.literal(true) }),
|
|
299
301
|
import_zod.z.object({
|
|
300
302
|
ok: import_zod.z.literal(false),
|
|
301
|
-
reason: import_zod.z.enum(["no-config", "already-running", "no-tests"])
|
|
303
|
+
reason: import_zod.z.enum(["no-config", "already-running", "no-tests", "docker-unavailable"])
|
|
302
304
|
})
|
|
303
305
|
]);
|
|
304
306
|
var StopResponseSchema = import_zod.z.discriminatedUnion("ok", [
|
|
@@ -405,7 +407,9 @@ var WebSocketMessageSchema = import_zod2.z.discriminatedUnion("type", [
|
|
|
405
407
|
import_zod2.z.object({
|
|
406
408
|
type: import_zod2.z.literal("run-status"),
|
|
407
409
|
data: import_zod2.z.object({
|
|
408
|
-
running: import_zod2.z.boolean()
|
|
410
|
+
running: import_zod2.z.boolean(),
|
|
411
|
+
mode: import_zod2.z.enum(["local", "docker"]).optional(),
|
|
412
|
+
phase: import_zod2.z.string().optional()
|
|
409
413
|
})
|
|
410
414
|
})
|
|
411
415
|
]);
|
|
@@ -435,6 +439,7 @@ var RunEndDataSchema = import_zod2.z.object({
|
|
|
435
439
|
var RegisterDataSchema = import_zod2.z.object({
|
|
436
440
|
playwrightSnapshotDir: import_zod2.z.string().optional(),
|
|
437
441
|
playwrightTestDir: import_zod2.z.string().optional(),
|
|
442
|
+
playwrightRootDir: import_zod2.z.string().optional(),
|
|
438
443
|
playwrightSnapshotPathTemplate: import_zod2.z.string().optional(),
|
|
439
444
|
playwrightToHaveScreenshotPathTemplate: import_zod2.z.string().optional(),
|
|
440
445
|
configFile: import_zod2.z.string().optional(),
|
|
@@ -467,7 +472,8 @@ var ReportApiResponseSchema = import_zod2.z.object({
|
|
|
467
472
|
tests: import_zod2.z.record(import_zod2.z.string(), TestDataSchema),
|
|
468
473
|
isUpdateMode: import_zod2.z.boolean().optional(),
|
|
469
474
|
isRunning: import_zod2.z.boolean().optional(),
|
|
470
|
-
runEnabled: import_zod2.z.boolean().optional()
|
|
475
|
+
runEnabled: import_zod2.z.boolean().optional(),
|
|
476
|
+
runMode: import_zod2.z.enum(["local", "docker"]).optional()
|
|
471
477
|
});
|
|
472
478
|
var ClientBootstrapDataSchema = import_zod2.z.object({
|
|
473
479
|
report: ReportApiResponseSchema.extend({
|
|
@@ -608,32 +614,22 @@ async function writeReportArtifact(options) {
|
|
|
608
614
|
}
|
|
609
615
|
|
|
610
616
|
// src/reporter-artifact-ops.ts
|
|
611
|
-
var CURRENT_DIRECTORY_ARTIFACT_SEGMENT = "+dot+";
|
|
612
|
-
var PARENT_DIRECTORY_ARTIFACT_SEGMENT = "+dotdot+";
|
|
613
617
|
var MAX_CONCURRENT_FILE_OPS = 5;
|
|
614
|
-
var SAFE_ARTIFACT_CHARACTER = /^[A-Za-z0-9._-]$/;
|
|
615
|
-
function encodeArtifactPathSegment(segment) {
|
|
616
|
-
if (segment === ".") return CURRENT_DIRECTORY_ARTIFACT_SEGMENT;
|
|
617
|
-
if (segment === "..") return PARENT_DIRECTORY_ARTIFACT_SEGMENT;
|
|
618
|
-
return Array.from(
|
|
619
|
-
segment,
|
|
620
|
-
(character) => SAFE_ARTIFACT_CHARACTER.test(character) ? character : encodeURIComponent(character)
|
|
621
|
-
).join("");
|
|
622
|
-
}
|
|
623
|
-
function safeArtifactPath(name) {
|
|
624
|
-
return name.split("/").map(encodeArtifactPathSegment).join("/");
|
|
625
|
-
}
|
|
626
618
|
function sanitizeId(id) {
|
|
627
619
|
return id.replace(/[^a-zA-Z0-9-_]/g, "_");
|
|
628
620
|
}
|
|
621
|
+
async function writeContentAddressedCopy(sourcePath, destDir) {
|
|
622
|
+
const contents = await (0, import_promises2.readFile)(sourcePath);
|
|
623
|
+
const artifactName = `${(0, import_crypto.createHash)("sha1").update(contents).digest("hex")}${(0, import_path2.extname)(sourcePath) || ".png"}`;
|
|
624
|
+
await (0, import_promises2.mkdir)(destDir, { recursive: true });
|
|
625
|
+
await (0, import_promises2.writeFile)((0, import_path2.join)(destDir, artifactName), contents);
|
|
626
|
+
return artifactName;
|
|
627
|
+
}
|
|
629
628
|
async function copyResolvedBaseline(safeTestId, testScreenshotDir, target, savedAttachments) {
|
|
630
629
|
const attachmentName = `${target.attachmentBaseName}-expected.png`;
|
|
631
|
-
const artifactPath = safeArtifactPath(attachmentName);
|
|
632
|
-
const destPath = (0, import_path2.join)(testScreenshotDir, artifactPath);
|
|
633
630
|
try {
|
|
634
|
-
await (
|
|
635
|
-
|
|
636
|
-
savedAttachments.push({ name: attachmentName, path: `${safeTestId}/${artifactPath}`, contentType: "image/png" });
|
|
631
|
+
const artifactName = await writeContentAddressedCopy(target.snapshotPath, testScreenshotDir);
|
|
632
|
+
savedAttachments.push({ name: attachmentName, path: `${safeTestId}/${artifactName}`, contentType: "image/png" });
|
|
637
633
|
log(`[CrvyRprtr] Attached baseline: ${target.snapshotPath}`);
|
|
638
634
|
} catch {
|
|
639
635
|
}
|
|
@@ -649,16 +645,13 @@ async function saveAttachments(screenshotDir, testId, result) {
|
|
|
649
645
|
).map(
|
|
650
646
|
(attachment) => limit(async () => {
|
|
651
647
|
try {
|
|
652
|
-
const
|
|
653
|
-
const destPath = (0, import_path2.join)(testScreenshotDir, artifactPath);
|
|
654
|
-
await (0, import_promises2.mkdir)((0, import_path2.dirname)(destPath), { recursive: true });
|
|
655
|
-
await (0, import_promises2.copyFile)(attachment.path, destPath);
|
|
648
|
+
const artifactName = await writeContentAddressedCopy(attachment.path, testScreenshotDir);
|
|
656
649
|
savedAttachments.push({
|
|
657
650
|
name: attachment.name,
|
|
658
|
-
path: `${safeTestId}/${
|
|
651
|
+
path: `${safeTestId}/${artifactName}`,
|
|
659
652
|
contentType: attachment.contentType ?? "image/png"
|
|
660
653
|
});
|
|
661
|
-
log(`[CrvyRprtr] Saved screenshot: ${
|
|
654
|
+
log(`[CrvyRprtr] Saved screenshot: ${(0, import_path2.join)(testScreenshotDir, artifactName)}`);
|
|
662
655
|
} catch (error) {
|
|
663
656
|
logError(`[CrvyRprtr] Failed to save screenshot: ${attachment.path}`, error);
|
|
664
657
|
savedAttachments.push({
|
|
@@ -780,7 +773,7 @@ function extractScreenshotDeclarations(steps) {
|
|
|
780
773
|
}
|
|
781
774
|
|
|
782
775
|
// src/snapshot-path-resolver.ts
|
|
783
|
-
var
|
|
776
|
+
var import_crypto2 = require("crypto");
|
|
784
777
|
var import_path3 = require("path");
|
|
785
778
|
var DEFAULT_SCREENSHOT_TEMPLATE = "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{-projectName}{-snapshotSuffix}{ext}";
|
|
786
779
|
var WINDOWS_FILESYSTEM_FRIENDLY_LENGTH = 60;
|
|
@@ -810,7 +803,7 @@ function trimLongString(value, length = WINDOWS_FILESYSTEM_FRIENDLY_LENGTH) {
|
|
|
810
803
|
if (value.length <= length) {
|
|
811
804
|
return value;
|
|
812
805
|
}
|
|
813
|
-
const hash = (0,
|
|
806
|
+
const hash = (0, import_crypto2.createHash)("sha1").update(value).digest("hex");
|
|
814
807
|
const middle = `-${hash.slice(0, 5)}-`;
|
|
815
808
|
const start = Math.floor((length - middle.length) / 2);
|
|
816
809
|
const end = length - middle.length - start;
|
|
@@ -967,6 +960,7 @@ var CrvyRprtr = class {
|
|
|
967
960
|
isOfflineMode = false;
|
|
968
961
|
runEvents = [];
|
|
969
962
|
ci;
|
|
963
|
+
portableArtifacts = process.env.CRVY_RPRTR_PORTABLE_ARTIFACTS === "1";
|
|
970
964
|
pendingArtifacts = [];
|
|
971
965
|
constructor(options = {}) {
|
|
972
966
|
this.serverUrl = options.serverUrl ?? process.env.CRVY_RPRTR_SERVER_URL ?? "ws://localhost:3000";
|
|
@@ -1029,10 +1023,11 @@ var CrvyRprtr = class {
|
|
|
1029
1023
|
data: {
|
|
1030
1024
|
playwrightSnapshotDir: typeof snapshotDir === "string" ? snapshotDir : void 0,
|
|
1031
1025
|
playwrightTestDir: typeof testDir === "string" ? testDir : void 0,
|
|
1026
|
+
playwrightRootDir: typeof config.rootDir === "string" ? config.rootDir : void 0,
|
|
1032
1027
|
playwrightSnapshotPathTemplate: this.playwrightSnapshotPathTemplate,
|
|
1033
1028
|
playwrightToHaveScreenshotPathTemplate: this.playwrightToHaveScreenshotPathTemplate,
|
|
1034
1029
|
configFile: config.configFile,
|
|
1035
|
-
cwd: config.
|
|
1030
|
+
cwd: config.configFile === void 0 ? process.cwd() : (0, import_path4.dirname)(config.configFile)
|
|
1036
1031
|
}
|
|
1037
1032
|
});
|
|
1038
1033
|
}
|
|
@@ -1048,11 +1043,7 @@ var CrvyRprtr = class {
|
|
|
1048
1043
|
resolveBrowserLabel(project) {
|
|
1049
1044
|
const name = project?.name;
|
|
1050
1045
|
if (name !== void 0 && name !== "") return name;
|
|
1051
|
-
|
|
1052
|
-
if (browserName !== void 0) return browserName;
|
|
1053
|
-
const defaultBrowserType = project?.use?.defaultBrowserType;
|
|
1054
|
-
if (defaultBrowserType !== void 0) return defaultBrowserType;
|
|
1055
|
-
return "chromium";
|
|
1046
|
+
return project?.use?.browserName ?? project?.use?.defaultBrowserType ?? "chromium";
|
|
1056
1047
|
}
|
|
1057
1048
|
reporterTitlePath(test) {
|
|
1058
1049
|
return typeof test.titlePath === "function" ? test.titlePath() : ["", test.parent.project()?.name ?? "", test.location.file, ...this.describeTitlePath(test), test.title];
|
|
@@ -1074,7 +1065,7 @@ var CrvyRprtr = class {
|
|
|
1074
1065
|
}
|
|
1075
1066
|
});
|
|
1076
1067
|
}
|
|
1077
|
-
onTestEnd(test, result) {
|
|
1068
|
+
async onTestEnd(test, result) {
|
|
1078
1069
|
const reporterTitlePath = this.testMetadata.get(test.id)?.reporterTitlePath ?? this.reporterTitlePath(test);
|
|
1079
1070
|
const screenshotDeclarations = withResolvedVisualNames(
|
|
1080
1071
|
extractScreenshotDeclarations(result.steps),
|
|
@@ -1102,6 +1093,9 @@ var CrvyRprtr = class {
|
|
|
1102
1093
|
nativeAttachments,
|
|
1103
1094
|
eventData: data
|
|
1104
1095
|
});
|
|
1096
|
+
} else if (this.portableArtifacts) {
|
|
1097
|
+
await (0, import_promises3.mkdir)(this.screenshotDir, { recursive: true });
|
|
1098
|
+
data.attachments = await saveAttachments(this.screenshotDir, test.id, { attachments: nativeAttachments });
|
|
1105
1099
|
}
|
|
1106
1100
|
this.send({ type: "test-end", data });
|
|
1107
1101
|
} finally {
|
package/dist/reporter.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare class CrvyRprtr implements Reporter {
|
|
|
17
17
|
private isOfflineMode;
|
|
18
18
|
private runEvents;
|
|
19
19
|
private readonly ci;
|
|
20
|
+
private readonly portableArtifacts;
|
|
20
21
|
private pendingArtifacts;
|
|
21
22
|
constructor(options?: CrvyRprtrOptions);
|
|
22
23
|
onBegin(config: FullConfig, suite: Suite): void;
|
|
@@ -30,7 +31,7 @@ export declare class CrvyRprtr implements Reporter {
|
|
|
30
31
|
private resolveBrowserLabel;
|
|
31
32
|
private reporterTitlePath;
|
|
32
33
|
onTestBegin(test: TestCase): void;
|
|
33
|
-
onTestEnd(test: TestCase, result: TestResult): void
|
|
34
|
+
onTestEnd(test: TestCase, result: TestResult): Promise<void>;
|
|
34
35
|
private baselineInput;
|
|
35
36
|
private copyBaselinesForTargets;
|
|
36
37
|
onEnd(result: FullResult): Promise<void>;
|
package/dist/reporter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAA;AAalC,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAA;AAS9B,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC,qBAAa,SAAU,YAAW,QAAQ;IACxC,OAAO,CAAC,EAAE,CAAyB;IACnC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,YAAY,CAAqD;IACzE,OAAO,CAAC,qBAAqB,CAAC,CAAQ;IACtC,OAAO,CAAC,8BAA8B,CAAC,CAAQ;IAC/C,OAAO,CAAC,sCAAsC,CAAC,CAAQ;IACvD,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAS;IAC5B,OAAO,CAAC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O,CAAC,OAAO;IA4Bf,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,iBAAiB;IAOzB;;6EAEyE;IACzE,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,iBAAiB;IAOzB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAkB3B,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAsClE,OAAO,CAAC,aAAa;YAqBP,uBAAuB;IAgB/B,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC9C,OAAO,CAAC,IAAI;CAUb;AACD,eAAe,SAAS,CAAA"}
|
package/dist/reporter.js
CHANGED
|
@@ -6,23 +6,18 @@ import {
|
|
|
6
6
|
applyTestEndEvent,
|
|
7
7
|
createMutableReportState,
|
|
8
8
|
finalizeRunEvent,
|
|
9
|
+
isCI,
|
|
9
10
|
resolveBaselineTargets,
|
|
10
11
|
safeParse,
|
|
11
12
|
withResolvedVisualNames
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4YJL655E.js";
|
|
13
14
|
|
|
14
15
|
// src/reporter.ts
|
|
15
16
|
import { existsSync } from "fs";
|
|
16
17
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
17
|
-
import { dirname as
|
|
18
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
18
19
|
import pLimit2 from "p-limit";
|
|
19
20
|
|
|
20
|
-
// src/ci.ts
|
|
21
|
-
function isCI(env = process.env) {
|
|
22
|
-
const ci = env.CI;
|
|
23
|
-
return ci !== void 0 && ci !== "" && ci !== "false" && ci !== "0";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
21
|
// src/debug-log.ts
|
|
27
22
|
var isDebug = () => process.env.DEBUG !== void 0 && process.env.DEBUG !== "";
|
|
28
23
|
var log = (...args) => {
|
|
@@ -33,8 +28,9 @@ var logError = (...args) => {
|
|
|
33
28
|
};
|
|
34
29
|
|
|
35
30
|
// src/reporter-artifact-ops.ts
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
31
|
+
import { createHash } from "crypto";
|
|
32
|
+
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
|
|
33
|
+
import { extname, join } from "path";
|
|
38
34
|
import pLimit from "p-limit";
|
|
39
35
|
|
|
40
36
|
// src/report-artifact.ts
|
|
@@ -159,32 +155,22 @@ async function writeReportArtifact(options) {
|
|
|
159
155
|
}
|
|
160
156
|
|
|
161
157
|
// src/reporter-artifact-ops.ts
|
|
162
|
-
var CURRENT_DIRECTORY_ARTIFACT_SEGMENT = "+dot+";
|
|
163
|
-
var PARENT_DIRECTORY_ARTIFACT_SEGMENT = "+dotdot+";
|
|
164
158
|
var MAX_CONCURRENT_FILE_OPS = 5;
|
|
165
|
-
var SAFE_ARTIFACT_CHARACTER = /^[A-Za-z0-9._-]$/;
|
|
166
|
-
function encodeArtifactPathSegment(segment) {
|
|
167
|
-
if (segment === ".") return CURRENT_DIRECTORY_ARTIFACT_SEGMENT;
|
|
168
|
-
if (segment === "..") return PARENT_DIRECTORY_ARTIFACT_SEGMENT;
|
|
169
|
-
return Array.from(
|
|
170
|
-
segment,
|
|
171
|
-
(character) => SAFE_ARTIFACT_CHARACTER.test(character) ? character : encodeURIComponent(character)
|
|
172
|
-
).join("");
|
|
173
|
-
}
|
|
174
|
-
function safeArtifactPath(name) {
|
|
175
|
-
return name.split("/").map(encodeArtifactPathSegment).join("/");
|
|
176
|
-
}
|
|
177
159
|
function sanitizeId(id) {
|
|
178
160
|
return id.replace(/[^a-zA-Z0-9-_]/g, "_");
|
|
179
161
|
}
|
|
162
|
+
async function writeContentAddressedCopy(sourcePath, destDir) {
|
|
163
|
+
const contents = await readFile2(sourcePath);
|
|
164
|
+
const artifactName = `${createHash("sha1").update(contents).digest("hex")}${extname(sourcePath) || ".png"}`;
|
|
165
|
+
await mkdir2(destDir, { recursive: true });
|
|
166
|
+
await writeFile2(join(destDir, artifactName), contents);
|
|
167
|
+
return artifactName;
|
|
168
|
+
}
|
|
180
169
|
async function copyResolvedBaseline(safeTestId, testScreenshotDir, target, savedAttachments) {
|
|
181
170
|
const attachmentName = `${target.attachmentBaseName}-expected.png`;
|
|
182
|
-
const artifactPath = safeArtifactPath(attachmentName);
|
|
183
|
-
const destPath = join(testScreenshotDir, artifactPath);
|
|
184
171
|
try {
|
|
185
|
-
await
|
|
186
|
-
|
|
187
|
-
savedAttachments.push({ name: attachmentName, path: `${safeTestId}/${artifactPath}`, contentType: "image/png" });
|
|
172
|
+
const artifactName = await writeContentAddressedCopy(target.snapshotPath, testScreenshotDir);
|
|
173
|
+
savedAttachments.push({ name: attachmentName, path: `${safeTestId}/${artifactName}`, contentType: "image/png" });
|
|
188
174
|
log(`[CrvyRprtr] Attached baseline: ${target.snapshotPath}`);
|
|
189
175
|
} catch {
|
|
190
176
|
}
|
|
@@ -200,16 +186,13 @@ async function saveAttachments(screenshotDir, testId, result) {
|
|
|
200
186
|
).map(
|
|
201
187
|
(attachment) => limit(async () => {
|
|
202
188
|
try {
|
|
203
|
-
const
|
|
204
|
-
const destPath = join(testScreenshotDir, artifactPath);
|
|
205
|
-
await mkdir2(dirname2(destPath), { recursive: true });
|
|
206
|
-
await copyFile(attachment.path, destPath);
|
|
189
|
+
const artifactName = await writeContentAddressedCopy(attachment.path, testScreenshotDir);
|
|
207
190
|
savedAttachments.push({
|
|
208
191
|
name: attachment.name,
|
|
209
|
-
path: `${safeTestId}/${
|
|
192
|
+
path: `${safeTestId}/${artifactName}`,
|
|
210
193
|
contentType: attachment.contentType ?? "image/png"
|
|
211
194
|
});
|
|
212
|
-
log(`[CrvyRprtr] Saved screenshot: ${
|
|
195
|
+
log(`[CrvyRprtr] Saved screenshot: ${join(testScreenshotDir, artifactName)}`);
|
|
213
196
|
} catch (error) {
|
|
214
197
|
logError(`[CrvyRprtr] Failed to save screenshot: ${attachment.path}`, error);
|
|
215
198
|
savedAttachments.push({
|
|
@@ -347,6 +330,7 @@ var CrvyRprtr = class {
|
|
|
347
330
|
isOfflineMode = false;
|
|
348
331
|
runEvents = [];
|
|
349
332
|
ci;
|
|
333
|
+
portableArtifacts = process.env.CRVY_RPRTR_PORTABLE_ARTIFACTS === "1";
|
|
350
334
|
pendingArtifacts = [];
|
|
351
335
|
constructor(options = {}) {
|
|
352
336
|
this.serverUrl = options.serverUrl ?? process.env.CRVY_RPRTR_SERVER_URL ?? "ws://localhost:3000";
|
|
@@ -361,7 +345,7 @@ var CrvyRprtr = class {
|
|
|
361
345
|
if (this.ci) this.isOfflineMode = true;
|
|
362
346
|
}
|
|
363
347
|
onBegin(config, suite) {
|
|
364
|
-
this.configDir = config.configFile === void 0 ? config.rootDir :
|
|
348
|
+
this.configDir = config.configFile === void 0 ? config.rootDir : dirname2(config.configFile);
|
|
365
349
|
log(`[CrvyRprtr] Starting run with ${suite.allTests().length} tests`);
|
|
366
350
|
if (!this.ci) {
|
|
367
351
|
this.connect();
|
|
@@ -409,10 +393,11 @@ var CrvyRprtr = class {
|
|
|
409
393
|
data: {
|
|
410
394
|
playwrightSnapshotDir: typeof snapshotDir === "string" ? snapshotDir : void 0,
|
|
411
395
|
playwrightTestDir: typeof testDir === "string" ? testDir : void 0,
|
|
396
|
+
playwrightRootDir: typeof config.rootDir === "string" ? config.rootDir : void 0,
|
|
412
397
|
playwrightSnapshotPathTemplate: this.playwrightSnapshotPathTemplate,
|
|
413
398
|
playwrightToHaveScreenshotPathTemplate: this.playwrightToHaveScreenshotPathTemplate,
|
|
414
399
|
configFile: config.configFile,
|
|
415
|
-
cwd: config.
|
|
400
|
+
cwd: config.configFile === void 0 ? process.cwd() : dirname2(config.configFile)
|
|
416
401
|
}
|
|
417
402
|
});
|
|
418
403
|
}
|
|
@@ -428,11 +413,7 @@ var CrvyRprtr = class {
|
|
|
428
413
|
resolveBrowserLabel(project) {
|
|
429
414
|
const name = project?.name;
|
|
430
415
|
if (name !== void 0 && name !== "") return name;
|
|
431
|
-
|
|
432
|
-
if (browserName !== void 0) return browserName;
|
|
433
|
-
const defaultBrowserType = project?.use?.defaultBrowserType;
|
|
434
|
-
if (defaultBrowserType !== void 0) return defaultBrowserType;
|
|
435
|
-
return "chromium";
|
|
416
|
+
return project?.use?.browserName ?? project?.use?.defaultBrowserType ?? "chromium";
|
|
436
417
|
}
|
|
437
418
|
reporterTitlePath(test) {
|
|
438
419
|
return typeof test.titlePath === "function" ? test.titlePath() : ["", test.parent.project()?.name ?? "", test.location.file, ...this.describeTitlePath(test), test.title];
|
|
@@ -454,7 +435,7 @@ var CrvyRprtr = class {
|
|
|
454
435
|
}
|
|
455
436
|
});
|
|
456
437
|
}
|
|
457
|
-
onTestEnd(test, result) {
|
|
438
|
+
async onTestEnd(test, result) {
|
|
458
439
|
const reporterTitlePath = this.testMetadata.get(test.id)?.reporterTitlePath ?? this.reporterTitlePath(test);
|
|
459
440
|
const screenshotDeclarations = withResolvedVisualNames(
|
|
460
441
|
extractScreenshotDeclarations(result.steps),
|
|
@@ -482,6 +463,9 @@ var CrvyRprtr = class {
|
|
|
482
463
|
nativeAttachments,
|
|
483
464
|
eventData: data
|
|
484
465
|
});
|
|
466
|
+
} else if (this.portableArtifacts) {
|
|
467
|
+
await mkdir3(this.screenshotDir, { recursive: true });
|
|
468
|
+
data.attachments = await saveAttachments(this.screenshotDir, test.id, { attachments: nativeAttachments });
|
|
485
469
|
}
|
|
486
470
|
this.send({ type: "test-end", data });
|
|
487
471
|
} finally {
|
package/dist/schemas/http.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const RunRequestBodySchema: z.ZodObject<{
|
|
|
21
21
|
projectName: z.ZodOptional<z.ZodString>;
|
|
22
22
|
titlePath: z.ZodArray<z.ZodString>;
|
|
23
23
|
}, z.core.$strip>>>;
|
|
24
|
+
update: z.ZodOptional<z.ZodBoolean>;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
export type RunRequestBody = z.infer<typeof RunRequestBodySchema>;
|
|
26
27
|
export declare const RunResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -31,6 +32,7 @@ export declare const RunResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
31
32
|
"no-config": "no-config";
|
|
32
33
|
"already-running": "already-running";
|
|
33
34
|
"no-tests": "no-tests";
|
|
35
|
+
"docker-unavailable": "docker-unavailable";
|
|
34
36
|
}>;
|
|
35
37
|
}, z.core.$strip>], "ok">;
|
|
36
38
|
export type RunResponse = z.infer<typeof RunResponseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/schemas/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/schemas/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,oBAAoB;;;;;;;;;iBAG/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,iBAAiB;;;;;;;;;;yBAM5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,kBAAkB;;;;;yBAM7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -447,6 +447,11 @@ export declare const WebSocketMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
447
447
|
type: z.ZodLiteral<"run-status">;
|
|
448
448
|
data: z.ZodObject<{
|
|
449
449
|
running: z.ZodBoolean;
|
|
450
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
451
|
+
local: "local";
|
|
452
|
+
docker: "docker";
|
|
453
|
+
}>>;
|
|
454
|
+
phase: z.ZodOptional<z.ZodString>;
|
|
450
455
|
}, z.core.$strip>;
|
|
451
456
|
}, z.core.$strip>], "type">;
|
|
452
457
|
export type WebSocketMessage = z.infer<typeof WebSocketMessageSchema>;
|
|
@@ -502,6 +507,7 @@ export type RunEndData = z.infer<typeof RunEndDataSchema>;
|
|
|
502
507
|
export declare const RegisterDataSchema: z.ZodObject<{
|
|
503
508
|
playwrightSnapshotDir: z.ZodOptional<z.ZodString>;
|
|
504
509
|
playwrightTestDir: z.ZodOptional<z.ZodString>;
|
|
510
|
+
playwrightRootDir: z.ZodOptional<z.ZodString>;
|
|
505
511
|
playwrightSnapshotPathTemplate: z.ZodOptional<z.ZodString>;
|
|
506
512
|
playwrightToHaveScreenshotPathTemplate: z.ZodOptional<z.ZodString>;
|
|
507
513
|
configFile: z.ZodOptional<z.ZodString>;
|
|
@@ -733,6 +739,10 @@ export declare const ReportApiResponseSchema: z.ZodObject<{
|
|
|
733
739
|
isUpdateMode: z.ZodOptional<z.ZodBoolean>;
|
|
734
740
|
isRunning: z.ZodOptional<z.ZodBoolean>;
|
|
735
741
|
runEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
742
|
+
runMode: z.ZodOptional<z.ZodEnum<{
|
|
743
|
+
local: "local";
|
|
744
|
+
docker: "docker";
|
|
745
|
+
}>>;
|
|
736
746
|
}, z.core.$strip>;
|
|
737
747
|
export type ReportApiResponse = z.infer<typeof ReportApiResponseSchema>;
|
|
738
748
|
export declare const ClientBootstrapDataSchema: z.ZodObject<{
|
|
@@ -800,6 +810,10 @@ export declare const ClientBootstrapDataSchema: z.ZodObject<{
|
|
|
800
810
|
}, z.core.$strip>>;
|
|
801
811
|
isRunning: z.ZodOptional<z.ZodBoolean>;
|
|
802
812
|
runEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
813
|
+
runMode: z.ZodOptional<z.ZodEnum<{
|
|
814
|
+
local: "local";
|
|
815
|
+
docker: "docker";
|
|
816
|
+
}>>;
|
|
803
817
|
isUpdateMode: z.ZodBoolean;
|
|
804
818
|
}, z.core.$strip>;
|
|
805
819
|
liveUpdates: z.ZodBoolean;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,cAAc,mBAAmB,CAAA;AAGjC,eAAO,MAAM,cAAc;;;;iBAIzB,CAAA;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD,eAAO,MAAM,kBAAkB;;;;EAA2D,CAAA;AAE1F,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAG7D,eAAO,MAAM,YAAY;;;;;;;;;;iBAMvB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AM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC,CAM5F"}
|
package/dist/server/app.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type DockerOptions } from './docker-launcher.ts';
|
|
2
|
+
import { type RunMode } from './run-mode.ts';
|
|
1
3
|
import type { RuntimeWebSocket } from './ws.ts';
|
|
2
4
|
export interface ServerOptions {
|
|
3
5
|
port?: number;
|
|
@@ -22,6 +24,10 @@ export interface ServerOptions {
|
|
|
22
24
|
playwrightSnapshotDir?: string;
|
|
23
25
|
playwrightSnapshotPathTemplate?: string;
|
|
24
26
|
playwrightToHaveScreenshotPathTemplate?: string;
|
|
27
|
+
/** Execution backend for UI-triggered runs. Default 'auto'. */
|
|
28
|
+
runMode?: RunMode;
|
|
29
|
+
/** Docker backend settings; only used when the resolved mode is 'docker'. */
|
|
30
|
+
docker?: DockerOptions;
|
|
25
31
|
}
|
|
26
32
|
export interface ServerApp {
|
|
27
33
|
port: number;
|
package/dist/server/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/server/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/server/app.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAiBzD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,8BAA8B,CAAC,EAAE,MAAM,CAAA;IACvC,sCAAsC,CAAC,EAAE,MAAM,CAAA;IAC/C,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAUD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAChC,qEAAqE;IACrE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IAClD,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3D;AAoKD,wBAAsB,eAAe,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,CAsCrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-routes.d.ts","sourceRoot":"","sources":["../../src/server/artifact-routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"artifact-routes.d.ts","sourceRoot":"","sources":["../../src/server/artifact-routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAWhD,wBAAsB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyCpF;AAYD,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAA;AAE9D,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAkCf;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmCxF;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAQhH"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type DetectAgent, type DockerExec } from './docker-support.ts';
|
|
2
|
+
import type { RunLauncher } from './run-launcher.ts';
|
|
3
|
+
export declare const DOCKER_WORK_DIR = "/work";
|
|
4
|
+
export interface DockerOptions {
|
|
5
|
+
image?: string;
|
|
6
|
+
platform?: 'linux/amd64' | 'linux/arm64';
|
|
7
|
+
command?: string[];
|
|
8
|
+
extraArgs?: string[];
|
|
9
|
+
}
|
|
10
|
+
type Warn = (message: string) => void;
|
|
11
|
+
export interface DockerLauncherOptions {
|
|
12
|
+
port: number;
|
|
13
|
+
docker?: DockerOptions;
|
|
14
|
+
getPlaywrightVersion?: (cwd: string) => string | null;
|
|
15
|
+
exec?: DockerExec;
|
|
16
|
+
detectAgent?: DetectAgent;
|
|
17
|
+
env?: Record<string, string | undefined>;
|
|
18
|
+
containerName?: string;
|
|
19
|
+
workDir?: string;
|
|
20
|
+
warn?: Warn;
|
|
21
|
+
}
|
|
22
|
+
export declare class DockerUnavailableError extends Error {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
export declare function createDockerLauncher(options: DockerLauncherOptions): RunLauncher;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=docker-launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-launcher.d.ts","sourceRoot":"","sources":["../../src/server/docker-launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAA4B,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE9E,eAAO,MAAM,eAAe,UAAU,CAAA;AAKtC,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,aAAa,GAAG,aAAa,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,KAAK,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;AAErC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IACrD,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IACxC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AAcD,qBAAa,sBAAuB,SAAQ,KAAK;;CAKhD;AA+ND,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,WAAW,CAYhF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface DockerExecResult {
|
|
2
|
+
exitCode: number;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
}
|
|
6
|
+
export type DockerExec = (args: string[]) => Promise<DockerExecResult>;
|
|
7
|
+
export declare function createDockerExec(): DockerExec;
|
|
8
|
+
export declare function probeDockerDaemon(exec: DockerExec): Promise<boolean>;
|
|
9
|
+
export declare function isDockerImagePresent(exec: DockerExec, image: string): Promise<boolean>;
|
|
10
|
+
export declare function pullDockerImage(exec: DockerExec, image: string): Promise<boolean>;
|
|
11
|
+
export declare function forceRemoveContainer(exec: DockerExec, name: string): Promise<void>;
|
|
12
|
+
export declare function resolveDockerImage(options: {
|
|
13
|
+
image?: string;
|
|
14
|
+
version: string | null;
|
|
15
|
+
}): string | null;
|
|
16
|
+
export declare const DEFAULT_CONTAINER_COMMAND: readonly string[];
|
|
17
|
+
export declare function resolveContainerCommand(input: {
|
|
18
|
+
command?: string[];
|
|
19
|
+
hasCustomImage: boolean;
|
|
20
|
+
detectedAgentName?: string | null;
|
|
21
|
+
warn?: (message: string) => void;
|
|
22
|
+
}): string[];
|
|
23
|
+
export interface DetectedAgent {
|
|
24
|
+
name: string;
|
|
25
|
+
agent: string;
|
|
26
|
+
}
|
|
27
|
+
export type DetectAgent = (cwd: string) => Promise<DetectedAgent | null>;
|
|
28
|
+
export declare const detectProjectAgent: DetectAgent;
|
|
29
|
+
/** Maps an absolute path prefix in the container's mount namespace to its host equivalent. */
|
|
30
|
+
export interface ContainerPathMapping {
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Maps an absolute path from the container's mount namespace back to the host.
|
|
36
|
+
* Only exact matches and direct descendants of `mapping.from` are rewritten;
|
|
37
|
+
* prefix lookalikes like `/workspace` are left untouched.
|
|
38
|
+
*/
|
|
39
|
+
export declare function rewriteContainerPath(path: string, mapping: ContainerPathMapping): string;
|
|
40
|
+
/** Reads the installed `@playwright/test` version from cwd; null when unresolvable (→ positional fallback). */
|
|
41
|
+
export declare function resolvePlaywrightVersion(cwd: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Docker run-mode reports carry container-side test file paths (`/work/...`);
|
|
44
|
+
* run descriptors from the UI must be mapped back to host paths before they
|
|
45
|
+
* feed `--test-list` / positional filters resolved against the host `ctx.cwd`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function rewriteContainerTestDescriptors<T extends {
|
|
48
|
+
readonly file: string;
|
|
49
|
+
}>(tests: T[] | undefined, mapping: ContainerPathMapping | undefined): T[] | undefined;
|
|
50
|
+
type TestListDescriptor = {
|
|
51
|
+
readonly file: string;
|
|
52
|
+
readonly line: number;
|
|
53
|
+
readonly column?: number;
|
|
54
|
+
readonly projectName?: string;
|
|
55
|
+
readonly titlePath: readonly string[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Builds `--test-list` lines mirroring `playwright test --list`, with paths relative to
|
|
59
|
+
* Playwright's rootDir. When rootDir is unknown (no register yet — seeded run context),
|
|
60
|
+
* emits one candidate entry per plausible base (every suffix of the cwd-relative path):
|
|
61
|
+
* Playwright derives rootDir from testDir when set, and non-matching entries are
|
|
62
|
+
* ignored silently, so exactly one candidate matches the intended test.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildTestListEntries(tests: readonly TestListDescriptor[], rootDir?: string, cwd?: string): string[];
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=docker-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-support.d.ts","sourceRoot":"","sources":["../../src/server/docker-support.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,g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E,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAIxF;AAED,+GAA+G;AAC/G,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWnE;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACjF,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,EACtB,OAAO,EAAE,oBAAoB,GAAG,SAAS,GACxC,CAAC,EAAE,GAAG,SAAS,CAGjB;AAED,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC,CAAA;AASD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAUnH"}
|
|
@@ -30,5 +30,5 @@ export declare function handleRunEnd(ctx: HandlerContext, data: {
|
|
|
30
30
|
}): Promise<void>;
|
|
31
31
|
export declare function handleApprove(): void;
|
|
32
32
|
export declare function handleSync(ctx: HandlerContext): void;
|
|
33
|
-
export declare function handleRegister(ctx: HandlerContext,
|
|
33
|
+
export declare function handleRegister(ctx: HandlerContext, rawData: RegisterData): void;
|
|
34
34
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC7E,OAAO,KAAK,EAA0B,QAAQ,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAA+B,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE;QACV,SAAS,EAAE,OAAO,CAAA;QAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAC/B,QAAQ,EAAE,MAAM,EAAE,CAAA;QAClB,YAAY,EAAE,OAAO,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAChC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAG1B,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B;+EAC2E;IAC3E,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,aAAa,EAAE,aAAa,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAO9E;AAwBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAkB1E;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;CAAE,GAChD,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAWpD;AAkBD,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CA8C/E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DockerOptions } from './docker-launcher.ts';
|
|
2
|
+
import type { RoutesContextOptions } from './routes-context.ts';
|
|
3
|
+
import { type RunLauncher } from './run-launcher.ts';
|
|
4
|
+
import { type RunMode } from './run-mode.ts';
|
|
5
|
+
export interface ResolvedRunBackend {
|
|
6
|
+
launcher: RunLauncher;
|
|
7
|
+
routesContextOptions: RoutesContextOptions;
|
|
8
|
+
}
|
|
9
|
+
interface ResolveRunBackendOptions {
|
|
10
|
+
runMode?: RunMode;
|
|
11
|
+
docker?: DockerOptions;
|
|
12
|
+
port: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the run mode (auto-probes the docker daemon once) and selects the
|
|
16
|
+
* matching launcher. The docker exec is shared between the probe and the
|
|
17
|
+
* launcher so the daemon is hit at most once during auto resolution. Also
|
|
18
|
+
* builds the routes-context options carrying `runInfo` and (in docker mode)
|
|
19
|
+
* the host↔container path mapping.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveRunBackend(options: ResolveRunBackendOptions): Promise<ResolvedRunBackend>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=launcher-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher-resolver.d.ts","sourceRoot":"","sources":["../../src/server/launcher-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEhG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,CAAA;IACrB,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C;AAED,UAAU,wBAAwB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqBtG"}
|