@empiricalrun/playwright-utils 0.14.11 → 0.14.13
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/custom.d.ts.map +1 -1
- package/dist/reporter/custom.js +52 -27
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.14.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c9514f9: fix: add call to process queue
|
|
8
|
+
|
|
9
|
+
## 0.14.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 53cfe45: fix: add contextual errors for report upload
|
|
14
|
+
- 5901db5: fix: add logs for uploader
|
|
15
|
+
- Updated dependencies [5901db5]
|
|
16
|
+
- @empiricalrun/r2-uploader@0.3.5
|
|
17
|
+
|
|
3
18
|
## 0.14.11
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/reporter/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EAEV,KAAK,EACL,QAAQ,IAAI,cAAc,EAC1B,SAAS,EACT,UAAU,IAAI,gBAAgB,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAML,UAAU,EAMX,MAAM,2BAA2B,CAAC;AAgBnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C,QAAA,MAAM,iBAAiB,UAAoC,CAAC;AAC5D,KAAK,oBAAoB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM/D,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE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AG,EAAE,MAAM,GAAG,OAAO;IASxD,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIzB,KAAK,CAAC,MAAM,EAAE,UAAU;IA0HxB,MAAM;CA8Bb;AAkCD,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,IAAI,GAAE,MAAoB,EAC1B,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,iBAqBhB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAsBhE;AAqiBD,eAAe,YAAY,CAAC"}
|
package/dist/reporter/custom.js
CHANGED
|
@@ -151,8 +151,7 @@ class HtmlReporter {
|
|
|
151
151
|
// this.retryTask(uploadTask); // Retry logic
|
|
152
152
|
})
|
|
153
153
|
.finally(() => {
|
|
154
|
-
//
|
|
155
|
-
// console.log("Finished upload execution for ", attachment.path);
|
|
154
|
+
// this is a list of promises which we dont want to await right now
|
|
156
155
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
157
156
|
this.uploadExecutionQueue = this.uploadExecutionQueue.filter((p) => p !== promise);
|
|
158
157
|
this.processQueue(); // Keep processing queue
|
|
@@ -231,36 +230,62 @@ class HtmlReporter {
|
|
|
231
230
|
try {
|
|
232
231
|
console.log("uploading path", this._outputFolder);
|
|
233
232
|
console.log(listFilesRecursively(this._outputFolder));
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
const uploadTraceTask = async () => {
|
|
234
|
+
console.log("Uploading playwright trace");
|
|
235
|
+
return (0, r2_uploader_1.uploadDirectory)({
|
|
236
|
+
sourceDir: this._outputFolder + "/trace",
|
|
237
|
+
destinationDir: process.env.PROJECT_NAME +
|
|
238
|
+
"/" +
|
|
239
|
+
process.env.TEST_RUN_GITHUB_ACTION_ID +
|
|
240
|
+
"/trace",
|
|
241
|
+
uploadBucket: "test-report",
|
|
242
|
+
})
|
|
243
|
+
.then((fileMap) => {
|
|
244
|
+
console.log("Finished uploading playwright trace", fileMap);
|
|
245
|
+
})
|
|
246
|
+
.catch((e) => console.error("Error uploading playwrighttrace", e));
|
|
247
|
+
};
|
|
243
248
|
// upload index.html
|
|
244
|
-
const uploadIndexTask = async () =>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
"
|
|
249
|
-
process.env.
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
const uploadIndexTask = async () => {
|
|
250
|
+
console.log("Uploading html report");
|
|
251
|
+
return (0, r2_uploader_1.uploadDirectory)({
|
|
252
|
+
sourceDir: this._outputFolder,
|
|
253
|
+
fileList: [path_1.default.join(this._outputFolder, "index.html")],
|
|
254
|
+
destinationDir: process.env.PROJECT_NAME +
|
|
255
|
+
"/" +
|
|
256
|
+
process.env.TEST_RUN_GITHUB_ACTION_ID,
|
|
257
|
+
uploadBucket: "test-report",
|
|
258
|
+
})
|
|
259
|
+
.then((fileMap) => {
|
|
260
|
+
console.log("Finished uploading html report", fileMap);
|
|
261
|
+
})
|
|
262
|
+
.catch((e) => console.error("Error uploading html report", e));
|
|
263
|
+
};
|
|
252
264
|
// upload summary.json
|
|
253
|
-
const uploadSummaryTask = async () =>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
"
|
|
258
|
-
process.env.
|
|
259
|
-
|
|
260
|
-
|
|
265
|
+
const uploadSummaryTask = async () => {
|
|
266
|
+
console.log("Uploading json report");
|
|
267
|
+
return (0, r2_uploader_1.uploadDirectory)({
|
|
268
|
+
sourceDir: this._outputFolder,
|
|
269
|
+
fileList: [path_1.default.join(this._outputFolder, "summary.json")],
|
|
270
|
+
destinationDir: process.env.PROJECT_NAME +
|
|
271
|
+
"/" +
|
|
272
|
+
process.env.TEST_RUN_GITHUB_ACTION_ID,
|
|
273
|
+
uploadBucket: "test-report",
|
|
274
|
+
})
|
|
275
|
+
.then((fileMap) => {
|
|
276
|
+
console.log("Finished uploading json report", fileMap);
|
|
277
|
+
})
|
|
278
|
+
.catch((e) => console.error("Error uploading json report", e));
|
|
279
|
+
};
|
|
280
|
+
console.log("Uploading waiting queue", this.uploadWaitingQueue.length);
|
|
281
|
+
console.log("Uploading execution queue", this.uploadExecutionQueue.length);
|
|
282
|
+
const processQueue = !this.uploadExecutionQueue.length;
|
|
261
283
|
this.uploadWaitingQueue.push(uploadTraceTask);
|
|
262
284
|
this.uploadWaitingQueue.push(uploadIndexTask);
|
|
263
285
|
this.uploadWaitingQueue.push(uploadSummaryTask);
|
|
286
|
+
if (processQueue) {
|
|
287
|
+
this.processQueue();
|
|
288
|
+
}
|
|
264
289
|
console.log("Waiting for all uploads to finish");
|
|
265
290
|
await this.waitForAllTasksToFinish();
|
|
266
291
|
console.log("All uploads finished");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.13",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"playwright-extra": "^4.3.6",
|
|
40
40
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
41
41
|
"@empiricalrun/llm": "^0.9.9",
|
|
42
|
-
"@empiricalrun/r2-uploader": "^0.3.
|
|
42
|
+
"@empiricalrun/r2-uploader": "^0.3.5"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "tsc --build --watch",
|