Skip to main content

An intelligent CLI tool that transforms raw Allure test results into an interactive dashboard with an AI analyst.

Project description

Allure AI Failure Analyzer

An intelligent CLI tool that transforms raw Allure test results into an interactive dashboard featuring a powerful AI analyst. Get visual insights, proactive summaries, and ask complex questions about your test failures in natural language.

Project Screenshot


Table of Contents


Features

โœจ Interactive HTML Dashboard: Clearly displays grouped failures with expandable details, including stack traces and examples.

๐Ÿค– Integrated AI Analyst (Powered by Gemini):

  • Conversational Memory: Engage in a stateful conversation. The AI remembers the context of previous messages for follow-up questions.
  • Autonomous Tool Use: The AI agent proactively uses a toolbox of functions to access historical data, analyze trends, and answer complex questions.
  • Natural Language Understanding: Ask complex questions like "What's the difference between the last two reports?" or "What was the most common error this week?"

๐Ÿš€ Proactive Executive Summary: On report load, the AI automatically analyzes the latest run and provides a summary of key insights directly in the chat. (This can be disabled in config.yaml).

๐Ÿ“Š Visual Data Dashboard:

  • Get immediate visual insights into your test data.
  • Failures by Epic Chart: A bar chart showing the total number of failures categorized by their associated 'epic' label.
  • Status Breakdown Chart: A doughnut chart visualizing the ratio of 'failed' vs. 'broken' tests.

๐Ÿ“ˆ Historical Trend Analysis:

  • The AI can analyze the entire report history to identify patterns.
  • Ask about failure trends, the recurrence of specific bugs, and the impact of fixes over time.

Project Structure

allure-analyzer/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ allure_analyzer/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ cli.py
โ”‚       โ”œโ”€โ”€ server.py
โ”‚       โ”œโ”€โ”€ analyzer/
โ”‚       โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚       โ”‚   โ”œโ”€โ”€ core.py
โ”‚       โ”‚   โ”œโ”€โ”€ ingestion.py
โ”‚       โ”‚   โ”œโ”€โ”€ fingerprinter.py
โ”‚       โ”‚   โ””โ”€โ”€ reporting.py
โ”‚       โ”œโ”€โ”€ static/
โ”‚       โ”‚   โ”œโ”€โ”€ style.css
โ”‚       โ”‚   โ””โ”€โ”€ main.js
โ”‚       โ”œโ”€โ”€ templates/
โ”‚       โ”‚   โ””โ”€โ”€ report.html
โ”‚       โ””โ”€โ”€ config/
โ”‚           โ””โ”€โ”€ default_config.yaml
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ requirements.txt

If you ship package data (templates, static assets, YAML config), make sure they live under src/allure_analyzer/... so they are included in wheels.


Prerequisites

  • Python 3.11+ (the package requires >=3.11)
  • pip (Python package manager)
  • An Allure results directory generated from a test run.

macOS tip (Homebrew): brew install python@3.11


Installation

Stable (PyPI)

Once released to PyPI (production), installation is simply:

pip install allure-ai-analyzer

Preview / Testing (TestPyPI)

When installing from TestPyPI, use PyPI as a fallback for dependencies (so wheels like PyYAML>=6.0 are available):

pip install --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple \
  allure-ai-analyzer

Why the extra index? TestPyPI often doesnโ€™t host all dependency wheels. The extra index lets pip fetch deps from PyPI while your package still comes from TestPyPI.


Quickstart

  1. Set up a virtual environment (recommended):
python3.11 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
  1. Install the CLI:
pip install allure-ai-analyzer
# or, from TestPyPI with fallback:
# pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple allure-ai-analyzer
  1. Provide your API key: Create a .env file in your automation project root (where you run the CLI) and add:
GEMINI_API_KEY="your-api-key-here"
  1. Generate a report: From your automation project (where allure-results exists):
allure-analyze generate
  1. View the interactive dashboard + AI analyst:
allure-analyze view

By default the server binds to http://127.0.0.1:8000 (or the port you pass via --port).


Configuration

You can override defaults by creating allure-analyzer-config.yaml in your automation project root (next to your allure-results).

The default settings live at src/allure_analyzer/config/default_config.yaml:

# Number of top failure groups to include in the report. -1 means all groups.
top_n_groups_to_report: -1

# Include tests with 'broken' status in the analysis.
include_broken: true

# --- UI Behavior ---
# Set to true to automatically get an AI executive summary when the report loads.
proactive_summary_on_load: true

Most options can also be controlled via CLI flags (see below).


Usage

Once installed, the allure-analyze command is available in your terminal.

1) Generate a Report

Run from your automation project's root (where allure-results is located):

