flakiness 0.220.0 → 0.221.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/lib/cli/cli.js +17 -8
- package/package.json +3 -3
- package/types/tsconfig.tsbuildinfo +1 -1
package/lib/cli/cli.js
CHANGED
|
@@ -1021,14 +1021,16 @@ var WireTypes;
|
|
|
1021
1021
|
})(WireTypes || (WireTypes = {}));
|
|
1022
1022
|
|
|
1023
1023
|
// src/cli/cli.ts
|
|
1024
|
+
import chalk5 from "chalk";
|
|
1024
1025
|
import { Command, Option } from "commander";
|
|
1025
1026
|
import debug2 from "debug";
|
|
1027
|
+
import fs7 from "fs";
|
|
1026
1028
|
import path7 from "path";
|
|
1027
1029
|
|
|
1028
1030
|
// ../package.json
|
|
1029
1031
|
var package_default = {
|
|
1030
1032
|
name: "@flakiness/monorepo",
|
|
1031
|
-
version: "0.
|
|
1033
|
+
version: "0.221.0",
|
|
1032
1034
|
type: "module",
|
|
1033
1035
|
private: true,
|
|
1034
1036
|
scripts: {
|
|
@@ -2221,7 +2223,7 @@ var warn = (txt) => console.warn(chalk4.yellow(`[flakiness.io] WARN: ${txt}`));
|
|
|
2221
2223
|
var err = (txt) => console.error(chalk4.red(`[flakiness.io] Error: ${txt}`));
|
|
2222
2224
|
async function cmdUpload(relativePaths, options) {
|
|
2223
2225
|
const total = relativePaths.length;
|
|
2224
|
-
const spinner =
|
|
2226
|
+
const spinner = options.progress ? ora2("Uploading reports:").start() : void 0;
|
|
2225
2227
|
let uploaded = 0;
|
|
2226
2228
|
let sharedAuth;
|
|
2227
2229
|
async function ensureAuth(flakinessProject) {
|
|
@@ -2252,12 +2254,12 @@ async function cmdUpload(relativePaths, options) {
|
|
|
2252
2254
|
const status = await uploadReport(report, attachments, {
|
|
2253
2255
|
flakinessAccessToken: auth2.accessToken,
|
|
2254
2256
|
flakinessEndpoint: auth2.endpoint,
|
|
2255
|
-
logger: {
|
|
2257
|
+
logger: spinner ? {
|
|
2256
2258
|
log: () => {
|
|
2257
2259
|
},
|
|
2258
2260
|
error: console.error,
|
|
2259
2261
|
warn: console.warn
|
|
2260
|
-
}
|
|
2262
|
+
} : void 0
|
|
2261
2263
|
});
|
|
2262
2264
|
if (status.status === "failed" || status.status === "skipped") {
|
|
2263
2265
|
spinner?.stop();
|
|
@@ -2267,7 +2269,9 @@ async function cmdUpload(relativePaths, options) {
|
|
|
2267
2269
|
if (spinner)
|
|
2268
2270
|
spinner.text = `Uploaded ${Math.floor(uploaded / total * 100)}% [${uploaded}/${total}] reports`;
|
|
2269
2271
|
}
|
|
2270
|
-
spinner
|
|
2272
|
+
if (spinner) {
|
|
2273
|
+
spinner.succeed(`Uploaded ${total} report${total === 1 ? "" : "s"}`);
|
|
2274
|
+
}
|
|
2271
2275
|
}
|
|
2272
2276
|
|
|
2273
2277
|
// src/cli/cli.ts
|
|
@@ -2400,18 +2404,23 @@ program.command("download").description("Download run").addOption(mustFlakinessP
|
|
|
2400
2404
|
accessToken: options.accessToken
|
|
2401
2405
|
});
|
|
2402
2406
|
}));
|
|
2403
|
-
program.command("upload").description("Upload Flakiness report to the flakiness.io service").argument("<relative-paths...>", "Paths to Flakiness report files or directories").addOption(optAccessToken).addOption(optFlakinessProject).addOption(optEndpoint).action(async (relativePaths, options) => {
|
|
2407
|
+
program.command("upload").description("Upload Flakiness report to the flakiness.io service").argument("<relative-paths...>", "Paths to Flakiness report files or directories").addOption(optAccessToken).addOption(optFlakinessProject).addOption(optEndpoint).option("--progress", "Show upload progress spinner instead of printing run URLs").action(async (relativePaths, options) => {
|
|
2404
2408
|
await runCommand(async () => {
|
|
2405
2409
|
await cmdUpload(relativePaths, {
|
|
2406
2410
|
endpoint: options.endpoint,
|
|
2407
2411
|
accessToken: options.accessToken,
|
|
2408
|
-
flakinessProject: options.project
|
|
2412
|
+
flakinessProject: options.project,
|
|
2413
|
+
progress: options.progress
|
|
2409
2414
|
});
|
|
2410
2415
|
});
|
|
2411
2416
|
});
|
|
2412
2417
|
var optViewerUrl = new Option("-e, --viewer-url <url>", "A URL where report viewer is deployed").default("https://report.flakiness.io").env("FLAKINESS_ENDPOINT");
|
|
2413
|
-
program.command("show").description("Show flakiness report").argument("[relative-path]", "Path to the
|
|
2418
|
+
program.command("show").description("Show flakiness report").argument("[relative-path]", "Path to the folder that contains `report.json`", "flakiness-report").addOption(optViewerUrl).action(async (arg, options) => runCommand(async () => {
|
|
2414
2419
|
const dir = path7.resolve(arg ?? "flakiness-report");
|
|
2420
|
+
if (!fs7.existsSync(dir))
|
|
2421
|
+
throw new Error(`Directory ${chalk5.bold(dir)} does not exist`);
|
|
2422
|
+
if (!fs7.existsSync(path7.join(dir, "report.json")))
|
|
2423
|
+
throw new Error(`The folder ${chalk5.bold(dir)} does not contain report.json - is this a Flakiness report folder?`);
|
|
2415
2424
|
await showReport(dir, {
|
|
2416
2425
|
reportViewerUrl: options.viewerUrl
|
|
2417
2426
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flakiness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.221.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"flakiness": "./lib/cli/cli.js"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@types/debug": "^4.1.12",
|
|
24
24
|
"@types/express": "^4.17.20",
|
|
25
25
|
"gray-matter": "^4.0.3",
|
|
26
|
-
"@flakiness/
|
|
27
|
-
"@flakiness/
|
|
26
|
+
"@flakiness/server": "0.221.0",
|
|
27
|
+
"@flakiness/shared": "0.221.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@flakiness/flakiness-report": "^0.28.0",
|