@empiricalrun/playwright-utils 0.66.3 → 0.66.4

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.
@@ -0,0 +1,2 @@
1
+ export declare function localRunId(): string | undefined;
2
+ //# sourceMappingURL=local-run-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-run-id.d.ts","sourceRoot":"","sources":["../src/local-run-id.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,IAAI,MAAM,GAAG,SAAS,CAO/C"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localRunId = localRunId;
4
+ const LOCAL_RUN_PREFIX_ENV = "EMPIRICAL_LOCAL_RUN_PREFIX";
5
+ const LOCAL_RUN_ID_ENV = "EMPIRICAL_LOCAL_RUN_ID";
6
+ function localRunId() {
7
+ const prefix = process.env[LOCAL_RUN_PREFIX_ENV];
8
+ if (!prefix) {
9
+ return undefined;
10
+ }
11
+ process.env[LOCAL_RUN_ID_ENV] ??= `${prefix}-${process.pid}`;
12
+ return process.env[LOCAL_RUN_ID_ENV];
13
+ }
@@ -1,4 +1,4 @@
1
- import type { FullConfig, FullResult, Reporter, TestCase, TestResult } from "@playwright/test/reporter";
1
+ import type { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult } from "@playwright/test/reporter";
2
2
  declare class EmpiricalReporter implements Reporter {
3
3
  private _currentWorkingDir;
4
4
  private _outputDirs;
@@ -9,8 +9,10 @@ declare class EmpiricalReporter implements Reporter {
9
9
  private _uploader;
10
10
  private _attachmentCleanup;
11
11
  private _maxFailures;
12
+ private _suite;
13
+ private _reportPaths;
12
14
  constructor();
13
- onBegin(config: FullConfig): void;
15
+ onBegin(config: FullConfig, suite: Suite): void;
14
16
  private _piSandboxLog;
15
17
  private _attachmentWithPath;
16
18
  private enqueTestAttachmentUploadTask;
@@ -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;AA2BnC,cAAM,iBAAkB,YAAW,QAAQ;IACzC,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,WAAW,CAAgB;IACnC,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;IACrD,OAAO,CAAC,YAAY,CAAqB;IAEzC,cAEC;IAED,OAAO,CAAC,MAAM,EAAE,UAAU,QAKzB;IAED,OAAO,CAAC,aAAa;YAUP,mBAAmB;IAoBjC,OAAO,CAAC,6BAA6B,CAiCnC;IAEF,OAAO,CAAC,WAAW;IAMnB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,QAyB7C;IAED,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,QA2I3C;IAEK,KAAK,CAAC,MAAM,EAAE,UAAU,iBAkH7B;IAED,OAAO,CAAC,qBAAqB;YAkBf,gBAAgB;YAOhB,iBAAiB;CAqChC;eAEc,iBAAiB"}
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,KAAK,EACL,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAiCnC,cAAM,iBAAkB,YAAW,QAAQ;IACzC,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,WAAW,CAAgB;IACnC,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;IACrD,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,YAAY,CAElB;IAEF,cAEC;IAED,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,QAUvC;IAED,OAAO,CAAC,aAAa;YAUP,mBAAmB;IAoBjC,OAAO,CAAC,6BAA6B,CAiCnC;IAEF,OAAO,CAAC,WAAW;IAMnB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,QAyB7C;IAED,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,QA4I3C;IAEK,KAAK,CAAC,MAAM,EAAE,UAAU,iBA4H7B;IAED,OAAO,CAAC,qBAAqB;YAkBf,gBAAgB;YAOhB,iBAAiB;CAqChC;eAEc,iBAAiB"}
@@ -13,6 +13,8 @@ const attachment_key_1 = require("./attachment-key");
13
13
  const blob_utils_1 = require("./blob-utils");
14
14
  const failing_line_1 = require("./failing-line");
15
15
  const incremental_blob_reporter_1 = require("./incremental-blob-reporter");
16
+ const local_run_report_1 = require("./local-run-report");
17
+ const report_paths_1 = require("./report-paths");
16
18
  const reporter_state_1 = require("./reporter-state");
17
19
  const uploader_1 = require("./uploader");
18
20
  const util_1 = require("./util");
@@ -26,12 +28,17 @@ class EmpiricalReporter {
26
28
  _uploader = null;
27
29
  _attachmentCleanup = new attachment_cleanup_1.AttachmentCleanup();
28
30
  _maxFailures;
31
+ _suite;
32
+ _reportPaths = (0, report_paths_1.defaultReportPaths)(this._currentWorkingDir);
29
33
  constructor() {
30
34
  this._uploader = (0, uploader_1.getUploader)();
31
35
  }
32
- onBegin(config) {
36
+ onBegin(config, suite) {
33
37
  this._maxFailures = config.maxFailures;
38
+ this._suite = suite;
34
39
  this._outputDirs = (0, attachment_key_1.sortOutputDirs)(config.projects.map((project) => project.outputDir));
40
+ this._reportPaths = (0, report_paths_1.resolveReportPaths)(config, this._currentWorkingDir);
41
+ this._piSandboxLog(`[Empirical Reporter] Local report: ${this._reportPaths.htmlDir}, test output: ${this._outputDirs.join(", ")}`);
35
42
  }
36
43
  _piSandboxLog(message) {
37
44
  const runningInsidePiSandbox = process.env.RUNNING_INSIDE_PI_SANDBOX === "true";
@@ -109,10 +116,7 @@ class EmpiricalReporter {
109
116
  if (!this._uploader) {
110
117
  return;
111
118
  }
112
- if (!process.env.TEST_RUN_GITHUB_ACTION_ID) {
113
- logger_1.logger.debug("[Empirical Reporter] TEST_RUN_GITHUB_ACTION_ID is not set");
114
- return;
115
- }
119
+ const runId = process.env.TEST_RUN_GITHUB_ACTION_ID;
116
120
  const retryIndex = this._testRetryCounts.get(test.id) ?? 0;
117
121
  this._testRetryCounts.set(test.id, retryIndex + 1);
118
122
  try {
@@ -152,7 +156,7 @@ class EmpiricalReporter {
152
156
  return undefined;
153
157
  }
154
158
  });
155
- const testCaseRunEventTask = async () => {
159
+ const testCaseRunEventTask = async (runId) => {
156
160
  const uploadedAttachments = await Promise.all(attachmentPromises);
157
161
  const successfulAttachments = uploadedAttachments.filter((a) => a !== undefined);
158
162
  try {
@@ -201,7 +205,7 @@ class EmpiricalReporter {
201
205
  },
202
206
  projectName,
203
207
  attachments: successfulAttachments,
204
- runId: process.env.TEST_RUN_GITHUB_ACTION_ID,
208
+ runId,
205
209
  failingLine,
206
210
  shardIndex,
207
211
  maxFailures: this._maxFailures,
@@ -212,7 +216,9 @@ class EmpiricalReporter {
212
216
  logger_1.logger.error(`[Empirical Reporter] Error sending test case event for: ${test.title}:`, error);
213
217
  }
214
218
  };
215
- this._pendingTestCaseEvents.push(testCaseRunEventTask());
219
+ this._pendingTestCaseEvents.push(runId
220
+ ? testCaseRunEventTask(runId)
221
+ : Promise.all(attachmentPromises).then(() => undefined));
216
222
  }
217
223
  catch (error) {
218
224
  logger_1.logger.error(`[Empirical Reporter] Error in onTestEnd for ${test.title}:`, error);
@@ -229,18 +235,19 @@ class EmpiricalReporter {
229
235
  logger_1.logger.info(`[Empirical Reporter] Test run completed with status: ${result.status}`);
230
236
  logger_1.logger.debug(`[Empirical Reporter] State: cwd=${this._currentWorkingDir}, hasSharding=${this._hasSharding}`);
231
237
  const startTime = Date.now();
232
- const reportDir = path_1.default.join(this._currentWorkingDir, "playwright-report");
233
- const jsonFilePath = path_1.default.join(reportDir, "summary.json");
234
- const htmlFilePath = path_1.default.join(reportDir, "index.html");
238
+ const jsonFilePath = this._reportPaths.summaryJson;
239
+ const htmlFilePath = path_1.default.join(this._reportPaths.htmlDir, "index.html");
235
240
  const jsonExists = fs_1.default.existsSync(jsonFilePath);
236
241
  const htmlExists = fs_1.default.existsSync(htmlFilePath);
237
242
  if (!htmlExists || !jsonExists) {
238
243
  this._logReportDirContents();
239
244
  }
245
+ let htmlReportUrl = null;
246
+ let summaryJsonUrl = null;
240
247
  if (htmlExists && jsonExists) {
241
248
  logger_1.logger.debug("[Empirical Reporter] Patching HTML with attachment URLs");
242
249
  await (0, util_1.updateHtmlZipFileAttachmentPaths)(jsonFilePath, htmlFilePath, this._outputDirs);
243
- const htmlReportUrl = await this._uploader.uploadFile(htmlFilePath, "index.html");
250
+ htmlReportUrl = await this._uploader.uploadFile(htmlFilePath, "index.html");
244
251
  this._piSandboxLog(`[Empirical Reporter] HTML report URL: ${htmlReportUrl}`);
245
252
  }
246
253
  else if (!htmlExists) {
@@ -249,23 +256,33 @@ class EmpiricalReporter {
249
256
  if (jsonExists) {
250
257
  logger_1.logger.debug("[Empirical Reporter] Patching summary.json with attachment URLs");
251
258
  await (0, util_1.updateSummaryJsonAttachmentPaths)(jsonFilePath, this._outputDirs, `${this._uploader.urlPrefix}/data`);
252
- const summaryJsonUrl = await this._uploader.uploadFile(jsonFilePath, "summary.json");
259
+ summaryJsonUrl = await this._uploader.uploadFile(jsonFilePath, "summary.json");
253
260
  this._piSandboxLog(`[Empirical Reporter] summary.json URL: ${summaryJsonUrl}`);
254
261
  }
255
262
  else {
256
263
  logger_1.logger.error(`[Empirical Reporter] summary.json not found at: ${jsonFilePath}`);
257
264
  }
258
- const traceFilePath = path_1.default.join(this._currentWorkingDir, "playwright-report/trace");
265
+ const traceFilePath = path_1.default.join(this._reportPaths.htmlDir, "trace");
259
266
  const traceExists = await (0, util_1.checkFileExistsAsync)(traceFilePath);
260
267
  if (traceExists) {
261
268
  logger_1.logger.debug("[Empirical Reporter] Uploading Trace folder");
262
269
  await this._uploader.uploadDirectory(traceFilePath, "trace");
263
270
  }
264
271
  else {
265
- logger_1.logger.debug(`[Empirical Reporter] playwright-report/trace does not exist at: ${traceFilePath}`);
272
+ logger_1.logger.debug(`[Empirical Reporter] trace folder does not exist at: ${traceFilePath}`);
266
273
  }
267
274
  await this._uploader.waitForUploads();
268
275
  await Promise.allSettled(this._pendingTestCaseEvents);
276
+ if (this._suite) {
277
+ await (0, local_run_report_1.reportLocalRun)({
278
+ suite: this._suite,
279
+ result,
280
+ reportUrl: htmlReportUrl,
281
+ summaryUrl: summaryJsonUrl,
282
+ outputDirs: this._outputDirs,
283
+ reportDir: this._reportPaths.htmlDir,
284
+ });
285
+ }
269
286
  if (this._hasSharding) {
270
287
  const blobDir = path_1.default.join(this._currentWorkingDir, "blob-report");
271
288
  logger_1.logger.info(`[Empirical Reporter] Sharding enabled, checking for blob-report at: ${blobDir}`);
@@ -287,13 +304,13 @@ class EmpiricalReporter {
287
304
  }
288
305
  _logReportDirContents() {
289
306
  try {
290
- const reportDir = path_1.default.join(this._currentWorkingDir, "playwright-report");
307
+ const reportDir = this._reportPaths.htmlDir;
291
308
  if (fs_1.default.existsSync(reportDir)) {
292
309
  const reportFiles = fs_1.default.readdirSync(reportDir);
293
- logger_1.logger.info(`[Empirical Reporter] Files in playwright-report: ${reportFiles.join(", ")}`);
310
+ logger_1.logger.info(`[Empirical Reporter] Files in ${reportDir}: ${reportFiles.join(", ")}`);
294
311
  }
295
312
  else {
296
- logger_1.logger.warn(`[Empirical Reporter] playwright-report directory does not exist`);
313
+ logger_1.logger.warn(`[Empirical Reporter] Report directory does not exist: ${reportDir}`);
297
314
  }
298
315
  }
299
316
  catch (e) {
@@ -83,6 +83,7 @@ export declare function runPlaywrightClean(ctx: Pick<ParityTestContext, "tempDir
83
83
  export declare function mergeBlobDirToSummary(cwd: string, blobDir: string, outputName: string): Record<string, unknown>;
84
84
  export interface DashboardStub {
85
85
  testCaseEvents: () => Array<Record<string, any>>;
86
+ localRuns: () => Array<Record<string, any>>;
86
87
  completedUploadPaths: () => string[];
87
88
  env: NodeJS.ProcessEnv;
88
89
  close: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/reporter/harness.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACzD,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC,CAaD;AA2CD,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACrE,GAAG,EAAE,uBAAuB,CAAC;IAC7B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC,CAaD;AAED,wBAAs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EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GACA,OAAO,CAAC,cAAc,CAAC,CA+BzB;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACjD,SAAS,EAAE,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5C,oBAAoB,EAAE,MAAM,MAAM,EAAE,CAAC;IACrC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,wBAAsB,kBAAkB,CAAC,EACvC,oBAAoB,EACpB,YAAgB,GACjB,GAAE;IACD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,aAAa,CAAC,CAmF9B"}
@@ -314,6 +314,7 @@ function mergeBlobDirToSummary(cwd, blobDir, outputName) {
314
314
  }
315
315
  async function startDashboardStub({ slowUploadPathSuffix, slowUploadMs = 0, } = {}) {
316
316
  const events = [];
317
+ const localRuns = [];
317
318
  const completedUploadPaths = [];
318
319
  const respondToUpload = (req, res, uploadPath) => {
319
320
  completedUploadPaths.push(uploadPath);
@@ -339,6 +340,10 @@ async function startDashboardStub({ slowUploadPathSuffix, slowUploadMs = 0, } =
339
340
  events.push(body.data);
340
341
  }
341
342
  }
343
+ if (req.method === "POST" &&
344
+ req.url === "/api/test-reports/local-runs") {
345
+ localRuns.push(JSON.parse(Buffer.concat(chunks).toString("utf8")));
346
+ }
342
347
  res.writeHead(200, { "content-type": "application/json" });
343
348
  res.end("{}");
344
349
  return;
@@ -353,6 +358,7 @@ async function startDashboardStub({ slowUploadPathSuffix, slowUploadMs = 0, } =
353
358
  const url = `http://127.0.0.1:${server.address().port}`;
354
359
  return {
355
360
  testCaseEvents: () => [...events],
361
+ localRuns: () => [...localRuns],
356
362
  completedUploadPaths: () => [...completedUploadPaths],
357
363
  env: {
358
364
  PROJECT_NAME: "reporter-test",
@@ -0,0 +1,10 @@
1
+ import type { FullResult, Suite } from "@playwright/test/reporter";
2
+ export declare function reportLocalRun({ suite, result, reportUrl, summaryUrl, outputDirs, reportDir, }: {
3
+ suite: Suite;
4
+ result: FullResult;
5
+ reportUrl: string | null;
6
+ summaryUrl: string | null;
7
+ outputDirs: string[];
8
+ reportDir: string;
9
+ }): Promise<void>;
10
+ //# sourceMappingURL=local-run-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-run-report.d.ts","sourceRoot":"","sources":["../../src/reporter/local-run-report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAsBnE,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhB"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reportLocalRun = reportLocalRun;
4
+ const api_worker_client_1 = require("../api-worker-client");
5
+ const local_run_id_1 = require("../local-run-id");
6
+ const logger_1 = require("../logger");
7
+ function countOutcomes(suite) {
8
+ const counts = { passed: 0, failed: 0, flaky: 0, skipped: 0 };
9
+ for (const test of suite.allTests()) {
10
+ const outcome = test.outcome();
11
+ if (outcome === "expected") {
12
+ counts.passed++;
13
+ }
14
+ else if (outcome === "unexpected") {
15
+ counts.failed++;
16
+ }
17
+ else if (outcome === "flaky") {
18
+ counts.flaky++;
19
+ }
20
+ else {
21
+ counts.skipped++;
22
+ }
23
+ }
24
+ return counts;
25
+ }
26
+ async function reportLocalRun({ suite, result, reportUrl, summaryUrl, outputDirs, reportDir, }) {
27
+ const runId = (0, local_run_id_1.localRunId)();
28
+ const toolCallId = process.env.EMPIRICAL_TOOL_CALL_ID;
29
+ if (!runId || !toolCallId || !process.env.EMPIRICALRUN_API_KEY) {
30
+ return;
31
+ }
32
+ try {
33
+ await new api_worker_client_1.ApiWorkerClient().reportLocalTestRun({
34
+ tool_call_id: toolCallId,
35
+ run_id: runId,
36
+ status: result.status,
37
+ counts: countOutcomes(suite),
38
+ report_url: reportUrl,
39
+ summary_url: summaryUrl,
40
+ output_dirs: outputDirs,
41
+ report_dir: reportDir,
42
+ });
43
+ }
44
+ catch (error) {
45
+ logger_1.logger.warn(`[Empirical Reporter] Could not report local run ${runId} to the session:`, error);
46
+ }
47
+ }
@@ -0,0 +1,8 @@
1
+ import type { FullConfig } from "@playwright/test/reporter";
2
+ export type ReportPaths = {
3
+ htmlDir: string;
4
+ summaryJson: string;
5
+ };
6
+ export declare function defaultReportPaths(cwd: string): ReportPaths;
7
+ export declare function resolveReportPaths(config: FullConfig, cwd: string): ReportPaths;
8
+ //# sourceMappingURL=report-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-paths.d.ts","sourceRoot":"","sources":["../../src/reporter/report-paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,MAAM,MAAM,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AA0DnE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAG3D;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,GACV,WAAW,CASb"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.defaultReportPaths = defaultReportPaths;
7
+ exports.resolveReportPaths = resolveReportPaths;
8
+ const path_1 = __importDefault(require("path"));
9
+ const util_1 = require("./util");
10
+ function reporterOptions(config, name) {
11
+ const entry = config.reporter.find(([reporterName]) => reporterName === name);
12
+ return entry ? (entry[1] ?? {}) : undefined;
13
+ }
14
+ function resolveFromEnv(name) {
15
+ const value = process.env[name];
16
+ return value ? path_1.default.resolve(value) : undefined;
17
+ }
18
+ function htmlDir(options, configDir) {
19
+ return (resolveFromEnv("PLAYWRIGHT_HTML_OUTPUT_DIR") ??
20
+ resolveFromEnv("PLAYWRIGHT_HTML_REPORT") ??
21
+ (0, util_1.resolveReporterOutputPath)("playwright-report", configDir, options.outputFolder));
22
+ }
23
+ function jsonFile(options, configDir) {
24
+ const file = resolveFromEnv("PLAYWRIGHT_JSON_OUTPUT_FILE") ??
25
+ (options.outputFile
26
+ ? path_1.default.resolve(configDir, options.outputFile)
27
+ : undefined);
28
+ if (file) {
29
+ return file;
30
+ }
31
+ const name = process.env.PLAYWRIGHT_JSON_OUTPUT_NAME ?? options.fileName;
32
+ if (!name) {
33
+ return undefined;
34
+ }
35
+ const dir = resolveFromEnv("PLAYWRIGHT_JSON_OUTPUT_DIR") ??
36
+ (options.outputDir
37
+ ? path_1.default.resolve(configDir, options.outputDir)
38
+ : configDir);
39
+ return path_1.default.resolve(dir, name);
40
+ }
41
+ function defaultReportPaths(cwd) {
42
+ const htmlDir = path_1.default.join(cwd, "playwright-report");
43
+ return { htmlDir, summaryJson: path_1.default.join(htmlDir, "summary.json") };
44
+ }
45
+ function resolveReportPaths(config, cwd) {
46
+ const configDir = config.configFile ? path_1.default.dirname(config.configFile) : cwd;
47
+ const defaults = defaultReportPaths(cwd);
48
+ const html = reporterOptions(config, "html");
49
+ const json = reporterOptions(config, "json");
50
+ return {
51
+ htmlDir: html ? htmlDir(html, configDir) : defaults.htmlDir,
52
+ summaryJson: (json && jsonFile(json, configDir)) ?? defaults.summaryJson,
53
+ };
54
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAWvD,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAE5E,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,mBAAmB,CAAC;CAClC;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAsB;IAE1C,YAAY,MAAM,EAAE,cAAc,EAUjC;IAED,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,GA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AC,MAAM,CAAS;IACvB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAsB;IAE1C,YAAY,MAAM,EAAE,cAAc,EAUjC;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;IAED,OAAO,CAAC,cAAc;IAoBhB,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,kBAAkB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyCxB;IAEK,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAyBf;IAEK,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAyBpC;CACF;AAID,wBAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAM7C;AAED,wBAAgB,cAAc,IAAI,QAAQ,GAAG,IAAI,CAiEhD"}
@@ -9,6 +9,7 @@ exports.createUploader = createUploader;
9
9
  const r2_uploader_1 = require("@empiricalrun/r2-uploader");
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const api_worker_client_1 = require("../api-worker-client");
12
+ const local_run_id_1 = require("../local-run-id");
12
13
  const logger_1 = require("../logger");
13
14
  const presigned_upload_1 = require("./presigned-upload");
14
15
  const R2_REPORTS_BASE_URL = "https://reports-r2.empirical.run";
@@ -169,7 +170,8 @@ function createUploader() {
169
170
  logger_1.logger.debug("[Uploader] Reporter disabled for --list command");
170
171
  return null;
171
172
  }
172
- if (!process.env.PROJECT_NAME || !process.env.TEST_RUN_GITHUB_ACTION_ID) {
173
+ const runId = process.env.TEST_RUN_GITHUB_ACTION_ID ?? (0, local_run_id_1.localRunId)();
174
+ if (!process.env.PROJECT_NAME || !runId) {
173
175
  logger_1.logger.debug("[Uploader] PROJECT_NAME and TEST_RUN_GITHUB_ACTION_ID must be set");
174
176
  return null;
175
177
  }
@@ -179,7 +181,7 @@ function createUploader() {
179
181
  return null;
180
182
  }
181
183
  if (backend === "r2" && process.env.REPORT_UPLOAD_PRESIGNED === "true") {
182
- return createPresignedUploader(process.env.PROJECT_NAME, process.env.TEST_RUN_GITHUB_ACTION_ID);
184
+ return createPresignedUploader(process.env.PROJECT_NAME, runId);
183
185
  }
184
186
  const enableS3 = backend === "s3";
185
187
  const credentials = Uploader.getCredentialsFromEnv(enableS3);
@@ -214,7 +216,7 @@ function createUploader() {
214
216
  }
215
217
  return new Uploader({
216
218
  projectSlug: process.env.PROJECT_NAME,
217
- runId: process.env.TEST_RUN_GITHUB_ACTION_ID,
219
+ runId,
218
220
  baseUrl,
219
221
  uploadBucket,
220
222
  credentials,
@@ -28,5 +28,5 @@ export declare function safelySerialiseJSON(obj: any, keyFilter?: (key: string)
28
28
  export declare function updateHtmlZipFileAttachmentPaths(jsonFilePath: string, htmlFilePath: string, outputDirs: string[]): Promise<void>;
29
29
  export declare function buildTestAttachmentMapFromSummary(summaryJsonFilePath: string, outputDirs: string[], doNotNormalize?: boolean): TestAttachmentMap;
30
30
  export declare function checkFileExistsAsync(filePath: string): Promise<boolean>;
31
- export declare function updateSummaryJsonAttachmentPaths(filePath: string, outputDirs: string[], urlPrefix: string): Promise<PlaywrightJSONReport | undefined>;
31
+ export declare function updateSummaryJsonAttachmentPaths(filePath: string, outputDirs: string[], urlPrefix: string): Promise<PlaywrightJSONReport>;
32
32
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAI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async function checkFileExistsAsync(filePath) {
267
267
  }
268
268
  }
269
269
  async function updateSummaryJsonAttachmentPaths(filePath, outputDirs, urlPrefix) {
270
- if (!process.env.PROJECT_NAME || !process.env.TEST_RUN_GITHUB_ACTION_ID) {
271
- console.error("PROJECT_NAME and TEST_RUN_GITHUB_ACTION_ID must be set");
272
- return;
273
- }
274
270
  const summaryJson = JSON.parse(await fs_1.default.promises.readFile(filePath, "utf8"));
275
271
  (0, reporter_1.traverseJsonReportSuites)(summaryJson, (spec) => {
276
272
  for (const test of spec.tests) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.66.3",
3
+ "version": "0.66.4",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },
@@ -45,7 +45,7 @@
45
45
  "playwright-core": "1.64.1",
46
46
  "serve-handler": "^6.1.6",
47
47
  "typescript": "7.0.2",
48
- "@empiricalrun/shared-types": "0.24.2"
48
+ "@empiricalrun/shared-types": "0.24.3"
49
49
  },
50
50
  "dependencies": {
51
51
  "async-retry": "^1.3.3",
@@ -56,9 +56,9 @@
56
56
  "openapi-fetch": "0.14.1",
57
57
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
58
58
  "ts-morph": "^28.0.0",
59
- "@empiricalrun/cua": "^0.6.0",
60
59
  "@empiricalrun/r2-uploader": "^0.11.5",
61
- "@empiricalrun/reporter": "^0.30.3"
60
+ "@empiricalrun/reporter": "^0.30.3",
61
+ "@empiricalrun/cua": "^0.6.0"
62
62
  },
63
63
  "scripts": {
64
64
  "dev": "pnpm gen:api-worker-openapi && tsc --build --watch",