allure-analyze generate

Useful flags:

  • --path /path/to/results โ€” explicit path to allure-results
  • --config /path/to/config.yaml โ€” use a custom config
  • --top-n 10 โ€” only report the top 10 failure groups
  • --exclude-broken โ€” exclude 'broken' tests from analysis

2) View Reports (Dashboard + AI)

allure-analyze view

Useful flags:

  • --port 8001 โ€” run the server on a different port
  • --no-proactive-summary โ€” disable the automatic executive summary

Integration with Node.js Projects

Because this is a CLI, you can wire it into package.json:

{
  "scripts": {
    "test": "playwright test",
    "posttest": "allure-analyze generate",
    "report": "allure-analyze view"
  }
}

Troubleshooting

  • zsh: command not found: allure-analyze

    • Ensure the venv is activated and installation succeeded: pip show allure-ai-analyzer.
    • On Windows PowerShell, activate via: .venv\Scripts\Activate.ps1.
  • ERROR: No matching distribution found

    • Check Python version: python -V must be 3.11+.
    • If installing from TestPyPI, add the fallback index:
      --extra-index-url https://pypi.org/simple.
  • Build isolation failures like setuptools>=40.8.0 when installing from TestPyPI

    • Use the recommended TestPyPI install command above so dependencies come from PyPI.
    • Alternatively, preinstall critical deps: pip install PyYAML>=6.0.
  • Assets not found (templates/static/config)

    • Ensure they live under src/allure_analyzer/... and are included via package-data.

Local Development

  1. Clone and enter the repo:
git clone <your-repository-url>
cd allure-analyzer
  1. Create & activate a venv:
python3.11 -m venv .venv
source .venv/bin/activate
  1. Install in editable mode:
pip install -e .
  1. Set your .env (see Quickstart), then run:
allure-analyze generate
allure-analyze view

Publishing (Maintainers)

Use TestPyPI for dry runs and PyPI for production.

# Clean, build, and upload
rm -rf dist build *.egg-info
python -m pip install -U pip build twine
python -m build
python -m twine upload --repository testpypi dist/*
# For PyPI production:
# python -m twine upload dist/*

Common upload issues

  • "File already exists": bump the version in pyproject.toml.
  • README rendering warnings: ensure readme = "README.md" and Markdown is valid.

How It Works

  • Backend (Python/Flask): The cli.py script serves as the entry point. It parses commands and calls the appropriate functions. The server.py file runs a Flask web app that serves the frontend and acts as a controller for the AI agent.

  • AI Agent: The server manages a stateful chat session for each user. It provides the Gemini model with a "toolbox" of Python functions (e.g., get_list_of_all_reports, analyze_failure_trends). The AI autonomously decides which tools to use to gather the necessary data before formulating its answer.

  • Frontend (HTML/JS): The report.html file is a single-page application. The JavaScript in static/main.js fetches data from the backend, renders the failure groups, draws the charts using Chart.js, and manages the interactive chat with the AI analyst.


Using the AI Analyst

The AI analyst understands natural language. Example prompts:

  • Simple Comparisons:

    • "What is the difference between the last two reports?"
    • "Compare the current run to the one from 2025-09-14 21:25:20."
  • Trend Analysis:

    • "Analyze failure trends for the last 30 days."
    • "Is the 'Database connection timeout' failure getting better or worse over time?"
    • "What are the most persistent errors over the last week?"
  • Deep Dives:

    • "What was the most impacted epic in the latest run?"
    • "Read the latest report and summarize the key issues for me."
    • "Are there any new, high-frequency failures that appeared in the last 3 days?"

License

MIT

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

allure_ai_analyzer-1.0.6.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

allure_ai_analyzer-1.0.6-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file allure_ai_analyzer-1.0.6.tar.gz.

File metadata

  • Download URL: allure_ai_analyzer-1.0.6.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for allure_ai_analyzer-1.0.6.tar.gz
Algorithm Hash digest
SHA256 daa8bff30a9c6154c50d28a25aa0f18c2b0d377602ac2826666f9726582ec953
MD5 37a13f50f79911b33019e46a1f709961
BLAKE2b-256 2fc1efeb482f883ef3339716596acf2767227f4601cd0dd24436ad441890f7ac

See more details on using hashes here.

File details

Details for the file allure_ai_analyzer-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for allure_ai_analyzer-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 05dbcc100ff272d2dab43f08b465de467cea6829c9e603fda957c34468ca0a2b
MD5 e1f8fa2f8c05eea288b1f3e4e38e6294
BLAKE2b-256 79eeb452b14c9d7a2a2f5e11673176dfc180a0bf068e8ea420960714795619ca

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