@empiricalrun/playwright-utils
Advanced tools
Comparing version 0.7.7 to 0.7.8
# @empiricalrun/playwright-utils | ||
## 0.7.8 | ||
### Patch Changes | ||
- ab9e911: fix: handle errors for final uploads and improve upload failure logging | ||
## 0.7.7 | ||
@@ -4,0 +10,0 @@ |
@@ -144,39 +144,44 @@ "use strict"; | ||
}).format(startTime)); | ||
await Promise.allSettled([ | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder + "/trace", | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID + | ||
"/trace", | ||
uploadBucket: "test-report", | ||
}), | ||
// upload index.html | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder, | ||
fileList: [path_1.default.join(this._outputFolder, "index.html")], | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID, | ||
uploadBucket: "test-report", | ||
}), | ||
// upload summary.json | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder, | ||
fileList: [path_1.default.join(this._outputFolder, "summary.json")], | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID, | ||
uploadBucket: "test-report", | ||
}), | ||
]); | ||
const endTime = new Date().getTime(); | ||
console.log("Finished final report upload at: ", new Intl.DateTimeFormat("en-US", { | ||
hour: "2-digit", | ||
minute: "2-digit", | ||
second: "2-digit", | ||
}).format(endTime)); | ||
// time difference | ||
const timeDiff = endTime - startTime; | ||
console.log("Time taken to upload after tests ended: ", timeDiff, "ms"); | ||
try { | ||
await Promise.allSettled([ | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder + "/trace", | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID + | ||
"/trace", | ||
uploadBucket: "test-report", | ||
}), | ||
// upload index.html | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder, | ||
fileList: [path_1.default.join(this._outputFolder, "index.html")], | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID, | ||
uploadBucket: "test-report", | ||
}), | ||
// upload summary.json | ||
(0, upload_1.uploadDirectory)({ | ||
sourceDir: this._outputFolder, | ||
fileList: [path_1.default.join(this._outputFolder, "summary.json")], | ||
destinationDir: process.env.PROJECT_NAME + | ||
"/" + | ||
process.env.TEST_RUN_GITHUB_ACTION_ID, | ||
uploadBucket: "test-report", | ||
}), | ||
]); | ||
const endTime = new Date().getTime(); | ||
console.log("Finished final report upload at: ", new Intl.DateTimeFormat("en-US", { | ||
hour: "2-digit", | ||
minute: "2-digit", | ||
second: "2-digit", | ||
}).format(endTime)); | ||
// time difference | ||
const timeDiff = endTime - startTime; | ||
console.log("Time taken to upload after tests ended: ", timeDiff, "ms"); | ||
} | ||
catch (e) { | ||
// tests shouldn't stop no matter whatever error we get | ||
} | ||
} | ||
@@ -183,0 +188,0 @@ async onExit() { |
@@ -113,2 +113,3 @@ "use strict"; | ||
console.log(`R2 Error - ${file} ${config.sourceDir} ${config.destinationDir} \nError: ${error}`); | ||
console.log("Upload response", error.$response, "with status", error.$metadata.httpStatusCode); | ||
throw error; | ||
@@ -115,0 +116,0 @@ } |
{ | ||
"name": "@empiricalrun/playwright-utils", | ||
"version": "0.7.7", | ||
"version": "0.7.8", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "registry": "https://registry.npmjs.org/", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
97274
2055