flakiness 0.255.0 → 0.257.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 +9 -23
- package/lib/cli/cli.js +23 -19
- package/lib/junit.js +0 -8
- package/package.json +5 -5
- package/types/tsconfig.tsbuildinfo +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ flakiness upload ./flakiness-report/report.json
|
|
|
44
44
|
flakiness upload ./report.json --endpoint https://custom.flakiness.io
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
The CLI supports **GitHub OIDC** authentication: when running in GitHub Actions with `id-token: write` permission and the report contains a `flakinessProject` field, the CLI automatically authenticates without an access token. Reporters set `flakinessProject` automatically
|
|
47
|
+
The CLI supports **GitHub OIDC** authentication: when running in GitHub Actions with `id-token: write` permission and the report contains a `flakinessProject` field, the CLI automatically authenticates without an access token. Reporters set `flakinessProject` automatically.
|
|
48
48
|
|
|
49
49
|
**Options:**
|
|
50
50
|
- `-t, --access-token <token>` — Read-write access token (env: `FLAKINESS_ACCESS_TOKEN`)
|
|
@@ -79,34 +79,20 @@ flakiness show ./path/to/report
|
|
|
79
79
|
|
|
80
80
|
### Convert JUnit XML
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
flakiness convert-junit ./test-results/
|
|
90
|
-
|
|
91
|
-
# With options
|
|
92
|
-
flakiness convert-junit ./junit.xml \
|
|
93
|
-
--env-name "CI" \
|
|
94
|
-
--commit-id abc123 \
|
|
95
|
-
--output-dir ./flakiness-report
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**Options:**
|
|
99
|
-
- `--env-name <name>` — Environment name for the report (default: `junit`)
|
|
100
|
-
- `--commit-id <id>` — Git commit ID (auto-detected if not provided)
|
|
101
|
-
- `--output-dir <dir>` — Output directory (default: `flakiness-report`)
|
|
102
|
-
- `--project <org/project>` — Flakiness.io project slug for OIDC uploads (env: `FLAKINESS_PROJECT`)
|
|
82
|
+
> **Deprecated.** `flakiness convert-junit` is deprecated and will be removed in
|
|
83
|
+
> a future release. Use [`@flakiness/junit-xml`](https://github.com/flakiness/junit-xml)
|
|
84
|
+
> instead — it converts JUnit XML and uploads it to flakiness.io in a single step:
|
|
85
|
+
>
|
|
86
|
+
> ```bash
|
|
87
|
+
> npx @flakiness/junit-xml --flakiness-project myorg/myproject ./test-results
|
|
88
|
+
> ```
|
|
103
89
|
|
|
104
90
|
## Environment Variables
|
|
105
91
|
|
|
106
92
|
| Variable | Description |
|
|
107
93
|
|----------|-------------|
|
|
108
94
|
| `FLAKINESS_ACCESS_TOKEN` | Read-write access token for authentication |
|
|
109
|
-
| `FLAKINESS_PROJECT` | Flakiness.io project in `org/project` format (for OIDC
|
|
95
|
+
| `FLAKINESS_PROJECT` | Flakiness.io project in `org/project` format (for OIDC uploads) |
|
|
110
96
|
| `FLAKINESS_ENDPOINT` | Custom service endpoint URL |
|
|
111
97
|
|
|
112
98
|
## License
|
package/lib/cli/cli.js
CHANGED
|
@@ -1024,7 +1024,7 @@ var WireTypes;
|
|
|
1024
1024
|
})(WireTypes || (WireTypes = {}));
|
|
1025
1025
|
|
|
1026
1026
|
// src/cli/cli.ts
|
|
1027
|
-
import { styleText as
|
|
1027
|
+
import { styleText as styleText6 } from "node:util";
|
|
1028
1028
|
import { Command, Option } from "commander";
|
|
1029
1029
|
import debug2 from "debug";
|
|
1030
1030
|
import fs7 from "fs";
|
|
@@ -1033,7 +1033,7 @@ import path7 from "path";
|
|
|
1033
1033
|
// ../package.json
|
|
1034
1034
|
var package_default = {
|
|
1035
1035
|
name: "@flakiness/monorepo",
|
|
1036
|
-
version: "0.
|
|
1036
|
+
version: "0.257.0",
|
|
1037
1037
|
type: "module",
|
|
1038
1038
|
private: true,
|
|
1039
1039
|
scripts: {
|
|
@@ -1053,12 +1053,12 @@ var package_default = {
|
|
|
1053
1053
|
devDependencies: {
|
|
1054
1054
|
"@flakiness/playwright": "catalog:",
|
|
1055
1055
|
"@playwright/test": "catalog:",
|
|
1056
|
-
"@types/node": "^22.19.
|
|
1056
|
+
"@types/node": "^22.19.19",
|
|
1057
1057
|
esbuild: "^0.27.7",
|
|
1058
1058
|
flakiness: "workspace:*",
|
|
1059
1059
|
kubik: "^0.24.0",
|
|
1060
1060
|
"smee-client": "^5.0.0",
|
|
1061
|
-
tsx: "^4.
|
|
1061
|
+
tsx: "^4.22.2",
|
|
1062
1062
|
typescript: "^5.9.3"
|
|
1063
1063
|
}
|
|
1064
1064
|
};
|
|
@@ -1516,6 +1516,7 @@ async function cmdAuthLogin(endpoint = DEFAULT_FLAKINESS_ENDPOINT) {
|
|
|
1516
1516
|
// src/cli/cmd-convert.ts
|
|
1517
1517
|
import { CIUtils, GitWorktree, ReportUtils as ReportUtils2, writeReport } from "@flakiness/sdk";
|
|
1518
1518
|
import fs3 from "fs/promises";
|
|
1519
|
+
import { styleText as styleText3 } from "node:util";
|
|
1519
1520
|
import path3 from "path";
|
|
1520
1521
|
|
|
1521
1522
|
// src/junit.ts
|
|
@@ -1643,14 +1644,6 @@ async function traverseJUnitReport(context, node) {
|
|
|
1643
1644
|
report.suites.push(newSuite);
|
|
1644
1645
|
}
|
|
1645
1646
|
currentSuite = newSuite;
|
|
1646
|
-
const metadata = getProperties(element);
|
|
1647
|
-
if (metadata.length) {
|
|
1648
|
-
currentEnv = structuredClone(currentEnv);
|
|
1649
|
-
currentEnv.metadata ??= {};
|
|
1650
|
-
for (const [key, value] of metadata)
|
|
1651
|
-
currentEnv.metadata[key] = value;
|
|
1652
|
-
currentEnvIndex = report.environments.push(currentEnv) - 1;
|
|
1653
|
-
}
|
|
1654
1647
|
} else if (element.name === "testcase") {
|
|
1655
1648
|
assert(currentSuite);
|
|
1656
1649
|
const file = element.attributes["file"];
|
|
@@ -1763,7 +1756,16 @@ async function parseJUnit(xmls, options) {
|
|
|
1763
1756
|
}
|
|
1764
1757
|
|
|
1765
1758
|
// src/cli/cmd-convert.ts
|
|
1759
|
+
var DEPRECATION_WARNING = `[flakiness.io] WARN: \`convert-junit\` is deprecated and will be removed in a future release.
|
|
1760
|
+
|
|
1761
|
+
Migrate to @flakiness/junit-xml \u2014 it converts AND uploads in a single step:
|
|
1762
|
+
|
|
1763
|
+
npx @flakiness/junit-xml --flakiness-project <org/project> <path>
|
|
1764
|
+
|
|
1765
|
+
Docs: https://github.com/flakiness/junit-xml
|
|
1766
|
+
`;
|
|
1766
1767
|
async function cmdConvert(junitPath, options) {
|
|
1768
|
+
console.warn(styleText3("yellow", DEPRECATION_WARNING));
|
|
1767
1769
|
const fullPath = path3.resolve(junitPath);
|
|
1768
1770
|
if (!await fs3.access(fullPath, fs3.constants.F_OK).then(() => true).catch(() => false)) {
|
|
1769
1771
|
console.error(`Error: path ${fullPath} is not accessible`);
|
|
@@ -1806,9 +1808,11 @@ async function cmdConvert(junitPath, options) {
|
|
|
1806
1808
|
defaultEnv: ReportUtils2.createEnvironment({ name: options.envName }),
|
|
1807
1809
|
runStartTimestamp: Date.now(),
|
|
1808
1810
|
runDuration: 0,
|
|
1811
|
+
runUrl: CIUtils.runUrl(),
|
|
1809
1812
|
category: options.category
|
|
1810
1813
|
});
|
|
1811
1814
|
report.title = options.title ?? CIUtils.runTitle();
|
|
1815
|
+
report.generatedBy = { name: "flakiness CLI", version: package_default.version };
|
|
1812
1816
|
if (options.flakinessProject)
|
|
1813
1817
|
report.flakinessProject = options.flakinessProject;
|
|
1814
1818
|
await writeReport(report, attachments, options.outputDir);
|
|
@@ -2174,7 +2178,7 @@ function asInlineCode(text) {
|
|
|
2174
2178
|
|
|
2175
2179
|
// src/cli/cmd-skills-install.ts
|
|
2176
2180
|
import { execSync } from "child_process";
|
|
2177
|
-
import { styleText as
|
|
2181
|
+
import { styleText as styleText4 } from "node:util";
|
|
2178
2182
|
import fs5 from "fs";
|
|
2179
2183
|
import os3 from "os";
|
|
2180
2184
|
import path5 from "path";
|
|
@@ -2220,19 +2224,19 @@ async function cmdSkillsInstall(options) {
|
|
|
2220
2224
|
await fs5.promises.mkdir(path5.dirname(filePath), { recursive: true });
|
|
2221
2225
|
await fs5.promises.writeFile(filePath, file.content);
|
|
2222
2226
|
}
|
|
2223
|
-
console.log(`${
|
|
2227
|
+
console.log(`${styleText4("green", "\u2713")} Installed ${styleText4("bold", skill.name)} \u2192 ${styleText4("dim", dest)}`);
|
|
2224
2228
|
}
|
|
2225
2229
|
console.log("\nRestart your agent to pick up new skills.");
|
|
2226
2230
|
}
|
|
2227
2231
|
|
|
2228
2232
|
// src/cli/cmd-upload.ts
|
|
2229
2233
|
import { readReport, uploadReport } from "@flakiness/sdk";
|
|
2230
|
-
import { styleText as
|
|
2234
|
+
import { styleText as styleText5 } from "node:util";
|
|
2231
2235
|
import fs6 from "fs/promises";
|
|
2232
2236
|
import ora2 from "ora";
|
|
2233
2237
|
import path6 from "path";
|
|
2234
|
-
var warn = (txt) => console.warn(
|
|
2235
|
-
var err = (txt) => console.error(
|
|
2238
|
+
var warn = (txt) => console.warn(styleText5("yellow", `[flakiness.io] WARN: ${txt}`));
|
|
2239
|
+
var err = (txt) => console.error(styleText5("red", `[flakiness.io] Error: ${txt}`));
|
|
2236
2240
|
async function cmdUpload(relativePaths, options) {
|
|
2237
2241
|
const total = relativePaths.length;
|
|
2238
2242
|
const spinner = options.progress ? ora2("Uploading reports:").start() : void 0;
|
|
@@ -2430,9 +2434,9 @@ var optViewerUrl = new Option("-e, --viewer-url <url>", "A URL where report view
|
|
|
2430
2434
|
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 () => {
|
|
2431
2435
|
const dir = path7.resolve(arg ?? "flakiness-report");
|
|
2432
2436
|
if (!fs7.existsSync(dir))
|
|
2433
|
-
throw new Error(`Directory ${
|
|
2437
|
+
throw new Error(`Directory ${styleText6("bold", dir)} does not exist`);
|
|
2434
2438
|
if (!fs7.existsSync(path7.join(dir, "report.json")))
|
|
2435
|
-
throw new Error(`The folder ${
|
|
2439
|
+
throw new Error(`The folder ${styleText6("bold", dir)} does not contain report.json - is this a Flakiness report folder?`);
|
|
2436
2440
|
await showReport(dir, {
|
|
2437
2441
|
reportViewerUrl: options.viewerUrl
|
|
2438
2442
|
});
|
package/lib/junit.js
CHANGED
|
@@ -123,14 +123,6 @@ async function traverseJUnitReport(context, node) {
|
|
|
123
123
|
report.suites.push(newSuite);
|
|
124
124
|
}
|
|
125
125
|
currentSuite = newSuite;
|
|
126
|
-
const metadata = getProperties(element);
|
|
127
|
-
if (metadata.length) {
|
|
128
|
-
currentEnv = structuredClone(currentEnv);
|
|
129
|
-
currentEnv.metadata ??= {};
|
|
130
|
-
for (const [key, value] of metadata)
|
|
131
|
-
currentEnv.metadata[key] = value;
|
|
132
|
-
currentEnvIndex = report.environments.push(currentEnv) - 1;
|
|
133
|
-
}
|
|
134
126
|
} else if (element.name === "testcase") {
|
|
135
127
|
assert(currentSuite);
|
|
136
128
|
const file = element.attributes["file"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flakiness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.257.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"flakiness": "./lib/cli/cli.js"
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"author": "Degu Labs, Inc",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@playwright/test": "^1.
|
|
22
|
+
"@playwright/test": "^1.60.0",
|
|
23
23
|
"@types/debug": "^4.1.13",
|
|
24
24
|
"@types/express": "^4.17.25",
|
|
25
25
|
"gray-matter": "^4.0.3",
|
|
26
|
-
"@flakiness/
|
|
27
|
-
"@flakiness/
|
|
26
|
+
"@flakiness/shared": "0.257.0",
|
|
27
|
+
"@flakiness/server": "0.257.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@flakiness/flakiness-report": "^0.
|
|
30
|
+
"@flakiness/flakiness-report": "^0.34.0",
|
|
31
31
|
"@flakiness/sdk": "^2.7.0",
|
|
32
32
|
"@rgrove/parse-xml": "^4.2.0",
|
|
33
33
|
"commander": "^14.0.3",
|