Skip to main content

AI-Powered Test Flakiness Detection & Root Cause Analysis - Enterprise-grade analytics for test reliability

Project description

🔍 FlakeRadar

AI-Powered Test Flakiness Detection & Team Collaboration

Python 3.9+ MIT License Enterprise Ready

Transform raw test results into actionable insights with statistical confidence scoring, AI-powered root cause analysis, and team collaboration features.


🚀 Quick Start

# Install and analyze
pip install flakeradar
flakeradar --project "MyApp" --results "test-results/*.xml"
open flakeradar_report.html

Python API:

from flakeradar import FlakeRadar

with FlakeRadar(project="MyApp") as radar:
    radar.add_results("test-results/*.xml")
    analysis = radar.analyze(confidence_threshold=0.7, enable_ai=True)
    radar.generate_html_report("report.html")

🎯 Key Features

🔍 Smart Analysis

  • Statistical Confidence Scoring - Wilson intervals eliminate false positives
  • AI Root Cause Clustering - Groups failures by actual causes
  • Time-to-Fix Tracking - Identifies chronic flaky tests

👥 Team Collaboration

  • Central Dashboard - Shared analytics across environments
  • Multi-Environment Tracking - Dev → Staging → Production insights
  • CI/CD Integration - Jenkins, GitHub Actions, REST API

📊 Enterprise Ready

  • Production-Tested Accuracy - Fixed confidence calculations
  • Secure Token Authentication - Team collaboration with proper security
  • Scalable Architecture - Supports teams of any size

🔧 Team Setup

1. Start Team Dashboard

python -m flakeradar.dev_server
# Dashboard: http://localhost:8000/dashboard/your-team-id

2. Create Team Token

curl -X POST http://localhost:8000/api/v1/team/tokens \
  -d '{"team_name": "YourTeam", "environment": "production"}'

3. Jenkins Integration

environment {
    FLAKERADAR_TEAM_TOKEN = credentials('flakeradar-team-token')
}
post {
    always {
        sh '''
            pip install flakeradar
            flakeradar --project "${JOB_NAME}" \
                      --results "test-results/*.xml" \
                      --team-token "${FLAKERADAR_TEAM_TOKEN}" \
                      --environment "${ENV}"
        '''
    }
}

4. GitHub Actions

- name: FlakeRadar Analysis
  env:
    FLAKERADAR_TEAM_TOKEN: ${{ secrets.FLAKERADAR_TEAM_TOKEN }}
  run: |
    pip install flakeradar
    flakeradar --project "${{ github.repository }}" \
              --results "test-results/*.xml" \
              --team-token "$FLAKERADAR_TEAM_TOKEN" \
              --environment "ci"

📖 CLI Reference

flakeradar [OPTIONS]

# Core Parameters
--project TEXT              Project name (required)
--results TEXT              Test files pattern (required, e.g., "*.xml")

# Team Collaboration
--team-token TEXT           Team token (flake_tk_...)
--dashboard-url TEXT        Dashboard URL
--environment TEXT          Environment (dev/staging/prod)

# Analysis Options  
--confidence-threshold FLOAT  Statistical threshold (0.0-1.0, default: 0.7)
--enable-ai / --no-ai        AI analysis (auto-detects API key)
--output TEXT               Report filename (default: flakeradar_report.html)

🔧 Troubleshooting

Common Issues

❌ "Invalid token" error

# Verify token format
echo $FLAKERADAR_TEAM_TOKEN  # Should start with "flake_tk_"

# Test token
curl -X POST "$DASHBOARD_URL/api/v1/team/validate" \
  -H "Authorization: Bearer $FLAKERADAR_TEAM_TOKEN"

❌ Dashboard shows no data

# Check Jenkins console output for submission errors
# Verify environment variables are set correctly

❌ Analysis too slow

# Optimize for large test suites
flakeradar --limit-runs 20 --max-ai-analysis 5 --confidence-threshold 0.8

📊 Sample Output

🚨 Flaky Test Analysis Results:
  📊 Total Tests: 245 | Flaky: 12 | High Confidence: 8
  
🔴 High Priority Flaky Tests:
  DatabaseTest#connectionPool (82% confidence, 14 days flaky)
  AuthTest#tokenRefresh (76% confidence, 7 days flaky)

🔍 Root Cause Analysis:
  🗄️ Database connectivity: 8 tests affected
  ⏱️ Timing issues: 4 tests affected
  
🤖 AI Insights: 12 tests analyzed
✅ Report generated: flakeradar_report.html

🏢 Enterprise Features

  • Mathematical Rigor - Wilson Score confidence intervals
  • Production Accuracy - Fixed edge cases for 0%/100% failure rates
  • Team Analytics - Cross-environment insights and contributor tracking
  • Security - Token-based authentication with rotation support
  • Integration - Jenkins, GitHub Actions, REST API, Python API
  • Scalability - Supports individual developers to enterprise teams

📚 Links


Ready to eliminate flaky tests?

🚀 Get Started | 📖 Documentation | 💬 Support

Built by engineers who understand the pain of flaky tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flakeradar-2.2.0.tar.gz (46.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flakeradar-2.2.0-py3-none-any.whl (52.1 kB view details)

Uploaded Python 3

File details

Details for the file flakeradar-2.2.0.tar.gz.

File metadata

  • Download URL: flakeradar-2.2.0.tar.gz
  • Upload date:
  • Size: 46.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for flakeradar-2.2.0.tar.gz
Algorithm Hash digest
SHA256 7f05d074ca151f303bdcabf41a9fd323bfd9f33a6b50233b5fd0e08188edd3e5
MD5 f8cb8459f1b3ec17e6754a65239feb18
BLAKE2b-256 58ae6caeb54c12502d2e7c32032ef1fe22bcb0f840cea07c75bf926a122adae7

See more details on using hashes here.

File details

Details for the file flakeradar-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: flakeradar-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for flakeradar-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dd591cec888f1a1fb0ebeb2dbeea18abbe348c695beac4e6804e8c577132a25
MD5 4793a77438bf4439c2c2bdffd2b22172
BLAKE2b-256 d367b7bf89011b5beb1a16fe356d428b71e322538f5a73dc7466e5226f4ac486

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page