@midleman/playwright-reporter 0.1.0
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/README.md +373 -0
- package/dist/buffers.d.ts +13 -0
- package/dist/buffers.d.ts.map +1 -0
- package/dist/buffers.js +58 -0
- package/dist/buffers.js.map +1 -0
- package/dist/counts.d.ts +32 -0
- package/dist/counts.d.ts.map +1 -0
- package/dist/counts.js +66 -0
- package/dist/counts.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/payload.d.ts +33 -0
- package/dist/payload.d.ts.map +1 -0
- package/dist/payload.js +87 -0
- package/dist/payload.js.map +1 -0
- package/dist/payload.test.d.ts +2 -0
- package/dist/payload.test.d.ts.map +1 -0
- package/dist/payload.test.js +198 -0
- package/dist/payload.test.js.map +1 -0
- package/dist/reporter.d.ts +47 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/reporter.js +470 -0
- package/dist/reporter.js.map +1 -0
- package/dist/reporter.test.d.ts +2 -0
- package/dist/reporter.test.d.ts.map +1 -0
- package/dist/reporter.test.js +216 -0
- package/dist/reporter.test.js.map +1 -0
- package/dist/schemas.d.ts +485 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +128 -0
- package/dist/schemas.js.map +1 -0
- package/dist/schemas.test.d.ts +2 -0
- package/dist/schemas.test.d.ts.map +1 -0
- package/dist/schemas.test.js +313 -0
- package/dist/schemas.test.js.map +1 -0
- package/dist/storage/api.d.ts +13 -0
- package/dist/storage/api.d.ts.map +1 -0
- package/dist/storage/api.js +86 -0
- package/dist/storage/api.js.map +1 -0
- package/dist/storage/api.test.d.ts +2 -0
- package/dist/storage/api.test.d.ts.map +1 -0
- package/dist/storage/api.test.js +184 -0
- package/dist/storage/api.test.js.map +1 -0
- package/dist/storage/parquet.d.ts +10 -0
- package/dist/storage/parquet.d.ts.map +1 -0
- package/dist/storage/parquet.js +157 -0
- package/dist/storage/parquet.js.map +1 -0
- package/dist/storage/s3.d.ts +35 -0
- package/dist/storage/s3.d.ts.map +1 -0
- package/dist/storage/s3.js +129 -0
- package/dist/storage/s3.js.map +1 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +44 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +195 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +150 -0
- package/dist/utils.test.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResultCreatedEvent, RunStartedEvent, RunCompletedEvent } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Write test results to a Parquet file
|
|
4
|
+
*/
|
|
5
|
+
export declare function writeResultsToParquet(results: ResultCreatedEvent[], filePath: string): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Write run events to a Parquet file
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeRunEventsToParquet(runStarted: RunStartedEvent, runCompleted: RunCompletedEvent | null, filePath: string): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=parquet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet.d.ts","sourceRoot":"","sources":["../../src/storage/parquet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAmElF;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,kBAAkB,EAAE,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,eAAe,EAC3B,YAAY,EAAE,iBAAiB,GAAG,IAAI,EACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeResultsToParquet = writeResultsToParquet;
|
|
4
|
+
exports.writeRunEventsToParquet = writeRunEventsToParquet;
|
|
5
|
+
// Use @dsnp/parquetjs for Parquet file operations
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
|
+
const parquet = require('@dsnp/parquetjs');
|
|
8
|
+
/**
|
|
9
|
+
* Schema for test result events
|
|
10
|
+
*/
|
|
11
|
+
function getResultSchema() {
|
|
12
|
+
return new parquet.ParquetSchema({
|
|
13
|
+
type: { type: 'UTF8' },
|
|
14
|
+
repoName: { type: 'UTF8' },
|
|
15
|
+
runId: { type: 'UTF8' },
|
|
16
|
+
specPath: { type: 'UTF8' },
|
|
17
|
+
project: { type: 'UTF8', optional: true },
|
|
18
|
+
testName: { type: 'UTF8' },
|
|
19
|
+
testId: { type: 'UTF8', optional: true },
|
|
20
|
+
status: { type: 'UTF8' },
|
|
21
|
+
durationMs: { type: 'INT64', optional: true },
|
|
22
|
+
startedAt: { type: 'UTF8', optional: true },
|
|
23
|
+
attempt: { type: 'INT32', optional: true },
|
|
24
|
+
retries: { type: 'INT32', optional: true },
|
|
25
|
+
failureMessage: { type: 'UTF8', optional: true },
|
|
26
|
+
eventId: { type: 'UTF8' },
|
|
27
|
+
timestamp: { type: 'UTF8' },
|
|
28
|
+
browser: { type: 'UTF8', optional: true },
|
|
29
|
+
os: { type: 'UTF8', optional: true },
|
|
30
|
+
branch: { type: 'UTF8', optional: true },
|
|
31
|
+
sha: { type: 'UTF8', optional: true },
|
|
32
|
+
// Phase 3 additions for Test Explorer
|
|
33
|
+
reportUrl: { type: 'UTF8', optional: true },
|
|
34
|
+
commitMessage: { type: 'UTF8', optional: true },
|
|
35
|
+
commitAuthor: { type: 'UTF8', optional: true },
|
|
36
|
+
titlePath: { type: 'UTF8', repeated: true, optional: true },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Schema for run events (started + completed)
|
|
41
|
+
*/
|
|
42
|
+
function getRunSchema() {
|
|
43
|
+
return new parquet.ParquetSchema({
|
|
44
|
+
type: { type: 'UTF8' },
|
|
45
|
+
repoName: { type: 'UTF8' },
|
|
46
|
+
runId: { type: 'UTF8' },
|
|
47
|
+
// run.started fields
|
|
48
|
+
startedAt: { type: 'UTF8', optional: true },
|
|
49
|
+
branch: { type: 'UTF8', optional: true },
|
|
50
|
+
sha: { type: 'UTF8', optional: true },
|
|
51
|
+
workflowName: { type: 'UTF8', optional: true },
|
|
52
|
+
jobName: { type: 'UTF8', optional: true },
|
|
53
|
+
runUrl: { type: 'UTF8', optional: true },
|
|
54
|
+
// Phase 3 additions for Test Explorer
|
|
55
|
+
commitMessage: { type: 'UTF8', optional: true },
|
|
56
|
+
commitAuthor: { type: 'UTF8', optional: true },
|
|
57
|
+
// run.completed fields
|
|
58
|
+
completedAt: { type: 'UTF8', optional: true },
|
|
59
|
+
status: { type: 'UTF8', optional: true },
|
|
60
|
+
durationMs: { type: 'INT64', optional: true },
|
|
61
|
+
countsPassed: { type: 'INT32', optional: true },
|
|
62
|
+
countsFailed: { type: 'INT32', optional: true },
|
|
63
|
+
countsSkipped: { type: 'INT32', optional: true },
|
|
64
|
+
countsFlaky: { type: 'INT32', optional: true },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Write test results to a Parquet file
|
|
69
|
+
*/
|
|
70
|
+
async function writeResultsToParquet(results, filePath) {
|
|
71
|
+
const schema = getResultSchema();
|
|
72
|
+
const writer = await parquet.ParquetWriter.openFile(schema, filePath);
|
|
73
|
+
for (const result of results) {
|
|
74
|
+
await writer.appendRow({
|
|
75
|
+
type: result.type,
|
|
76
|
+
repoName: result.repoName,
|
|
77
|
+
runId: result.runId,
|
|
78
|
+
specPath: result.specPath,
|
|
79
|
+
project: result.project ?? null,
|
|
80
|
+
testName: result.testName,
|
|
81
|
+
testId: result.testId ?? null,
|
|
82
|
+
status: result.status,
|
|
83
|
+
durationMs: result.durationMs ?? null,
|
|
84
|
+
startedAt: result.startedAt ?? null,
|
|
85
|
+
attempt: result.attempt ?? null,
|
|
86
|
+
retries: result.retries ?? null,
|
|
87
|
+
failureMessage: result.failureMessage ?? null,
|
|
88
|
+
eventId: result.eventId,
|
|
89
|
+
timestamp: result.timestamp,
|
|
90
|
+
browser: result.browser ?? null,
|
|
91
|
+
os: result.os ?? null,
|
|
92
|
+
branch: result.branch ?? null,
|
|
93
|
+
sha: result.sha ?? null,
|
|
94
|
+
// Phase 3 additions
|
|
95
|
+
reportUrl: result.reportUrl ?? null,
|
|
96
|
+
commitMessage: result.commitMessage ?? null,
|
|
97
|
+
commitAuthor: result.commitAuthor ?? null,
|
|
98
|
+
titlePath: result.titlePath ?? null,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
await writer.close();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Write run events to a Parquet file
|
|
105
|
+
*/
|
|
106
|
+
async function writeRunEventsToParquet(runStarted, runCompleted, filePath) {
|
|
107
|
+
const schema = getRunSchema();
|
|
108
|
+
const writer = await parquet.ParquetWriter.openFile(schema, filePath);
|
|
109
|
+
// Write run.started
|
|
110
|
+
await writer.appendRow({
|
|
111
|
+
type: runStarted.type,
|
|
112
|
+
repoName: runStarted.repoName,
|
|
113
|
+
runId: runStarted.runId,
|
|
114
|
+
startedAt: runStarted.startedAt,
|
|
115
|
+
branch: runStarted.branch ?? null,
|
|
116
|
+
sha: runStarted.sha ?? null,
|
|
117
|
+
workflowName: runStarted.workflowName ?? null,
|
|
118
|
+
jobName: runStarted.jobName ?? null,
|
|
119
|
+
runUrl: runStarted.runUrl ?? null,
|
|
120
|
+
// Phase 3 additions
|
|
121
|
+
commitMessage: runStarted.commitMessage ?? null,
|
|
122
|
+
commitAuthor: runStarted.commitAuthor ?? null,
|
|
123
|
+
completedAt: null,
|
|
124
|
+
status: null,
|
|
125
|
+
durationMs: null,
|
|
126
|
+
countsPassed: null,
|
|
127
|
+
countsFailed: null,
|
|
128
|
+
countsSkipped: null,
|
|
129
|
+
countsFlaky: null,
|
|
130
|
+
});
|
|
131
|
+
// Write run.completed if available
|
|
132
|
+
if (runCompleted) {
|
|
133
|
+
await writer.appendRow({
|
|
134
|
+
type: runCompleted.type,
|
|
135
|
+
repoName: runCompleted.repoName,
|
|
136
|
+
runId: runCompleted.runId,
|
|
137
|
+
startedAt: null,
|
|
138
|
+
branch: null,
|
|
139
|
+
sha: null,
|
|
140
|
+
workflowName: null,
|
|
141
|
+
jobName: null,
|
|
142
|
+
runUrl: null,
|
|
143
|
+
// Phase 3 additions (null for completed event)
|
|
144
|
+
commitMessage: null,
|
|
145
|
+
commitAuthor: null,
|
|
146
|
+
completedAt: runCompleted.completedAt,
|
|
147
|
+
status: runCompleted.status,
|
|
148
|
+
durationMs: runCompleted.durationMs ?? null,
|
|
149
|
+
countsPassed: runCompleted.counts.passed,
|
|
150
|
+
countsFailed: runCompleted.counts.failed,
|
|
151
|
+
countsSkipped: runCompleted.counts.skipped,
|
|
152
|
+
countsFlaky: runCompleted.counts.flaky,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
await writer.close();
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=parquet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet.js","sourceRoot":"","sources":["../../src/storage/parquet.ts"],"names":[],"mappings":";;AAsEA,sDAqCC;AAKD,0DAyDC;AAvKD,kDAAkD;AAClD,iEAAiE;AACjE,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE3C;;GAEG;AACH,SAAS,eAAe;IACtB,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;QAC/B,IAAI,E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1,35 @@
|
|
|
1
|
+
export interface S3Config {
|
|
2
|
+
bucket: string;
|
|
3
|
+
region?: string;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Upload a file to S3
|
|
8
|
+
*/
|
|
9
|
+
export declare function uploadToS3(config: S3Config, key: string, body: Buffer | string): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Upload a local file to S3
|
|
12
|
+
*/
|
|
13
|
+
export declare function uploadFileToS3(config: S3Config, localPath: string, key: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Storage abstraction that supports both S3 and local filesystem
|
|
16
|
+
*/
|
|
17
|
+
export interface StorageWriter {
|
|
18
|
+
writeFile(key: string, localPath: string): Promise<void>;
|
|
19
|
+
getOutputPath(key: string): string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a storage writer based on configuration
|
|
23
|
+
*/
|
|
24
|
+
export declare function createStorageWriter(s3Config: S3Config | null, localOutputDir: string | null, verbose?: boolean): StorageWriter;
|
|
25
|
+
/**
|
|
26
|
+
* Generate S3 key for a run's results file
|
|
27
|
+
* Format: {repoName}/{date}/{runId}/results.parquet
|
|
28
|
+
*/
|
|
29
|
+
export declare function getResultsKey(repoName: string, date: string, runId: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Generate S3 key for a run's metadata file
|
|
32
|
+
* Format: {repoName}/{date}/{runId}/run.parquet
|
|
33
|
+
*/
|
|
34
|
+
export declare function getRunKey(repoName: string, date: string, runId: string): string;
|
|
35
|
+
//# sourceMappingURL=s3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../src/storage/s3.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAWD;;GAEG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,GAAG,IAAI,EACzB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,OAAO,GAAE,OAAe,GACvB,aAAa,CA2Cf;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/E"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.uploadToS3 = uploadToS3;
|
|
37
|
+
exports.uploadFileToS3 = uploadFileToS3;
|
|
38
|
+
exports.createStorageWriter = createStorageWriter;
|
|
39
|
+
exports.getResultsKey = getResultsKey;
|
|
40
|
+
exports.getRunKey = getRunKey;
|
|
41
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
42
|
+
const fs = __importStar(require("fs/promises"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
let s3Client = null;
|
|
45
|
+
function getS3Client(region) {
|
|
46
|
+
if (!s3Client) {
|
|
47
|
+
s3Client = new client_s3_1.S3Client({ region });
|
|
48
|
+
}
|
|
49
|
+
return s3Client;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Upload a file to S3
|
|
53
|
+
*/
|
|
54
|
+
async function uploadToS3(config, key, body) {
|
|
55
|
+
const client = getS3Client(config.region || 'us-east-1');
|
|
56
|
+
const fullKey = config.prefix ? `${config.prefix}/${key}` : key;
|
|
57
|
+
await client.send(new client_s3_1.PutObjectCommand({
|
|
58
|
+
Bucket: config.bucket,
|
|
59
|
+
Key: fullKey,
|
|
60
|
+
Body: typeof body === 'string' ? Buffer.from(body) : body,
|
|
61
|
+
ContentType: 'application/octet-stream',
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Upload a local file to S3
|
|
66
|
+
*/
|
|
67
|
+
async function uploadFileToS3(config, localPath, key) {
|
|
68
|
+
const content = await fs.readFile(localPath);
|
|
69
|
+
await uploadToS3(config, key, content);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a storage writer based on configuration
|
|
73
|
+
*/
|
|
74
|
+
function createStorageWriter(s3Config, localOutputDir, verbose = false) {
|
|
75
|
+
const log = verbose ? console.log.bind(console, '[reporter]') : () => { };
|
|
76
|
+
if (s3Config) {
|
|
77
|
+
return {
|
|
78
|
+
async writeFile(key, localPath) {
|
|
79
|
+
log(`Uploading to S3: s3://${s3Config.bucket}/${s3Config.prefix || ''}/${key}`);
|
|
80
|
+
await uploadFileToS3(s3Config, localPath, key);
|
|
81
|
+
// Clean up local temp file
|
|
82
|
+
await fs.unlink(localPath).catch(() => { });
|
|
83
|
+
},
|
|
84
|
+
getOutputPath(key) {
|
|
85
|
+
return `s3://${s3Config.bucket}/${s3Config.prefix || ''}/${key}`;
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (localOutputDir) {
|
|
90
|
+
return {
|
|
91
|
+
async writeFile(key, localPath) {
|
|
92
|
+
const destPath = path.join(localOutputDir, key);
|
|
93
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
94
|
+
await fs.rename(localPath, destPath);
|
|
95
|
+
log(`Wrote to local: ${destPath}`);
|
|
96
|
+
},
|
|
97
|
+
getOutputPath(key) {
|
|
98
|
+
return path.join(localOutputDir, key);
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Fallback: write to current directory
|
|
103
|
+
return {
|
|
104
|
+
async writeFile(key, localPath) {
|
|
105
|
+
const destPath = path.join('test-results', key);
|
|
106
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
107
|
+
await fs.rename(localPath, destPath);
|
|
108
|
+
log(`Wrote to local (fallback): ${destPath}`);
|
|
109
|
+
},
|
|
110
|
+
getOutputPath(key) {
|
|
111
|
+
return path.join('test-results', key);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Generate S3 key for a run's results file
|
|
117
|
+
* Format: {repoName}/{date}/{runId}/results.parquet
|
|
118
|
+
*/
|
|
119
|
+
function getResultsKey(repoName, date, runId) {
|
|
120
|
+
return `${repoName}/${date}/${runId}/results.parquet`;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Generate S3 key for a run's metadata file
|
|
124
|
+
* Format: {repoName}/{date}/{runId}/run.parquet
|
|
125
|
+
*/
|
|
126
|
+
function getRunKey(repoName, date, runId) {
|
|
127
|
+
return `${repoName}/${date}/${runId}/run.parquet`;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=s3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../src/storage/s3.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,gCAgBC;AAKD,wCAOC;AAaD,kDA+CC;AAMD,sCAEC;AAMD,8BAEC;AA9HD,kDAAgE;AAChE,gDAAkC;AAClC,2CAA6B;AAQ7B,IAAI,QAAQ,GAAoB,IAAI,CAAC;AAErC,S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CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;YAChD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5D,MAAM,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACrC,GAAG,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,aAAa,CAAC,GAAW;YACvB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,QAAgB,EAAE,IAAY,EAAE,KAAa;IACzE,OAAO,GAAG,QAAQ,IAAI,IAAI,IAAI,KAAK,kBAAkB,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,QAAgB,EAAE,IAAY,EAAE,KAAa;IACrE,OAAO,GAAG,QAAQ,IAAI,IAAI,IAAI,KAAK,cAAc,CAAC;AACpD,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reporter target environment
|
|
3
|
+
* - 'dev': POST to localhost:8000 (local Plumber API)
|
|
4
|
+
* - 'prod': POST to Posit Connect API
|
|
5
|
+
* - 'disabled': Don't write anything
|
|
6
|
+
*/
|
|
7
|
+
export type ReporterMode = 'dev' | 'prod' | 'disabled';
|
|
8
|
+
/** Hardcoded API URLs */
|
|
9
|
+
export declare const API_URLS: {
|
|
10
|
+
readonly dev: "http://localhost:8000";
|
|
11
|
+
readonly prod: "https://connect.posit.it/e2e-test-insights-api";
|
|
12
|
+
};
|
|
13
|
+
/** Reporter configuration options */
|
|
14
|
+
export interface ReporterOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Target environment (required)
|
|
17
|
+
* - 'dev': POST to localhost:8000
|
|
18
|
+
* - 'prod': POST to Posit Connect
|
|
19
|
+
* - 'disabled': Don't write anything
|
|
20
|
+
*/
|
|
21
|
+
mode: ReporterMode;
|
|
22
|
+
/** Repository name override (default: from GITHUB_REPOSITORY) */
|
|
23
|
+
repoName?: string;
|
|
24
|
+
/** Repo-relative test root (autodetected if omitted) */
|
|
25
|
+
testDir?: string;
|
|
26
|
+
/** Enable verbose logging */
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
/** Interval in ms to flush results for "live" updates (default: 5000) */
|
|
29
|
+
flushIntervalMs?: number;
|
|
30
|
+
/** Number of results to buffer before flushing (default: 10) */
|
|
31
|
+
flushThreshold?: number;
|
|
32
|
+
}
|
|
33
|
+
export { ResultStatus, ResultCreatedEvent, RunStartedEvent, RunCompletedEvent, OutboundEvent, Counts, } from './schemas';
|
|
34
|
+
export { validateResultEvent, validateRunStartedEvent, validateRunCompletedEvent, safeValidateResultEvent, safeValidateRunStartedEvent, safeValidateRunCompletedEvent, SCHEMA_VERSION, } from './schemas';
|
|
35
|
+
export { ResultStatusSchema, ResultCreatedEventSchema, RunStartedEventSchema, RunCompletedEventSchema, OutboundEventSchema, CountsSchema, } from './schemas';
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvD,yBAAyB;AACzB,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,GACP,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,cAAc,GACf,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountsSchema = exports.OutboundEventSchema = exports.RunCompletedEventSchema = exports.RunStartedEventSchema = exports.ResultCreatedEventSchema = exports.ResultStatusSchema = exports.SCHEMA_VERSION = exports.safeValidateRunCompletedEvent = exports.safeValidateRunStartedEvent = exports.safeValidateResultEvent = exports.validateRunCompletedEvent = exports.validateRunStartedEvent = exports.validateResultEvent = exports.API_URLS = void 0;
|
|
4
|
+
/** Hardcoded API URLs */
|
|
5
|
+
exports.API_URLS = {
|
|
6
|
+
dev: 'http://localhost:8000',
|
|
7
|
+
prod: 'https://connect.posit.it/e2e-test-insights-api',
|
|
8
|
+
};
|
|
9
|
+
// Re-export validation functions
|
|
10
|
+
var schemas_1 = require("./schemas");
|
|
11
|
+
Object.defineProperty(exports, "validateResultEvent", { enumerable: true, get: function () { return schemas_1.validateResultEvent; } });
|
|
12
|
+
Object.defineProperty(exports, "validateRunStartedEvent", { enumerable: true, get: function () { return schemas_1.validateRunStartedEvent; } });
|
|
13
|
+
Object.defineProperty(exports, "validateRunCompletedEvent", { enumerable: true, get: function () { return schemas_1.validateRunCompletedEvent; } });
|
|
14
|
+
Object.defineProperty(exports, "safeValidateResultEvent", { enumerable: true, get: function () { return schemas_1.safeValidateResultEvent; } });
|
|
15
|
+
Object.defineProperty(exports, "safeValidateRunStartedEvent", { enumerable: true, get: function () { return schemas_1.safeValidateRunStartedEvent; } });
|
|
16
|
+
Object.defineProperty(exports, "safeValidateRunCompletedEvent", { enumerable: true, get: function () { return schemas_1.safeValidateRunCompletedEvent; } });
|
|
17
|
+
Object.defineProperty(exports, "SCHEMA_VERSION", { enumerable: true, get: function () { return schemas_1.SCHEMA_VERSION; } });
|
|
18
|
+
// Re-export Zod schemas for consumers who want direct access
|
|
19
|
+
var schemas_2 = require("./schemas");
|
|
20
|
+
Object.defineProperty(exports, "ResultStatusSchema", { enumerable: true, get: function () { return schemas_2.ResultStatusSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "ResultCreatedEventSchema", { enumerable: true, get: function () { return schemas_2.ResultCreatedEventSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "RunStartedEventSchema", { enumerable: true, get: function () { return schemas_2.RunStartedEventSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "RunCompletedEventSchema", { enumerable: true, get: function () { return schemas_2.RunCompletedEventSchema; } });
|
|
24
|
+
Object.defineProperty(exports, "OutboundEventSchema", { enumerable: true, get: function () { return schemas_2.OutboundEventSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "CountsSchema", { enumerable: true, get: function () { return schemas_2.CountsSchema; } });
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAQA,yBAAyB;AACZ,QAAA,QAAQ,GAAG;IACtB,GAAG,EAAE,uBAAuB;IAC5B,IAAI,EAAE,gDAAgD;CAC9C,CAAC;AAiCX,iCAAiC;AACjC,qCAQmB;AAPjB,8GAAA,mBAAmB,OAAA;AACnB,kHAAA,uBAAuB,OAAA;AACvB,oHAAA,yBAAyB,OAAA;AACzB,kHAAA,uBAAuB,OAAA;AACvB,sHAAA,2BAA2B,OAAA;AAC3B,wHAAA,6BAA6B,OAAA;AAC7B,yGAAA,cAAc,OAAA;AAGhB,6DAA6D;AAC7D,qCAOmB;AANjB,6GAAA,kBAAkB,OAAA;AAClB,mHAAA,wBAAwB,OAAA;AACxB,gHAAA,qBAAqB,OAAA;AACrB,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AACnB,uGAAA,YAAY,OAAA"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Generate ISO timestamp */
|
|
2
|
+
export declare const iso: (d?: string | Date) => string;
|
|
3
|
+
/** Extract short ref from full GitHub ref */
|
|
4
|
+
export declare const shortRef: (ref?: string) => string | undefined;
|
|
5
|
+
/** Generate URL-safe base64 string */
|
|
6
|
+
export declare const b64url: (s: string) => string;
|
|
7
|
+
/** Clamp number to range */
|
|
8
|
+
export declare const clamp: (n: number, lo: number, hi: number) => number;
|
|
9
|
+
/** Infer browser name from Playwright project name */
|
|
10
|
+
export declare const inferBrowserFromProject: (proj?: string) => string | undefined;
|
|
11
|
+
/** Convert absolute spec path to relative path */
|
|
12
|
+
export declare const toRelativeSpec: (repoRoot: string, p: string) => string;
|
|
13
|
+
/** Extract GitHub Actions metadata from environment */
|
|
14
|
+
export declare function getGithubMetadata(): {
|
|
15
|
+
branchName: string | undefined;
|
|
16
|
+
sha: string | undefined;
|
|
17
|
+
workflowName: string | undefined;
|
|
18
|
+
jobName: string | undefined;
|
|
19
|
+
runUrl: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** Get repository name from environment or options */
|
|
22
|
+
export declare function getRepoName(optionValue?: string): string;
|
|
23
|
+
/** Get run ID from environment or generate one */
|
|
24
|
+
export declare function getRunId(): string;
|
|
25
|
+
/** Get current date in YYYY-MM-DD format for partitioning */
|
|
26
|
+
export declare function getDatePartition(): string;
|
|
27
|
+
/** Infer OS from platform or environment */
|
|
28
|
+
export declare function inferOs(): 'mac' | 'win' | 'linux';
|
|
29
|
+
/** Commit info returned from git */
|
|
30
|
+
export interface CommitInfo {
|
|
31
|
+
message?: string;
|
|
32
|
+
author?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get commit info using git commands
|
|
36
|
+
* Works locally and in CI without requiring API tokens
|
|
37
|
+
*/
|
|
38
|
+
export declare function fetchCommitInfo(sha?: string): Promise<CommitInfo>;
|
|
39
|
+
/**
|
|
40
|
+
* Build the report URL for a test in the Playwright HTML report
|
|
41
|
+
* Uses predictable CloudFront URL pattern
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildReportUrl(testId: string): string | undefined;
|
|
44
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,6BAA6B;AAC7B,eAAO,MAAM,GAAG,GAAI,IAAI,MAAM,GAAG,IAAI,WAAiD,CAAC;AAEvF,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,uBAQpC,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,WAC6D,CAAC;AAE9F,4BAA4B;AAC5B,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,WAAkC,CAAC;AAE1F,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,SAWhE,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,GAAG,MAAM,WAMzD,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,iBAAiB;;;;;;EAWhC;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC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