@empiricalrun/playwright-utils 0.44.0 → 0.45.1
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 +13 -0
- package/dist/reporter/IBR-unit-test/example.spec.d.ts +2 -0
- package/dist/reporter/IBR-unit-test/example.spec.d.ts.map +1 -0
- package/dist/reporter/IBR-unit-test/example.spec.js +14 -0
- package/dist/reporter/IBR-unit-test/playwright.config.d.ts +3 -0
- package/dist/reporter/IBR-unit-test/playwright.config.d.ts.map +1 -0
- package/dist/reporter/IBR-unit-test/playwright.config.js +8 -0
- package/dist/reporter/empirical-reporter.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.js +12 -1
- package/dist/reporter/incremental-blob-reporter.d.ts +1 -2
- package/dist/reporter/incremental-blob-reporter.d.ts.map +1 -1
- package/dist/reporter/incremental-blob-reporter.js +23 -43
- package/dist/reporter/local-test.d.ts +2 -0
- package/dist/reporter/local-test.d.ts.map +1 -0
- package/dist/reporter/local-test.js +29 -0
- package/dist/reporter/reporter-state.d.ts +3 -0
- package/dist/reporter/reporter-state.d.ts.map +1 -0
- package/dist/reporter/reporter-state.js +11 -0
- package/dist/reporter/uploader.d.ts +1 -1
- package/dist/reporter/uploader.d.ts.map +1 -1
- package/dist/reporter/uploader.js +8 -1
- package/package.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.45.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5bfda3d: fix: clear disk space after successful attachments
|
|
8
|
+
- 3ea9053: fix: onEnd may trigger while writing zip. upload may not get called. …
|
|
9
|
+
|
|
10
|
+
## 0.45.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 11ea318: feat: after sigint, ER stops sending events and uploader is shared
|
|
15
|
+
|
|
3
16
|
## 0.44.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.spec.d.ts","sourceRoot":"","sources":["../../../src/reporter/IBR-unit-test/example.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
(0, test_1.test)("fast test", async () => {
|
|
5
|
+
(0, test_1.expect)(1 + 1).toBe(2);
|
|
6
|
+
});
|
|
7
|
+
(0, test_1.test)("slow test 1", async () => {
|
|
8
|
+
await new Promise((r) => setTimeout(r, 20000));
|
|
9
|
+
(0, test_1.expect)(true).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
(0, test_1.test)("slow test 2", async () => {
|
|
12
|
+
await new Promise((r) => setTimeout(r, 20000));
|
|
13
|
+
(0, test_1.expect)(true).toBe(true);
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.config.d.ts","sourceRoot":"","sources":["../../../src/reporter/IBR-unit-test/playwright.config.ts"],"names":[],"mappings":";AAEA,wBAIG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empirical-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/empirical-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"empirical-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/empirical-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAsBnC,cAAM,iBAAkB,YAAW,QAAQ;IACzC,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,oBAAoB,CAG1B;IACF,OAAO,CAAC,sBAAsB,CAAuB;IACrD,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,iBAAiB,CAAyC;IAClE,OAAO,CAAC,gBAAgB,CAAkC;IAC1D,OAAO,CAAC,SAAS,CAAyB;;IAM1C,OAAO,CAAC,6BAA6B,CA0CnC;IAEF,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAwGtC,KAAK,CAAC,MAAM,EAAE,UAAU;IAkG9B,OAAO,CAAC,qBAAqB;YAkBf,gBAAgB;YAOhB,iBAAiB;CAmChC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -10,6 +10,7 @@ const telemetry_1 = require("../telemetry");
|
|
|
10
10
|
const blob_utils_1 = require("./blob-utils");
|
|
11
11
|
const failing_line_1 = require("./failing-line");
|
|
12
12
|
const incremental_blob_reporter_1 = require("./incremental-blob-reporter");
|
|
13
|
+
const reporter_state_1 = require("./reporter-state");
|
|
13
14
|
const uploader_1 = require("./uploader");
|
|
14
15
|
const util_1 = require("./util");
|
|
15
16
|
class EmpiricalReporter {
|
|
@@ -21,7 +22,7 @@ class EmpiricalReporter {
|
|
|
21
22
|
_testRetryCounts = new Map();
|
|
22
23
|
_uploader = null;
|
|
23
24
|
constructor() {
|
|
24
|
-
this._uploader = (0, uploader_1.
|
|
25
|
+
this._uploader = (0, uploader_1.getUploader)();
|
|
25
26
|
}
|
|
26
27
|
enqueTestAttachmentUploadTask = async (attachment) => {
|
|
27
28
|
if (!this._uploader)
|
|
@@ -39,10 +40,18 @@ class EmpiricalReporter {
|
|
|
39
40
|
const destinationPath = `data/${relativePath}`;
|
|
40
41
|
const publicUrl = await this._uploader.uploadFile(attachment.path, destinationPath);
|
|
41
42
|
if (publicUrl) {
|
|
43
|
+
try {
|
|
44
|
+
await fs_1.default.promises.unlink(attachment.path);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
logger_1.logger.warn(`[Empirical Reporter] Failed to delete uploaded attachment: ${attachment.path}`, err);
|
|
48
|
+
}
|
|
42
49
|
return { [attachment.path]: publicUrl };
|
|
43
50
|
}
|
|
44
51
|
};
|
|
45
52
|
onTestEnd(test, result) {
|
|
53
|
+
if ((0, reporter_state_1.isFinalized)())
|
|
54
|
+
return;
|
|
46
55
|
if (!this._uploader)
|
|
47
56
|
return;
|
|
48
57
|
if (!process.env.TEST_RUN_GITHUB_ACTION_ID) {
|
|
@@ -124,6 +133,8 @@ class EmpiricalReporter {
|
|
|
124
133
|
}
|
|
125
134
|
}
|
|
126
135
|
async onEnd(result) {
|
|
136
|
+
if ((0, reporter_state_1.isFinalized)())
|
|
137
|
+
return;
|
|
127
138
|
if (!this._uploader)
|
|
128
139
|
return;
|
|
129
140
|
logger_1.logger.debug(`[Empirical Reporter] Test run completed with status: ${result.status}`);
|
|
@@ -21,8 +21,8 @@ declare class IncrementalBlobReporter implements Reporter {
|
|
|
21
21
|
private _stepIdMap;
|
|
22
22
|
private _uploader;
|
|
23
23
|
private _interrupted;
|
|
24
|
+
private _flushPromise;
|
|
24
25
|
private _lastTestEndIndex;
|
|
25
|
-
private _finalized;
|
|
26
26
|
private _startTime;
|
|
27
27
|
constructor();
|
|
28
28
|
private _sigintHandler;
|
|
@@ -50,7 +50,6 @@ declare class IncrementalBlobReporter implements Reporter {
|
|
|
50
50
|
onStepBegin(test: TestCase, result: TestResult, step: TestStep): void;
|
|
51
51
|
onStepEnd(test: TestCase, result: TestResult, step: TestStep): void;
|
|
52
52
|
onEnd(result: FullResult): Promise<void>;
|
|
53
|
-
private _mergeForLocalTest;
|
|
54
53
|
/**
|
|
55
54
|
* Add a single attachment URL mapping
|
|
56
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incremental-blob-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/incremental-blob-reporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"incremental-blob-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/incremental-blob-reporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAenC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,cAAM,uBAAwB,YAAW,QAAQ;IAC/C,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,WAAW,CAIjB;IACF,OAAO,CAAC,UAAU,CAGhB;IACF,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,iBAAiB,CAAc;IACvC,OAAO,CAAC,UAAU,CAAsB;;IAexC,OAAO,CAAC,cAAc,CAA6B;IAEnD,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,oBAAoB;YAOd,eAAe;IAkC7B,OAAO,CAAC,2BAA2B;IA8BnC,OAAO,KAAK,QAAQ,GAKnB;IAED,OAAO,KAAK,UAAU,GAErB;IAED,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,cAAc;YAQR,SAAS;IAwBvB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IA+E/C,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAerD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAyCnD,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAmBrE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAsB7D,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB9C;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAI5D,aAAa,IAAI,OAAO;CAGzB;AAID,wBAAgB,0BAA0B,IAAI,uBAAuB,GAAG,IAAI,CAE3E;AAED,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAEN;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getIncrementalBlobReporter = getIncrementalBlobReporter;
|
|
7
7
|
exports.setIncrementalBlobReporterInstance = setIncrementalBlobReporterInstance;
|
|
8
8
|
const zip_1 = require("@empiricalrun/r2-uploader/zip");
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
11
10
|
const fs_1 = __importDefault(require("fs"));
|
|
12
11
|
const os_1 = __importDefault(require("os"));
|
|
13
12
|
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const local_test_1 = require("./local-test");
|
|
14
|
+
const reporter_state_1 = require("./reporter-state");
|
|
14
15
|
const uploader_1 = require("./uploader");
|
|
15
16
|
const BLOB_REPORT_VERSION = 2;
|
|
16
17
|
function isLocalTesting() {
|
|
@@ -29,8 +30,8 @@ class IncrementalBlobReporter {
|
|
|
29
30
|
_stepIdMap = new Map(); // step -> stepId
|
|
30
31
|
_uploader = null;
|
|
31
32
|
_interrupted = false;
|
|
33
|
+
_flushPromise = null;
|
|
32
34
|
_lastTestEndIndex = -1;
|
|
33
|
-
_finalized = false;
|
|
34
35
|
_startTime = Date.now();
|
|
35
36
|
constructor() {
|
|
36
37
|
if (process.env.SHARD_INDEX && process.env.TOTAL_SHARDS) {
|
|
@@ -41,7 +42,7 @@ class IncrementalBlobReporter {
|
|
|
41
42
|
this._shardIndex = 1;
|
|
42
43
|
this._totalShards = 1;
|
|
43
44
|
}
|
|
44
|
-
this._uploader = (0, uploader_1.
|
|
45
|
+
this._uploader = (0, uploader_1.getUploader)();
|
|
45
46
|
setIncrementalBlobReporterInstance(this);
|
|
46
47
|
this._setupSignalHandler();
|
|
47
48
|
}
|
|
@@ -49,7 +50,7 @@ class IncrementalBlobReporter {
|
|
|
49
50
|
_setupSignalHandler() {
|
|
50
51
|
this._sigintHandler = () => {
|
|
51
52
|
console.log("[IncrementalBlobReporter] SIGINT received, flushing and uploading...");
|
|
52
|
-
this._flushAndUpload()
|
|
53
|
+
this._flushPromise = this._flushAndUpload()
|
|
53
54
|
.then(() => {
|
|
54
55
|
console.log("[IncrementalBlobReporter] Flush and upload complete on SIGINT, exiting");
|
|
55
56
|
process.exit(0);
|
|
@@ -71,6 +72,7 @@ class IncrementalBlobReporter {
|
|
|
71
72
|
}
|
|
72
73
|
async _flushAndUpload() {
|
|
73
74
|
this._interrupted = true;
|
|
75
|
+
(0, reporter_state_1.setFinalized)();
|
|
74
76
|
// Wait for pending attachment uploads FIRST so URLs are available
|
|
75
77
|
if (this._uploader) {
|
|
76
78
|
await this._uploader.waitForUploads();
|
|
@@ -85,28 +87,29 @@ class IncrementalBlobReporter {
|
|
|
85
87
|
await this._uploader.waitForUploads();
|
|
86
88
|
console.log("[IncrementalBlobReporter] Flush and upload complete on SIGINT");
|
|
87
89
|
if (isLocalTesting()) {
|
|
88
|
-
await this.
|
|
90
|
+
await (0, local_test_1.mergeForLocalTest)(this._currentWorkingDir, this._outputDir);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
_finalizeReportForInterrupt() {
|
|
92
|
-
if (this._finalized)
|
|
93
|
-
return;
|
|
94
94
|
if (this._lastTestEndIndex === -1) {
|
|
95
95
|
console.log("[IncrementalBlobReporter] No onTestEnd found, cannot finalize report. Merge may fail");
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
// Truncate to last onTestEnd
|
|
99
99
|
this._reportLines = this._reportLines.slice(0, this._lastTestEndIndex + 1);
|
|
100
|
-
//
|
|
100
|
+
// Push onEnd directly (bypass _appendEvent which checks isFinalized)
|
|
101
101
|
const now = Date.now();
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
const onEndEvent = {
|
|
103
|
+
method: "onEnd",
|
|
104
|
+
params: {
|
|
105
|
+
result: {
|
|
106
|
+
status: "interrupted",
|
|
107
|
+
startTime: this._startTime,
|
|
108
|
+
duration: now - this._startTime,
|
|
109
|
+
},
|
|
107
110
|
},
|
|
108
|
-
}
|
|
109
|
-
this.
|
|
111
|
+
};
|
|
112
|
+
this._reportLines.push(JSON.stringify(onEndEvent));
|
|
110
113
|
console.log(`[IncrementalBlobReporter] Finalized report at line ${this._lastTestEndIndex + 1}, status: interrupted`);
|
|
111
114
|
}
|
|
112
115
|
get _zipPath() {
|
|
@@ -167,7 +170,7 @@ class IncrementalBlobReporter {
|
|
|
167
170
|
return stepId;
|
|
168
171
|
}
|
|
169
172
|
_appendEvent(method, params) {
|
|
170
|
-
if (
|
|
173
|
+
if ((0, reporter_state_1.isFinalized)())
|
|
171
174
|
return;
|
|
172
175
|
if (this._interrupted && method !== "onEnd")
|
|
173
176
|
return;
|
|
@@ -394,38 +397,15 @@ class IncrementalBlobReporter {
|
|
|
394
397
|
duration: result.duration,
|
|
395
398
|
},
|
|
396
399
|
});
|
|
400
|
+
// Wait for SIGINT flush to complete if it was started
|
|
401
|
+
if (this._flushPromise) {
|
|
402
|
+
await this._flushPromise;
|
|
403
|
+
}
|
|
397
404
|
// Final zip write
|
|
398
405
|
await this._uploader?.waitForUploads();
|
|
399
406
|
await this._writeZip();
|
|
400
407
|
console.log(`[IncrementalBlobReporter] Finished with status: ${result.status}`);
|
|
401
408
|
}
|
|
402
|
-
async _mergeForLocalTest() {
|
|
403
|
-
const htmlOutputDir = path_1.default.join(this._currentWorkingDir, "partial-playwright-report");
|
|
404
|
-
const summaryJsonPath = path_1.default.join(this._currentWorkingDir, "partial-summary.json");
|
|
405
|
-
console.log(`[IncrementalBlobReporter] Running merge report on ${this._outputDir}`);
|
|
406
|
-
try {
|
|
407
|
-
(0, child_process_1.execFileSync)("npx", [
|
|
408
|
-
"playwright",
|
|
409
|
-
"merge-reports",
|
|
410
|
-
this._outputDir,
|
|
411
|
-
"--reporter",
|
|
412
|
-
"html,json",
|
|
413
|
-
], {
|
|
414
|
-
cwd: this._currentWorkingDir,
|
|
415
|
-
env: {
|
|
416
|
-
...process.env,
|
|
417
|
-
PLAYWRIGHT_HTML_OPEN: "never",
|
|
418
|
-
PLAYWRIGHT_HTML_OUTPUT_DIR: htmlOutputDir,
|
|
419
|
-
PLAYWRIGHT_JSON_OUTPUT_NAME: summaryJsonPath,
|
|
420
|
-
},
|
|
421
|
-
stdio: "inherit",
|
|
422
|
-
});
|
|
423
|
-
console.log(`[IncrementalBlobReporter] Merge report completed. HTML: ${htmlOutputDir}, JSON: ${summaryJsonPath}`);
|
|
424
|
-
}
|
|
425
|
-
catch (err) {
|
|
426
|
-
console.error(`[IncrementalBlobReporter] Merge report failed:`, err);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
409
|
/**
|
|
430
410
|
* Add a single attachment URL mapping
|
|
431
411
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-test.d.ts","sourceRoot":"","sources":["../../src/reporter/local-test.ts"],"names":[],"mappings":"AAGA,wBAAsB,iBAAiB,CACrC,iBAAiB,EAAE,MAAM,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.mergeForLocalTest = mergeForLocalTest;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
async function mergeForLocalTest(currentWorkingDir, outputDir) {
|
|
10
|
+
const htmlOutputDir = path_1.default.join(currentWorkingDir, "partial-playwright-report");
|
|
11
|
+
const summaryJsonPath = path_1.default.join(currentWorkingDir, "partial-summary.json");
|
|
12
|
+
console.log(`[IncrementalBlobReporter] Running merge report on ${outputDir}`);
|
|
13
|
+
try {
|
|
14
|
+
(0, child_process_1.execFileSync)("npx", ["playwright", "merge-reports", outputDir, "--reporter", "html,json"], {
|
|
15
|
+
cwd: currentWorkingDir,
|
|
16
|
+
env: {
|
|
17
|
+
...process.env,
|
|
18
|
+
PLAYWRIGHT_HTML_OPEN: "never",
|
|
19
|
+
PLAYWRIGHT_HTML_OUTPUT_DIR: htmlOutputDir,
|
|
20
|
+
PLAYWRIGHT_JSON_OUTPUT_NAME: summaryJsonPath,
|
|
21
|
+
},
|
|
22
|
+
stdio: "inherit",
|
|
23
|
+
});
|
|
24
|
+
console.log(`[IncrementalBlobReporter] Merge report completed. HTML: ${htmlOutputDir}, JSON: ${summaryJsonPath}`);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
console.error(`[IncrementalBlobReporter] Merge report failed:`, err);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter-state.d.ts","sourceRoot":"","sources":["../../src/reporter/reporter-state.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFinalized = isFinalized;
|
|
4
|
+
exports.setFinalized = setFinalized;
|
|
5
|
+
let _finalized = false;
|
|
6
|
+
function isFinalized() {
|
|
7
|
+
return _finalized;
|
|
8
|
+
}
|
|
9
|
+
function setFinalized() {
|
|
10
|
+
_finalized = true;
|
|
11
|
+
}
|
|
@@ -23,5 +23,5 @@ export declare class Uploader {
|
|
|
23
23
|
uploadDirectory(sourceDir: string, destinationPrefix: string): Promise<void>;
|
|
24
24
|
waitForUploads(): Promise<void>;
|
|
25
25
|
}
|
|
26
|
-
export declare function
|
|
26
|
+
export declare function getUploader(): Uploader | null;
|
|
27
27
|
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAGnB,MAAM,2BAA2B,CAAC;AAKnC,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAqB;gBAE7B,MAAM,EAAE,cAAc;IAWlC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI;IAO1E,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA6BnB,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC;IAiBV,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC;
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAGnB,MAAM,2BAA2B,CAAC;AAKnC,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAqB;gBAE7B,MAAM,EAAE,cAAc;IAWlC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI;IAO1E,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA6BnB,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC;IAiBV,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAGtC;AAID,wBAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAI7C"}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Uploader = void 0;
|
|
7
|
-
exports.
|
|
7
|
+
exports.getUploader = getUploader;
|
|
8
8
|
const r2_uploader_1 = require("@empiricalrun/r2-uploader");
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const logger_1 = require("../logger");
|
|
@@ -100,6 +100,13 @@ class Uploader {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
exports.Uploader = Uploader;
|
|
103
|
+
let _uploaderInstance = null;
|
|
104
|
+
function getUploader() {
|
|
105
|
+
if (_uploaderInstance)
|
|
106
|
+
return _uploaderInstance;
|
|
107
|
+
_uploaderInstance = createUploader();
|
|
108
|
+
return _uploaderInstance;
|
|
109
|
+
}
|
|
103
110
|
function createUploader() {
|
|
104
111
|
if (process.argv.includes("--list")) {
|
|
105
112
|
logger_1.logger.debug("[Uploader] Reporter disabled for --list command");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
44
44
|
"rimraf": "^6.0.1",
|
|
45
45
|
"ts-morph": "^23.0.0",
|
|
46
|
-
"@empiricalrun/llm": "^0.26.0",
|
|
47
46
|
"@empiricalrun/cua": "^0.3.0",
|
|
48
47
|
"@empiricalrun/dashboard-client": "^0.2.0",
|
|
49
|
-
"@empiricalrun/
|
|
50
|
-
"@empiricalrun/r2-uploader": "^0.9.1"
|
|
48
|
+
"@empiricalrun/llm": "^0.26.0",
|
|
49
|
+
"@empiricalrun/r2-uploader": "^0.9.1",
|
|
50
|
+
"@empiricalrun/reporter": "^0.28.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"dev": "tsc --build --watch",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/email.ts","./src/index.ts","./src/kv.ts","./src/logger.ts","./src/mailosaur-client.ts","./src/playwright-extensions.ts","./src/postgres.ts","./src/telemetry.ts","./src/webhook.ts","./src/auth/google.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/config/index.ts","./src/config/proxy.ts","./src/config/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/blob-utils.ts","./src/reporter/empirical-reporter.ts","./src/reporter/failing-line.ts","./src/reporter/incremental-blob-reporter.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/test/constants.ts","./src/test/coverage.ts","./src/test/index.ts","./src/test/types.ts","./src/test/video-labels.ts","./src/test/expect/index.ts","./src/test/expect/types.ts","./src/test/expect/visual.ts","./src/test/expect/webhook.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["./src/email.ts","./src/index.ts","./src/kv.ts","./src/logger.ts","./src/mailosaur-client.ts","./src/playwright-extensions.ts","./src/postgres.ts","./src/telemetry.ts","./src/webhook.ts","./src/auth/google.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/config/index.ts","./src/config/proxy.ts","./src/config/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/blob-utils.ts","./src/reporter/empirical-reporter.ts","./src/reporter/failing-line.ts","./src/reporter/incremental-blob-reporter.ts","./src/reporter/local-test.ts","./src/reporter/reporter-state.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/reporter/IBR-unit-test/example.spec.ts","./src/reporter/IBR-unit-test/playwright.config.ts","./src/test/constants.ts","./src/test/coverage.ts","./src/test/index.ts","./src/test/types.ts","./src/test/video-labels.ts","./src/test/expect/index.ts","./src/test/expect/types.ts","./src/test/expect/visual.ts","./src/test/expect/webhook.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}
|