flakiness 0.254.0 → 0.256.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 +10 -15
- package/lib/junit.js +1 -9
- package/package.json +3 -3
- package/types/tsconfig.tsbuildinfo +1 -1
package/lib/cli/cli.js
CHANGED
|
@@ -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.256.0",
|
|
1037
1037
|
type: "module",
|
|
1038
1038
|
private: true,
|
|
1039
1039
|
scripts: {
|
|
@@ -1514,7 +1514,7 @@ async function cmdAuthLogin(endpoint = DEFAULT_FLAKINESS_ENDPOINT) {
|
|
|
1514
1514
|
}
|
|
1515
1515
|
|
|
1516
1516
|
// src/cli/cmd-convert.ts
|
|
1517
|
-
import { CIUtils, GitWorktree, writeReport } from "@flakiness/sdk";
|
|
1517
|
+
import { CIUtils, GitWorktree, ReportUtils as ReportUtils2, writeReport } from "@flakiness/sdk";
|
|
1518
1518
|
import fs3 from "fs/promises";
|
|
1519
1519
|
import path3 from "path";
|
|
1520
1520
|
|
|
@@ -1643,14 +1643,6 @@ async function traverseJUnitReport(context, node) {
|
|
|
1643
1643
|
report.suites.push(newSuite);
|
|
1644
1644
|
}
|
|
1645
1645
|
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
1646
|
} else if (element.name === "testcase") {
|
|
1655
1647
|
assert(currentSuite);
|
|
1656
1648
|
const file = element.attributes["file"];
|
|
@@ -1733,7 +1725,7 @@ async function traverseJUnitReport(context, node) {
|
|
|
1733
1725
|
}
|
|
1734
1726
|
async function parseJUnit(xmls, options) {
|
|
1735
1727
|
const report = {
|
|
1736
|
-
category: "junit",
|
|
1728
|
+
category: options.category ?? "junit",
|
|
1737
1729
|
commitId: options.commitId,
|
|
1738
1730
|
duration: options.runDuration,
|
|
1739
1731
|
startTimestamp: options.runStartTimestamp,
|
|
@@ -1803,9 +1795,11 @@ async function cmdConvert(junitPath, options) {
|
|
|
1803
1795
|
}
|
|
1804
1796
|
const { report, attachments } = await parseJUnit(xmlContents, {
|
|
1805
1797
|
commitId,
|
|
1806
|
-
defaultEnv: { name: options.envName },
|
|
1798
|
+
defaultEnv: ReportUtils2.createEnvironment({ name: options.envName }),
|
|
1807
1799
|
runStartTimestamp: Date.now(),
|
|
1808
|
-
runDuration: 0
|
|
1800
|
+
runDuration: 0,
|
|
1801
|
+
runUrl: CIUtils.runUrl(),
|
|
1802
|
+
category: options.category
|
|
1809
1803
|
});
|
|
1810
1804
|
report.title = options.title ?? CIUtils.runTitle();
|
|
1811
1805
|
if (options.flakinessProject)
|
|
@@ -2436,13 +2430,14 @@ program.command("show").description("Show flakiness report").argument("[relative
|
|
|
2436
2430
|
reportViewerUrl: options.viewerUrl
|
|
2437
2431
|
});
|
|
2438
2432
|
}));
|
|
2439
|
-
program.command("convert-junit").description("Convert JUnit XML report(s) to Flakiness report format").argument("<junit-root-dir-path>", "Path to JUnit XML file or directory containing XML files").option("--env-name <name>", "Environment name for the report
|
|
2433
|
+
program.command("convert-junit").description("Convert JUnit XML report(s) to Flakiness report format").argument("<junit-root-dir-path>", "Path to JUnit XML file or directory containing XML files").option("--env-name <name>", "Environment name for the report (defaults to --category, or `junit` if neither is set)").option("--commit-id <id>", "Git commit ID (auto-detected if not provided)").addOption(new Option("--title <title>", "Human-readable report title (auto-detected from CI if not provided)").env("FLAKINESS_TITLE")).option("--output-dir <dir>", "Output directory for the report", "flakiness-report").option("-c, --category <category>", "Report category identifier (e.g. bun, rust). Defaults to `junit`.").addOption(optFlakinessProject).action(async (junitPath, options) => {
|
|
2440
2434
|
await runCommand(async () => {
|
|
2441
2435
|
await cmdConvert(junitPath, {
|
|
2442
|
-
envName: options.envName,
|
|
2436
|
+
envName: options.envName ?? options.category ?? "junit",
|
|
2443
2437
|
outputDir: options.outputDir,
|
|
2444
2438
|
commitId: options.commitId,
|
|
2445
2439
|
title: options.title,
|
|
2440
|
+
category: options.category,
|
|
2446
2441
|
flakinessProject: options.project
|
|
2447
2442
|
});
|
|
2448
2443
|
});
|
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"];
|
|
@@ -213,7 +205,7 @@ async function traverseJUnitReport(context, node) {
|
|
|
213
205
|
}
|
|
214
206
|
async function parseJUnit(xmls, options) {
|
|
215
207
|
const report = {
|
|
216
|
-
category: "junit",
|
|
208
|
+
category: options.category ?? "junit",
|
|
217
209
|
commitId: options.commitId,
|
|
218
210
|
duration: options.runDuration,
|
|
219
211
|
startTimestamp: options.runStartTimestamp,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flakiness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.256.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.13",
|
|
24
24
|
"@types/express": "^4.17.25",
|
|
25
25
|
"gray-matter": "^4.0.3",
|
|
26
|
-
"@flakiness/
|
|
27
|
-
"@flakiness/
|
|
26
|
+
"@flakiness/server": "0.256.0",
|
|
27
|
+
"@flakiness/shared": "0.256.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@flakiness/flakiness-report": "^0.33.0",
|