@empiricalrun/playwright-utils 0.58.0 → 0.58.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 +8 -0
- package/dist/generated/api-worker-openapi.d.ts +92 -4
- package/dist/generated/api-worker-openapi.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.js +3 -3
- package/dist/reporter/uploader.d.ts +2 -2
- package/dist/reporter/uploader.d.ts.map +1 -1
- package/dist/reporter/uploader.js +5 -1
- package/package.json +3 -3
|
@@ -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,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAuBnC,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;IAC1C,OAAO,CAAC,kBAAkB,CAA2B;IAGrD,OAAO,CAAC,YAAY,CAAqB;IAEzC,cAEC;IAED,OAAO,CAAC,MAAM,EAAE,UAAU,QAEzB;IAED,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"empirical-reporter.d.ts","sourceRoot":"","sources":["../../src/reporter/empirical-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAuBnC,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;IAC1C,OAAO,CAAC,kBAAkB,CAA2B;IAGrD,OAAO,CAAC,YAAY,CAAqB;IAEzC,cAEC;IAED,OAAO,CAAC,MAAM,EAAE,UAAU,QAEzB;IAED,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,6BAA6B,CA2CnC;IAEF,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,QAqI3C;IAEK,KAAK,CAAC,MAAM,EAAE,UAAU,iBAiH7B;IAED,OAAO,CAAC,qBAAqB;YAkBf,gBAAgB;YAOhB,iBAAiB;CAqChC;eAEc,iBAAiB"}
|
|
@@ -39,7 +39,7 @@ class EmpiricalReporter {
|
|
|
39
39
|
}
|
|
40
40
|
console.log(message);
|
|
41
41
|
}
|
|
42
|
-
enqueTestAttachmentUploadTask = async (attachment) => {
|
|
42
|
+
enqueTestAttachmentUploadTask = async (attachment, keepHot) => {
|
|
43
43
|
if (!this._uploader) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -55,7 +55,7 @@ class EmpiricalReporter {
|
|
|
55
55
|
this._attachmentCleanup.register(attachment);
|
|
56
56
|
const relativePath = path_1.default.relative(this._testResultSourceDir, attachment.path);
|
|
57
57
|
const destinationPath = `data/${relativePath}`;
|
|
58
|
-
const publicUrl = await this._uploader.uploadFile(attachment.path, destinationPath);
|
|
58
|
+
const publicUrl = await this._uploader.uploadFile(attachment.path, destinationPath, keepHot ? "STANDARD" : undefined);
|
|
59
59
|
if (publicUrl) {
|
|
60
60
|
this._attachmentCleanup.markUploaded(attachment.path);
|
|
61
61
|
return { [attachment.path]: publicUrl };
|
|
@@ -77,7 +77,7 @@ class EmpiricalReporter {
|
|
|
77
77
|
try {
|
|
78
78
|
const attachmentPromises = result.attachments.map(async (attachment) => {
|
|
79
79
|
try {
|
|
80
|
-
const fileMap = await this.enqueTestAttachmentUploadTask(attachment);
|
|
80
|
+
const fileMap = await this.enqueTestAttachmentUploadTask(attachment, result.status === "passed");
|
|
81
81
|
if (!fileMap) {
|
|
82
82
|
logger_1.logger.error(`No upload result for ${attachment.name}`);
|
|
83
83
|
return undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorageCredentials } from "@empiricalrun/r2-uploader";
|
|
1
|
+
import { StorageCredentials, UploadStorageClass } from "@empiricalrun/r2-uploader";
|
|
2
2
|
export interface UploaderConfig {
|
|
3
3
|
projectSlug: string;
|
|
4
4
|
runId: string;
|
|
@@ -19,7 +19,7 @@ export declare class Uploader {
|
|
|
19
19
|
get baseUrl(): string;
|
|
20
20
|
get destinationDir(): string;
|
|
21
21
|
get urlPrefix(): string;
|
|
22
|
-
uploadFile(filePath: string, destinationPath: string): Promise<string | null>;
|
|
22
|
+
uploadFile(filePath: string, destinationPath: string, storageClass?: UploadStorageClass): Promise<string | null>;
|
|
23
23
|
uploadDirectory(sourceDir: string, destinationPrefix: string): Promise<void>;
|
|
24
24
|
waitForUploads(): Promise<void>;
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,kBAAkB,EAEnB,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;IAEzC,YAAY,MAAM,EAAE,cAAc,EASjC;IAED,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAKzE;IAED,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,EACvB,YAAY,CAAC,EAAE,kBAAkB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCxB;IAEK,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAef;IAEK,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpC;CACF;AAID,wBAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAM7C"}
|
|
@@ -60,7 +60,7 @@ class Uploader {
|
|
|
60
60
|
get urlPrefix() {
|
|
61
61
|
return `${this._baseUrl}/${this._destinationDir}`;
|
|
62
62
|
}
|
|
63
|
-
async uploadFile(filePath, destinationPath) {
|
|
63
|
+
async uploadFile(filePath, destinationPath, storageClass) {
|
|
64
64
|
try {
|
|
65
65
|
const fullDestinationPath = path_1.default.join(this._destinationDir, destinationPath);
|
|
66
66
|
const sourceDir = path_1.default.dirname(filePath);
|
|
@@ -71,6 +71,10 @@ class Uploader {
|
|
|
71
71
|
uploadBucket: this._uploadBucket,
|
|
72
72
|
baseUrl: this._baseUrl,
|
|
73
73
|
credentials: this._credentials,
|
|
74
|
+
storageClass: this._credentials.provider === "s3" ||
|
|
75
|
+
this._credentials.provider === "s3-iam"
|
|
76
|
+
? storageClass
|
|
77
|
+
: undefined,
|
|
74
78
|
});
|
|
75
79
|
const result = await (0, r2_uploader_1.sendTaskToQueue)(uploadTask);
|
|
76
80
|
if (result) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"ts-morph": "^23.0.0",
|
|
57
57
|
"@empiricalrun/cua": "^0.4.1",
|
|
58
58
|
"@empiricalrun/llm": "^0.27.0",
|
|
59
|
-
"@empiricalrun/
|
|
60
|
-
"@empiricalrun/
|
|
59
|
+
"@empiricalrun/r2-uploader": "^0.10.1",
|
|
60
|
+
"@empiricalrun/reporter": "^0.29.1"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"dev": "pnpm gen:api-worker-openapi && tsgo --build --watch",
|