{"_id":"@aaaaorg/flakefence","name":"@aaaaorg/flakefence","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aaaaorg/flakefence","version":"0.1.0","description":"Detect and rank flaky tests from JUnit XML reports","type":"module","main":"dist/index.js","bin":{"flakefence":"dist/cli.js"},"scripts":{"build":"tsc","test":"node --test dist/test.js","prepublishOnly":"npm run build && npm test"},"keywords":["flaky","tests","junit","xml","ci","test-quality","developer-tools"],"author":{"name":"kostadin","email":"kostadin@aaaaorg"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aaaaorg/flakefence.git"},"engines":{"node":">=18"},"dependencies":{"fast-xml-parser":"^5.2.0"},"devDependencies":{"@types/node":"^25.2.3","typescript":"^5.7.0"},"gitHead":"fcb8c7234887967572a6d558d11015c7040aef61","types":"./dist/index.d.ts","_id":"@aaaaorg/flakefence@0.1.0","bugs":{"url":"https://github.com/aaaaorg/flakefence/issues"},"homepage":"https://github.com/aaaaorg/flakefence#readme","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-4J1tcqjM+lHHD2ZSfzMbfutUPxe2IzOQi/pw7SZ361C+x9gnF3N9SD2fr2S8/Sf4gfUhSsjzSDuJHj6X7qhC5A==","shasum":"bd488a6f523209009566342797259948c88e0f74","tarball":"https://registry.npmjs.org/@aaaaorg/flakefence/-/flakefence-0.1.0.tgz","fileCount":15,"unpackedSize":21950,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGS38cLL74CE2RxSWoj5eneFmGITZ9SI7jixxYaFMi0lAiADd0pLKpxWsfMIxfSC875PQ1dSrjiheZPYw1OwidB48w=="}]},"_npmUser":{"name":"koc","email":"kosekdraw@gmail.com"},"directories":{},"maintainers":[{"name":"koc","email":"kosekdraw@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/flakefence_0.1.0_1771466573515_0.14701500750467522"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T02:02:53.360Z","0.1.0":"2026-02-19T02:02:53.642Z","modified":"2026-02-19T02:02:53.922Z"},"maintainers":[{"name":"koc","email":"kosekdraw@gmail.com"}],"description":"Detect and rank flaky tests from JUnit XML reports","homepage":"https://github.com/aaaaorg/flakefence#readme","keywords":["flaky","tests","junit","xml","ci","test-quality","developer-tools"],"repository":{"type":"git","url":"git+https://github.com/aaaaorg/flakefence.git"},"author":{"name":"kostadin","email":"kostadin@aaaaorg"},"bugs":{"url":"https://github.com/aaaaorg/flakefence/issues"},"license":"MIT","readme":"# FlakeFence 🛡️\n\nDetect and rank flaky tests from JUnit XML reports. Point it at your CI test results and instantly see which tests are unreliable.\n\n## Install\n\n```bash\nnpm install -g @aaaaorg/flakefence\n```\n\nOr use with npx:\n\n```bash\nnpx @aaaaorg/flakefence ./test-results/\n```\n\n## Usage\n\n```bash\n# Analyze JUnit XML files in a directory (recursive)\nflakefence ./test-results/\n\n# JSON output of top 10 flakiest\nflakefence ./test-results/ -f json -t 10\n\n# Markdown report\nflakefence ./test-results/ -f markdown\n\n# CI mode — exit code 1 if flaky tests found\nflakefence ./test-results/ --ci --threshold 0.5\n\n# Generate quarantine list (test names only)\nflakefence ./test-results/ --quarantine\n```\n\n## Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-f, --format <fmt>` | Output format: `table`, `json`, `markdown` | `table` |\n| `-t, --top <n>` | Show top N flakiest tests | `20` |\n| `--threshold <n>` | Min flakiness score (0–1) | `0.1` |\n| `--quarantine` | Output just test names (for CI skip lists) | off |\n| `--ci` | Exit with code 1 if flaky tests found | off |\n| `-h, --help` | Show help | |\n\n## How It Works\n\n1. Scans a directory for JUnit XML files (the standard CI test report format)\n2. Parses all test results across multiple runs\n3. Groups tests by name and classname\n4. Identifies **flaky** tests — those that both pass AND fail across runs\n5. Ranks by flakiness score (failure rate weighted by frequency)\n\nA test that passes 7/10 times and fails 3/10 times is flaky. A test that always passes or always fails is not.\n\n## Flakiness Score\n\n```\nfailRate = (failures + errors) / totalRuns\nflakiness = 1 - |failRate - 0.5| × 2\n```\n\nScore ranges from 0 (always passes or always fails) to 1 (50/50 pass/fail — maximally flaky).\n\n## CI Integration\n\nAdd to your pipeline to catch flaky tests before they erode trust:\n\n```yaml\n# GitHub Actions example\n- name: Check for flaky tests\n  run: npx @aaaaorg/flakefence ./test-results/ --ci --threshold 0.3\n```\n\n## Supported Formats\n\n- **JUnit XML** — the standard format produced by most test runners (Jest, pytest, JUnit, Go, etc.)\n- Handles `<testsuites>` wrappers, nested suites, skipped tests, and error cases\n\n## License\n\nMIT © [aaaaorg](https://github.com/aaaaorg)\n","readmeFilename":"README.md","_rev":"1-1054628038ed80d2bb45a842b6c4976c"}