@flakiness/junit-xml 1.0.0-alpha.0 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +16 -17
  2. package/lib/cli.js +1 -1
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # @flakiness/junit-xml
2
2
 
3
- Convert JUnit XML test reports into a Flakiness report and upload it to [flakiness.io](https://flakiness.io). Parses Surefire and TestNG output, nested `<testsuites>`, retries, `<system-out>` / `<system-err>`, and file attachments.
3
+ Convert JUnit XML test reports into a Flakiness report and upload it to [flakiness.io](https://flakiness.io).
4
4
 
5
5
  The recommended way to run it is with `npx` (no install step):
6
6
 
7
7
  ```bash
8
- npx @flakiness/junit-xml ./build/reports/junit --flakiness-project myorg/myproject
8
+ npx @flakiness/junit-xml --flakiness-project myorg/myproject ./build/reports/junit
9
9
  ```
10
10
 
11
- This combines every XML file under the given path into a single Flakiness report and uploads it to flakiness.io.
11
+ This combines every XML file under the given path into a single Flakiness report and auto-uploads it to flakiness.io. See [authentication](#authentication) on how to configure auto-upload.
12
12
 
13
13
  If your environment has no Node.js, a [standalone binary](#standalone-binary-no-nodejs) is also available.
14
14
 
@@ -18,13 +18,13 @@ If your environment has no Node.js, a [standalone binary](#standalone-binary-no-
18
18
  - [Example: ingesting `bun test` results](#example-ingesting-bun-test-results)
19
19
  - [Example: ingesting Rust `cargo-nextest` results](#example-ingesting-rust-cargo-nextest-results)
20
20
  - [Standalone binary (no Node.js)](#standalone-binary-no-nodejs)
21
- - [Uploading](#uploading)
21
+ - [Authentication](#authentication)
22
22
  - [License](#license)
23
23
 
24
24
  ## Usage
25
25
 
26
26
  ```
27
- flakiness-junit-xml <junit-path> [options]
27
+ flakiness-junit-xml [options] <junit-path>
28
28
 
29
29
  <junit-path> JUnit XML file, or a directory of XML files (scanned recursively)
30
30
  --env-name <name> Environment name (defaults to --category, or `junit`)
@@ -48,7 +48,7 @@ Requires Node.js `^20.17.0 || >=22.9.0`.
48
48
 
49
49
  ```bash
50
50
  bun test --reporter=junit --reporter-outfile=./junit.xml
51
- npx @flakiness/junit-xml ./junit.xml --category bun --flakiness-project myorg/myproject
51
+ npx @flakiness/junit-xml --category bun --flakiness-project myorg/myproject ./junit.xml
52
52
  ```
53
53
 
54
54
  ## Example: ingesting Rust `cargo-nextest` results
@@ -64,12 +64,13 @@ Then run the tests and point at the XML nextest writes under `target/nextest/`:
64
64
 
65
65
  ```bash
66
66
  cargo nextest run --profile ci
67
- npx @flakiness/junit-xml ./target/nextest/ci/junit.xml --category rust --flakiness-project myorg/myproject
67
+ npx @flakiness/junit-xml --category rust --flakiness-project myorg/myproject ./target/nextest/ci/junit.xml
68
68
  ```
69
69
 
70
70
  ## Standalone binary (no Node.js)
71
71
 
72
- A secondary distribution: a single self-contained executable that bundles its own runtime, so it works on machines without Node.js. The CLI, flags, and behavior are identical to the `npx` version — only the way you launch it differs.
72
+ This tool is also shipped as a single self-contained executable that bundles
73
+ its own runtime, so it works on machines without Node.js.
73
74
 
74
75
  **macOS / Linux:**
75
76
 
@@ -86,18 +87,16 @@ irm https://github.com/flakiness/junit-xml/releases/latest/download/install.ps1
86
87
  This installs a `flakiness-junit-xml` command on your `PATH`. Then use it exactly as above:
87
88
 
88
89
  ```bash
89
- flakiness-junit-xml ./build/reports/junit --flakiness-project myorg/myproject
90
+ flakiness-junit-xml --flakiness-project myorg/myproject ./build/reports/junit
90
91
  ```
91
92
 
92
- The installer detects your OS/architecture (x64 and arm64; Linux glibc and Alpine/musl) and always pulls the latest release. To pin a directory, set `INSTALL_DIR` (default `/usr/local/bin`):
93
+ > [!NOTE]
94
+ > You can set `INSTALL_DIR` to configure custom location for installation.
95
+ > ```bash
96
+ > curl -fsSL https://github.com/flakiness/junit-xml/releases/latest/download/install.sh | INSTALL_DIR="$HOME/.local/bin" sh
97
+ > ```
93
98
 
94
- ```bash
95
- curl -fsSL https://github.com/flakiness/junit-xml/releases/latest/download/install.sh | INSTALL_DIR="$HOME/.local/bin" sh
96
- ```
97
-
98
- Prefer `npx` when Node.js is available — it's the primary, always-current path. Reach for the standalone binary only when Node.js isn't an option.
99
-
100
- ## Uploading
99
+ ## Authentication
101
100
 
102
101
  The report is uploaded to flakiness.io automatically. Authentication, in priority order:
103
102
 
package/lib/cli.js CHANGED
@@ -12,7 +12,7 @@ const STDERR_LOGGER = {
12
12
  function envBool(name) {
13
13
  return ["1", "true"].includes(process.env[name]?.toLowerCase() ?? "");
14
14
  }
15
- const program = new Command("flakiness-junit-xml").description("Convert JUnit XML report(s) to a Flakiness report and upload it to flakiness.io").argument("<junit-path>", "Path to a JUnit XML file or a 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 from the current working directory if not provided)").addOption(new Option("--title <title>", "Human-readable report title").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(new Option("--flakiness-project <project>", "Flakiness project identifier in `org/project` format").env("FLAKINESS_PROJECT")).addOption(new Option("-p, --project <org/project>").hideHelp()).addOption(new Option("--token <token>", "Flakiness.io access token for upload").env("FLAKINESS_ACCESS_TOKEN")).option("--endpoint <url>", "Flakiness.io API endpoint override").addOption(new Option("--disable-upload", "Convert only; do not upload to flakiness.io").env("FLAKINESS_DISABLE_UPLOAD")).action(async (junitPath, options) => {
15
+ const program = new Command("flakiness-junit-xml").description("Convert JUnit XML report(s) to a Flakiness report and upload it to flakiness.io").argument("<junit-path>", "Path to a JUnit XML file or a directory containing XML files").option("-c, --category <category>", "Report category identifier (e.g. `bun`, `rust`). Defaults to `junit`.").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 from the current working directory if not provided)").addOption(new Option("--title <title>", "Human-readable report title").env("FLAKINESS_TITLE")).option("--output-dir <dir>", "Output directory for the report", "flakiness-report").addOption(new Option("--flakiness-project <project>", "Flakiness project identifier in `org/project` format").env("FLAKINESS_PROJECT")).addOption(new Option("-p, --project <org/project>").hideHelp()).addOption(new Option("--token <token>", "Flakiness.io access token for upload").env("FLAKINESS_ACCESS_TOKEN")).option("--endpoint <url>", "Flakiness.io API endpoint override").addOption(new Option("--disable-upload", "Convert only; do not upload to flakiness.io").env("FLAKINESS_DISABLE_UPLOAD")).action(async (junitPath, options) => {
16
16
  await runConvert(junitPath, {
17
17
  envName: options.envName ?? options.category ?? "junit",
18
18
  outputDir: options.outputDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flakiness/junit-xml",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,11 +10,6 @@
10
10
  "bin": {
11
11
  "flakiness-junit-xml": "lib/cli.js"
12
12
  },
13
- "scripts": {
14
- "build": "kubik build.mts",
15
- "watch": "kubik build.mts -w",
16
- "test": "playwright test"
17
- },
18
13
  "keywords": [
19
14
  "junit",
20
15
  "junit-xml",
@@ -45,5 +40,10 @@
45
40
  "kubik": "^0.24.0",
46
41
  "tsx": "^4.21.0",
47
42
  "typescript": "^5.9.3"
43
+ },
44
+ "scripts": {
45
+ "build": "kubik build.mts",
46
+ "watch": "kubik build.mts -w",
47
+ "test": "playwright test"
48
48
  }
49
- }
49
+ }