@flakiness/sdk 3.3.1 → 3.5.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 +1 -0
- package/lib/index.js +49 -14
- package/package.json +11 -11
- package/types/src/_internalUtils.d.ts +9 -0
- package/types/src/_internalUtils.d.ts.map +1 -1
- package/types/src/fetchTestDurations.d.ts +12 -6
- package/types/src/fetchTestDurations.d.ts.map +1 -1
- package/types/src/index.d.ts +1 -0
- package/types/src/index.d.ts.map +1 -1
- package/types/src/showReportMessage.d.ts +21 -0
- package/types/src/showReportMessage.d.ts.map +1 -0
package/README.md
CHANGED
|
@@ -105,6 +105,7 @@ Use this entry point when you need to process or manipulate reports in browser-b
|
|
|
105
105
|
- **`fetchTestDurations()`** - Fetch historical test durations from Flakiness.io and return a report enriched with timings
|
|
106
106
|
- **`showReport()`** - Start a local server and open the report in your browser
|
|
107
107
|
- **`showReportCommand()`** - Build a shell command for opening the report later with the Flakiness CLI
|
|
108
|
+
- **`showReportMessage()`** - Build the message a runner prints after writing a report (CI-aware: a one-liner with the report path on CI, open-in-CLI instructions otherwise)
|
|
108
109
|
- **`uploadReport()`** - Upload reports and attachments to Flakiness.io
|
|
109
110
|
- **`writeReport()`** - Write reports to disk in the standard Flakiness report format
|
|
110
111
|
|
package/lib/index.js
CHANGED
|
@@ -218,6 +218,10 @@ function sha1File(filePath) {
|
|
|
218
218
|
});
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
+
function isCI() {
|
|
222
|
+
const ci = (process.env.CI ?? "").toLowerCase();
|
|
223
|
+
return ci !== "" && ci !== "false" && ci !== "0";
|
|
224
|
+
}
|
|
221
225
|
function randomUUIDBase62() {
|
|
222
226
|
const BASE62_CHARSET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
223
227
|
let num = BigInt("0x" + crypto.randomUUID().replace(/-/g, ""));
|
|
@@ -266,6 +270,7 @@ var GitWorktree = class _GitWorktree {
|
|
|
266
270
|
this._gitRoot = _gitRoot;
|
|
267
271
|
this._posixGitRoot = toPosixAbsolutePath(this._gitRoot);
|
|
268
272
|
}
|
|
273
|
+
_gitRoot;
|
|
269
274
|
/**
|
|
270
275
|
* Initializes a GitWorktree for any path inside a git repository and resolves the
|
|
271
276
|
* HEAD commit id in a single call.
|
|
@@ -492,6 +497,8 @@ var GithubOIDC = class _GithubOIDC {
|
|
|
492
497
|
this._requestUrl = _requestUrl;
|
|
493
498
|
this._requestToken = _requestToken;
|
|
494
499
|
}
|
|
500
|
+
_requestUrl;
|
|
501
|
+
_requestToken;
|
|
495
502
|
/**
|
|
496
503
|
* Creates a GithubOIDC instance from GitHub Actions environment variables.
|
|
497
504
|
*
|
|
@@ -921,7 +928,7 @@ async function uploadReport(report, attachments, options) {
|
|
|
921
928
|
if (!flakinessAccessToken && githubOIDC) {
|
|
922
929
|
if (!report.flakinessProject) {
|
|
923
930
|
const reason = "`flakinessProject` is not configured to upload using Github OIDC.";
|
|
924
|
-
if (
|
|
931
|
+
if (isCI())
|
|
925
932
|
logger.warn(`[flakiness.io] \u26A0 Skipping upload: ${reason}`);
|
|
926
933
|
return { status: "skipped", reason };
|
|
927
934
|
}
|
|
@@ -939,7 +946,7 @@ async function uploadReport(report, attachments, options) {
|
|
|
939
946
|
}
|
|
940
947
|
if (!flakinessAccessToken) {
|
|
941
948
|
const reason = "No FLAKINESS_ACCESS_TOKEN found";
|
|
942
|
-
if (
|
|
949
|
+
if (isCI())
|
|
943
950
|
logger.warn(`[flakiness.io] \u26A0 Skipping upload: ${reason}`);
|
|
944
951
|
return { status: "skipped", reason };
|
|
945
952
|
}
|
|
@@ -1089,10 +1096,17 @@ async function fetchTestDurations(report, options) {
|
|
|
1089
1096
|
const githubOIDC = GithubOIDC.initializeFromEnv();
|
|
1090
1097
|
if (!flakinessAccessToken && githubOIDC && report.flakinessProject)
|
|
1091
1098
|
flakinessAccessToken = await githubOIDC.createFlakinessAccessToken(report.flakinessProject);
|
|
1092
|
-
if (!flakinessAccessToken)
|
|
1093
|
-
throw new Error("No Flakiness access token available (set FLAKINESS_ACCESS_TOKEN, pass `flakinessAccessToken`, or run in GitHub Actions with `id-token: write` and a configured `flakinessProject`)");
|
|
1094
1099
|
const flakinessEndpoint = options?.flakinessEndpoint ?? process.env["FLAKINESS_ENDPOINT"] ?? "https://flakiness.io";
|
|
1095
|
-
|
|
1100
|
+
let orgSlug;
|
|
1101
|
+
let projectSlug;
|
|
1102
|
+
if (!flakinessAccessToken) {
|
|
1103
|
+
if (!report.flakinessProject)
|
|
1104
|
+
throw new Error("Cannot fetch test durations: no Flakiness access token, and `report.flakinessProject` is unset so the project cannot be identified. Set FLAKINESS_ACCESS_TOKEN, pass `flakinessAccessToken`, or set `flakinessProject` (anonymous, public projects only).");
|
|
1105
|
+
[orgSlug, projectSlug] = report.flakinessProject.split("/");
|
|
1106
|
+
if (!orgSlug || !projectSlug)
|
|
1107
|
+
throw new Error(`Cannot fetch test durations: \`report.flakinessProject\` must be in "org/project" format, got ${JSON.stringify(report.flakinessProject)}.`);
|
|
1108
|
+
}
|
|
1109
|
+
const fetcher = new TestDurationsFetcher(report, { flakinessAccessToken, flakinessEndpoint, orgSlug, projectSlug });
|
|
1096
1110
|
return await fetcher.fetch();
|
|
1097
1111
|
}
|
|
1098
1112
|
var TestDurationsFetcher = class {
|
|
@@ -1105,12 +1119,12 @@ var TestDurationsFetcher = class {
|
|
|
1105
1119
|
async _api(pathname, token, body) {
|
|
1106
1120
|
const url = new URL3(this._options.flakinessEndpoint);
|
|
1107
1121
|
url.pathname = pathname;
|
|
1122
|
+
const headers = { "Content-Type": "application/json" };
|
|
1123
|
+
if (token)
|
|
1124
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
1108
1125
|
return await getJSON(url, {
|
|
1109
1126
|
method: "POST",
|
|
1110
|
-
headers
|
|
1111
|
-
"Authorization": `Bearer ${token}`,
|
|
1112
|
-
"Content-Type": "application/json"
|
|
1113
|
-
},
|
|
1127
|
+
headers,
|
|
1114
1128
|
body: body ? JSON.stringify(body) : void 0
|
|
1115
1129
|
});
|
|
1116
1130
|
}
|
|
@@ -1124,7 +1138,15 @@ var TestDurationsFetcher = class {
|
|
|
1124
1138
|
const createResponse = await this._api(
|
|
1125
1139
|
"/api/testDurations/create",
|
|
1126
1140
|
this._options.flakinessAccessToken,
|
|
1127
|
-
{
|
|
1141
|
+
{
|
|
1142
|
+
commitId: this._report.commitId,
|
|
1143
|
+
shardGroupKey,
|
|
1144
|
+
// With a token the server resolves the project from it. Anonymous
|
|
1145
|
+
// callers must name the project explicitly; these are undefined (and so
|
|
1146
|
+
// omitted from the JSON) in the authenticated path.
|
|
1147
|
+
orgSlug: this._options.orgSlug,
|
|
1148
|
+
projectSlug: this._options.projectSlug
|
|
1149
|
+
}
|
|
1128
1150
|
);
|
|
1129
1151
|
await this._uploadReport(JSON.stringify(this._report), createResponse.uploadUrl);
|
|
1130
1152
|
const submitResponse = await this._api(
|
|
@@ -1479,12 +1501,24 @@ function quoteShellArgument(argument) {
|
|
|
1479
1501
|
return JSON.stringify(argument);
|
|
1480
1502
|
}
|
|
1481
1503
|
|
|
1504
|
+
// src/showReportMessage.ts
|
|
1505
|
+
import path4 from "node:path";
|
|
1506
|
+
import { styleText as styleText2 } from "node:util";
|
|
1507
|
+
function showReportMessage(reportFolder) {
|
|
1508
|
+
if (isCI())
|
|
1509
|
+
return `Flakiness report written to ${path4.resolve(reportFolder)}`;
|
|
1510
|
+
const command = showReportCommand(reportFolder);
|
|
1511
|
+
return `To open last Flakiness report, run:
|
|
1512
|
+
|
|
1513
|
+
${styleText2("cyan", command)}`;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1482
1516
|
// src/writeReport.ts
|
|
1483
1517
|
import fs8 from "fs";
|
|
1484
|
-
import
|
|
1518
|
+
import path5 from "path";
|
|
1485
1519
|
async function writeReport(report, attachments, outputFolder) {
|
|
1486
|
-
const reportPath =
|
|
1487
|
-
const attachmentsFolder =
|
|
1520
|
+
const reportPath = path5.join(outputFolder, "report.json");
|
|
1521
|
+
const attachmentsFolder = path5.join(outputFolder, "attachments");
|
|
1488
1522
|
await fs8.promises.rm(outputFolder, { recursive: true, force: true });
|
|
1489
1523
|
await fs8.promises.mkdir(outputFolder, { recursive: true });
|
|
1490
1524
|
await fs8.promises.writeFile(reportPath, JSON.stringify(report), "utf-8");
|
|
@@ -1492,7 +1526,7 @@ async function writeReport(report, attachments, outputFolder) {
|
|
|
1492
1526
|
await fs8.promises.mkdir(attachmentsFolder);
|
|
1493
1527
|
const movedAttachments = [];
|
|
1494
1528
|
for (const attachment of attachments) {
|
|
1495
|
-
const attachmentPath =
|
|
1529
|
+
const attachmentPath = path5.join(attachmentsFolder, attachment.id);
|
|
1496
1530
|
if (attachment.type === "file")
|
|
1497
1531
|
await fs8.promises.cp(attachment.path, attachmentPath);
|
|
1498
1532
|
else if (attachment.type === "buffer")
|
|
@@ -1517,6 +1551,7 @@ export {
|
|
|
1517
1551
|
readReport,
|
|
1518
1552
|
showReport,
|
|
1519
1553
|
showReportCommand,
|
|
1554
|
+
showReportMessage,
|
|
1520
1555
|
uploadReport,
|
|
1521
1556
|
writeReport
|
|
1522
1557
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flakiness/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"node": "^20.17.0 || >=22.9.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@flakiness/flakiness-report": "
|
|
32
|
-
"@flakiness/playwright": "^1.
|
|
33
|
-
"@playwright/test": "^1.
|
|
34
|
-
"@types/debug": "^4.1.
|
|
35
|
-
"@types/node": "^25.
|
|
31
|
+
"@flakiness/flakiness-report": "0.35.0",
|
|
32
|
+
"@flakiness/playwright": "^1.14.0",
|
|
33
|
+
"@playwright/test": "^1.61.0",
|
|
34
|
+
"@types/debug": "^4.1.13",
|
|
35
|
+
"@types/node": "^25.9.4",
|
|
36
36
|
"@types/which": "^3.0.4",
|
|
37
|
-
"esbuild": "^0.
|
|
37
|
+
"esbuild": "^0.28.1",
|
|
38
38
|
"kubik": "^0.24.0",
|
|
39
|
-
"tsx": "^4.
|
|
40
|
-
"typescript": "^5.
|
|
39
|
+
"tsx": "^4.22.4",
|
|
40
|
+
"typescript": "^5.9.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@flakiness/flakiness-report": ">=0.26.0 <1.0.0"
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"debug": "^4.4.3",
|
|
47
47
|
"open": "^10.2.0",
|
|
48
48
|
"stable-hash": "^0.0.6",
|
|
49
|
-
"which": "^
|
|
50
|
-
"zod": "^4.3
|
|
49
|
+
"which": "^7.0.0",
|
|
50
|
+
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"minor": "./version.mjs minor",
|
|
@@ -11,5 +11,14 @@ export declare function putBuffer(input: RequestInfo | URL, body: Buffer, header
|
|
|
11
11
|
export declare function shell(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): string | undefined;
|
|
12
12
|
export declare function sha1Text(data: crypto.BinaryLike): string;
|
|
13
13
|
export declare function sha1File(filePath: string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the current process is running on CI.
|
|
16
|
+
*
|
|
17
|
+
* Virtually every CI provider (GitHub Actions, GitLab, CircleCI, …) sets the `CI`
|
|
18
|
+
* environment variable, usually to `true` or `1`. An explicit `false`/`0`/empty
|
|
19
|
+
* value is treated as an opt-out rather than as "on" — `process.env.CI` is a
|
|
20
|
+
* non-empty truthy string in those cases too, so a plain truthiness check is wrong.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isCI(): boolean;
|
|
14
23
|
export declare function randomUUIDBase62(): string;
|
|
15
24
|
//# sourceMappingURL=_internalUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_internalUtils.d.ts","sourceRoot":"","sources":["../../src/_internalUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAM5B,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,IAAI,CAAC,GAAG;IAC/C,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,GAAG,KAAK;CAC/C,CAAC;AAGF,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CASnG;AAED,eAAO,MAAM,YAAY,UAAqC,CAAC;AAY/D,wBAAsB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAK3H;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAU9I;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kCAAkC,sBAWnG;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,UAI/C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAczC"}
|
|
1
|
+
{"version":3,"file":"_internalUtils.d.ts","sourceRoot":"","sources":["../../src/_internalUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAM5B,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,IAAI,CAAC,GAAG;IAC/C,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,GAAG,KAAK;CAC/C,CAAC;AAGF,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CASnG;AAED,eAAO,MAAM,YAAY,UAAqC,CAAC;AAY/D,wBAAsB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAK3H;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAU9I;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,kCAAkC,sBAWnG;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,UAI/C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,IAAI,OAAO,CAG9B;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAczC"}
|
|
@@ -16,9 +16,10 @@ export type FetchTestDurationsOptions = {
|
|
|
16
16
|
* Access token for authenticating with the Flakiness.io platform.
|
|
17
17
|
*
|
|
18
18
|
* Defaults to the `FLAKINESS_ACCESS_TOKEN` environment variable. If no token is provided
|
|
19
|
-
* through this option or the environment variable, the function
|
|
20
|
-
*
|
|
21
|
-
* to be
|
|
19
|
+
* through this option or the environment variable, the function attempts GitHub Actions OIDC
|
|
20
|
+
* when running in GitHub Actions (requires `report.flakinessProject` to be set and the project
|
|
21
|
+
* to be bound to the repository). If no token can be obtained, durations are fetched anonymously
|
|
22
|
+
* using `report.flakinessProject`, which the server only allows for public projects.
|
|
22
23
|
*
|
|
23
24
|
* @example 'flakiness-io-1234567890abcdef...'
|
|
24
25
|
*/
|
|
@@ -32,7 +33,8 @@ export type FetchTestDurationsOptions = {
|
|
|
32
33
|
* finishes at roughly the same time.
|
|
33
34
|
*
|
|
34
35
|
* The function performs the following steps:
|
|
35
|
-
* 1.
|
|
36
|
+
* 1. Resolves credentials: an access token, GitHub Actions OIDC, or anonymous access
|
|
37
|
+
* for public projects.
|
|
36
38
|
* 2. Computes a shard-group key from the report so that all shards of the same run
|
|
37
39
|
* fetch an identical set of timings.
|
|
38
40
|
* 3. Uploads the (compressed) report so the platform knows which tests to time.
|
|
@@ -45,14 +47,18 @@ export type FetchTestDurationsOptions = {
|
|
|
45
47
|
* 1. **Access token** — provided via `flakinessAccessToken` option or `FLAKINESS_ACCESS_TOKEN` env var.
|
|
46
48
|
* 2. **GitHub Actions OIDC** — when running in GitHub Actions with no access token. This requires
|
|
47
49
|
* `report.flakinessProject` to be set and the project to be bound to the GitHub repository.
|
|
50
|
+
* 3. **Anonymous** — when no token can be obtained but `report.flakinessProject` is set. The request
|
|
51
|
+
* names the project via that field and sends no credentials. The server only honors this for public
|
|
52
|
+
* projects, which covers pull requests from forks: GitHub denies them both repository secrets and an
|
|
53
|
+
* OIDC token. Private projects are rejected by the server.
|
|
48
54
|
*
|
|
49
55
|
* @param {FlakinessReport.Report} report - The report describing the tests to fetch durations for.
|
|
50
56
|
* @param {FetchTestDurationsOptions} options - Optional configuration object.
|
|
51
57
|
*
|
|
52
58
|
* @returns {Promise<FlakinessReport.Report>} A report enriched with historical test durations.
|
|
53
59
|
*
|
|
54
|
-
* @throws {Error} If
|
|
55
|
-
* ready within the polling timeout.
|
|
60
|
+
* @throws {Error} If the project cannot be identified (no access token and no `report.flakinessProject`),
|
|
61
|
+
* any API call fails, or the durations are not ready within the polling timeout.
|
|
56
62
|
*
|
|
57
63
|
* @example
|
|
58
64
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchTestDurations.d.ts","sourceRoot":"","sources":["../../src/fetchTestDurations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"fetchTestDurations.d.ts","sourceRoot":"","sources":["../../src/fetchTestDurations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAgB9D;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;;OAUG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAA;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,eAAe,CAAC,MAAM,EAC9B,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CA0BjC"}
|
package/types/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { fetchTestDurations, type FetchTestDurationsOptions } from './fetchTestD
|
|
|
8
8
|
export { readReport } from './readReport.js';
|
|
9
9
|
export { showReport } from './showReport.js';
|
|
10
10
|
export { showReportCommand } from './showReportCommand.js';
|
|
11
|
+
export { showReportMessage } from './showReportMessage.js';
|
|
11
12
|
export { uploadReport } from './uploadReport.js';
|
|
12
13
|
export { writeReport } from './writeReport.js';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/types/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the human-facing message that test runners print after writing a report.
|
|
3
|
+
*
|
|
4
|
+
* In interactive environments this returns instructions for opening the report
|
|
5
|
+
* locally with the Flakiness CLI. On CI (the `CI` environment variable is set to
|
|
6
|
+
* anything other than `false`/`0`), where launching the local viewer isn't useful,
|
|
7
|
+
* it returns a one-liner pointing at the folder the report was written to instead.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} reportFolder - Absolute or relative path to the report folder.
|
|
10
|
+
*
|
|
11
|
+
* @returns {string} A ready-to-print message.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* console.log(showReportMessage('./flakiness-report'));
|
|
16
|
+
* // Interactive: "To open last Flakiness report, run:\n\n npx flakiness show"
|
|
17
|
+
* // On CI: "Flakiness report written to /abs/path/flakiness-report"
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function showReportMessage(reportFolder: string): string;
|
|
21
|
+
//# sourceMappingURL=showReportMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showReportMessage.d.ts","sourceRoot":"","sources":["../../src/showReportMessage.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAM9D"}
|