@empiricalrun/playwright-utils 0.46.1 → 0.46.3
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 +15 -0
- package/dist/reporter/ibr-utils.d.ts +1 -0
- package/dist/reporter/ibr-utils.d.ts.map +1 -1
- package/dist/reporter/ibr-utils.js +7 -0
- package/dist/reporter/incremental-blob-reporter.d.ts.map +1 -1
- package/dist/reporter/incremental-blob-reporter.js +15 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.46.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3a315aa: fix: pass->skip->fail retries were treated as failed test
|
|
8
|
+
- 010eda2: fix: upload incremental report only when reporter has begun
|
|
9
|
+
- Updated dependencies [3a315aa]
|
|
10
|
+
- @empiricalrun/reporter@0.28.1
|
|
11
|
+
|
|
12
|
+
## 0.46.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 364eb85: fix: skipped tests have 1 retry. persist them
|
|
17
|
+
|
|
3
18
|
## 0.46.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -40,6 +40,7 @@ export declare function serializeSuite(suite: Suite, rootDir: string): JsonSuite
|
|
|
40
40
|
* Returns null if the suite has no completed test descendants.
|
|
41
41
|
*/
|
|
42
42
|
export declare function filterSuiteByCompletedTests(suite: JsonSuite, completedTestIds: Set<string>): JsonSuite | null;
|
|
43
|
+
export declare function hasValidReport(reportLines: string[]): boolean;
|
|
43
44
|
export declare function buildUrlsJson(attachmentUrlMap: Map<string, string>): Record<string, string>;
|
|
44
45
|
export declare function isLocalTesting(): boolean;
|
|
45
46
|
export declare function embedAttachment(attachmentPath: string | undefined, resultId: string, stagingDir: string): string | null;
|
|
@@ -1 +1 @@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,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAK7D;AAED,wBAAgB,aAAa,CAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAkBf"}
|
|
@@ -10,6 +10,7 @@ exports.getOrCreateStepId = getOrCreateStepId;
|
|
|
10
10
|
exports.serializeTest = serializeTest;
|
|
11
11
|
exports.serializeSuite = serializeSuite;
|
|
12
12
|
exports.filterSuiteByCompletedTests = filterSuiteByCompletedTests;
|
|
13
|
+
exports.hasValidReport = hasValidReport;
|
|
13
14
|
exports.buildUrlsJson = buildUrlsJson;
|
|
14
15
|
exports.isLocalTesting = isLocalTesting;
|
|
15
16
|
exports.embedAttachment = embedAttachment;
|
|
@@ -109,6 +110,12 @@ function filterSuiteByCompletedTests(suite, completedTestIds) {
|
|
|
109
110
|
return null;
|
|
110
111
|
return { ...suite, entries: filteredEntries };
|
|
111
112
|
}
|
|
113
|
+
function hasValidReport(reportLines) {
|
|
114
|
+
return reportLines.some((line) => {
|
|
115
|
+
const parsed = JSON.parse(line);
|
|
116
|
+
return parsed.method === "onBegin";
|
|
117
|
+
});
|
|
118
|
+
}
|
|
112
119
|
function buildUrlsJson(attachmentUrlMap) {
|
|
113
120
|
const urlMap = {};
|
|
114
121
|
for (const [localPath, url] of attachmentUrlMap) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incremental-blob-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/incremental-blob-reporter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"incremental-blob-reporter.d.ts","sourceRoot":"","sources":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EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAgB/C,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAIrD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAyBnD,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAYrE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAY7D,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9C;;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,6 +6,7 @@ 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 reporter_1 = require("@empiricalrun/reporter");
|
|
9
10
|
const fs_1 = __importDefault(require("fs"));
|
|
10
11
|
const path_1 = __importDefault(require("path"));
|
|
11
12
|
const ibr_utils_1 = require("./ibr-utils");
|
|
@@ -28,7 +29,7 @@ class IncrementalBlobReporter {
|
|
|
28
29
|
_completedTestIds = new Set();
|
|
29
30
|
_completedResultIds = new Set();
|
|
30
31
|
_testRetries = new Map(); // testId → configured retries
|
|
31
|
-
_testResults = new Map(); // testId → retryIndex → {
|
|
32
|
+
_testResults = new Map(); // testId → retryIndex → {resultId, status, expectedStatus}
|
|
32
33
|
_startTime = Date.now();
|
|
33
34
|
constructor() {
|
|
34
35
|
if (process.env.SHARD_INDEX && process.env.TOTAL_SHARDS) {
|
|
@@ -55,7 +56,7 @@ class IncrementalBlobReporter {
|
|
|
55
56
|
process.exit(0);
|
|
56
57
|
})
|
|
57
58
|
.catch((err) => {
|
|
58
|
-
console.error("[
|
|
59
|
+
console.error("[IncrementalBlobReporterFailure] Flush/upload failed on SIGINT:", err);
|
|
59
60
|
})
|
|
60
61
|
.finally(() => {
|
|
61
62
|
this._removeSignalHandler();
|
|
@@ -71,6 +72,10 @@ class IncrementalBlobReporter {
|
|
|
71
72
|
}
|
|
72
73
|
async _flushAndUpload() {
|
|
73
74
|
(0, reporter_state_1.setFinalized)();
|
|
75
|
+
if (!(0, ibr_utils_1.hasValidReport)(this._reportLines)) {
|
|
76
|
+
console.warn("[IncrementalBlobReporterFailure] No onBegin received, skipping upload (nothing to merge)");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
74
79
|
// Wait for pending attachment uploads FIRST so URLs are available
|
|
75
80
|
if (this._uploader) {
|
|
76
81
|
await this._uploader.waitForUploads();
|
|
@@ -78,7 +83,7 @@ class IncrementalBlobReporter {
|
|
|
78
83
|
this._finalizeReportForInterrupt();
|
|
79
84
|
await this._writeZip();
|
|
80
85
|
if (!this._uploader) {
|
|
81
|
-
console.
|
|
86
|
+
console.warn("[IncrementalBlobReporterFailure] No uploader available, skipping upload");
|
|
82
87
|
return;
|
|
83
88
|
}
|
|
84
89
|
await this._uploader.uploadFile(this._zipPath, `blobs/incremental-report-${this._shardIndex}.zip`);
|
|
@@ -111,10 +116,8 @@ class IncrementalBlobReporter {
|
|
|
111
116
|
}
|
|
112
117
|
_computeCompletedSets() {
|
|
113
118
|
for (const [testId, results] of this._testResults) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const allRetriesCompleted = results.size === configuredRetries + 1;
|
|
117
|
-
if (hasPassedRetry || allRetriesCompleted) {
|
|
119
|
+
const maxRetries = this._testRetries.get(testId);
|
|
120
|
+
if ((0, reporter_1.areRetriesComplete)(maxRetries, results)) {
|
|
118
121
|
this._completedTestIds.add(testId);
|
|
119
122
|
for (const { resultId } of results.values()) {
|
|
120
123
|
this._completedResultIds.add(resultId);
|
|
@@ -205,9 +208,11 @@ class IncrementalBlobReporter {
|
|
|
205
208
|
}
|
|
206
209
|
const resultId = this._resultIdMap.get(`${test.id}-${result.retry}`);
|
|
207
210
|
if (resultId) {
|
|
208
|
-
this._testResults
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
this._testResults.get(test.id).set(result.retry, {
|
|
212
|
+
resultId,
|
|
213
|
+
status: result.status,
|
|
214
|
+
expectedStatus: test.expectedStatus,
|
|
215
|
+
});
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
218
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.3",
|
|
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/cua": "^0.3.0",
|
|
46
47
|
"@empiricalrun/dashboard-client": "^0.2.0",
|
|
47
48
|
"@empiricalrun/llm": "^0.26.0",
|
|
48
49
|
"@empiricalrun/r2-uploader": "^0.9.1",
|
|
49
|
-
"@empiricalrun/reporter": "^0.28.
|
|
50
|
-
"@empiricalrun/cua": "^0.3.0"
|
|
50
|
+
"@empiricalrun/reporter": "^0.28.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"dev": "tsc --build --watch",
|