@empiricalrun/playwright-utils 0.14.10 → 0.14.12
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 +48 -30
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.14.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53cfe45: fix: add contextual errors for report upload
|
|
8
|
+
- 5901db5: fix: add logs for uploader
|
|
9
|
+
- Updated dependencies [5901db5]
|
|
10
|
+
- @empiricalrun/r2-uploader@0.3.5
|
|
11
|
+
|
|
12
|
+
## 0.14.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 6a838c2: chore: add logs for test run uploader job failure
|
|
17
|
+
|
|
3
18
|
## 0.14.10
|
|
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,SA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EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IASxD,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIzB,KAAK,CAAC,MAAM,EAAE,UAAU;IAgHxB,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
|
@@ -81,9 +81,8 @@ class HtmlReporter {
|
|
|
81
81
|
const task = this.uploadWaitingQueue.shift();
|
|
82
82
|
if (task) {
|
|
83
83
|
const promise = task()
|
|
84
|
-
.catch(() => {
|
|
85
|
-
|
|
86
|
-
// console.log("Upload failed", e); // error is already logged in the upload function
|
|
84
|
+
.catch((e) => {
|
|
85
|
+
console.error("Error in processing task", e);
|
|
87
86
|
})
|
|
88
87
|
.finally(() => {
|
|
89
88
|
// console.log("Finished upload execution from waiting queue"); // we already log in the upload function on successful upload
|
|
@@ -152,8 +151,7 @@ class HtmlReporter {
|
|
|
152
151
|
// this.retryTask(uploadTask); // Retry logic
|
|
153
152
|
})
|
|
154
153
|
.finally(() => {
|
|
155
|
-
//
|
|
156
|
-
// console.log("Finished upload execution for ", attachment.path);
|
|
154
|
+
// this is a list of promises which we dont want to await right now
|
|
157
155
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
158
156
|
this.uploadExecutionQueue = this.uploadExecutionQueue.filter((p) => p !== promise);
|
|
159
157
|
this.processQueue(); // Keep processing queue
|
|
@@ -232,33 +230,53 @@ class HtmlReporter {
|
|
|
232
230
|
try {
|
|
233
231
|
console.log("uploading path", this._outputFolder);
|
|
234
232
|
console.log(listFilesRecursively(this._outputFolder));
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
+
};
|
|
244
248
|
// upload index.html
|
|
245
|
-
const uploadIndexTask = async () =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
"
|
|
250
|
-
process.env.
|
|
251
|
-
|
|
252
|
-
|
|
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
|
+
};
|
|
253
264
|
// upload summary.json
|
|
254
|
-
const uploadSummaryTask = async () =>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"
|
|
259
|
-
process.env.
|
|
260
|
-
|
|
261
|
-
|
|
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
|
+
};
|
|
262
280
|
this.uploadWaitingQueue.push(uploadTraceTask);
|
|
263
281
|
this.uploadWaitingQueue.push(uploadIndexTask);
|
|
264
282
|
this.uploadWaitingQueue.push(uploadSummaryTask);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.12",
|
|
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",
|