Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Allure Report Analyzer

An AI-powered tool for analyzing and comparing Allure test reports. This tool fetches Allure report data (CSV and JSON) from provided URLs, analyzes the test results, and generates detailed reports with insights using OpenAI's GPT models.

Features

  • Single Report Analysis: Analyze a single Allure test execution report
  • Report Comparison: Compare two Allure reports to identify changes and regressions
  • AI-Powered Insights: Get natural language summaries and recommendations using OpenAI (when API key is provided)
  • Interactive HTML Reports: Generate beautiful, interactive HTML reports
  • REST API: Simple HTTP endpoints for integration with CI/CD pipelines

Prerequisites

  • Node.js 16+ and npm
  • (Optional) OpenAI API key for AI insights

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd smart-report
  2. Install dependencies:

    npm install
  3. Create a .env file in the project root and configure the environment variables:

    # Server Configuration
    PORT=3000
    
    # OpenAI Configuration (optional, for AI insights)
    OPENAI_API_KEY=your_openai_api_key_here
    
    # Report URLs (optional, can be provided in API requests)
    REPORT1_BASE_URL=https://example.com/report1
    REPORT2_BASE_URL=https://example.com/report2
    
    # Output Configuration
    REPORT_OUTPUT_DIR=./reports

Usage

Starting the Server

npm start

This will start the server on http://localhost:3000 by default.

API Endpoints

1. Analyze a Single Report

POST /api/analyze

Request Body:

{
  "baseUrl": "https://example.com/allure-report"
}

If baseUrl is not provided, it will use REPORT1_BASE_URL from environment variables.

Response:

  • success: Boolean indicating if the analysis was successful
  • reportUrl: URL to view the generated HTML report
  • metrics: Various test metrics and statistics
  • analysis: AI-generated insights (if OpenAI API key is provided)

2. Compare Two Reports

POST /api/compare

Request Body:

{
  "report1Url": "https://example.com/allure-report1",
  "report2Url": "https://example.com/allure-report2",
  "insights": ""
}

If report1Url and report2Url are not provided, it will use REPORT1_BASE_URL and REPORT2_BASE_URL from environment variables.

Response:

  • success: Boolean indicating if the comparison was successful
  • reportUrl: URL to view the generated HTML comparison report
  • improvements: List of improvements found
  • regressions: List of regressions found
  • recommendations: AI-generated recommendations (if OpenAI API key is provided)
  • metrics: Comparison metrics between the two reports

Environment Variables

Variable Description Default
PORT Port for the application to run on 3000
OPENAI_API_KEY Your OpenAI API key (optional) -
REPORT1_BASE_URL Default first report URL -
REPORT2_BASE_URL Default second report URL -
REPORT_OUTPUT_DIR Directory to store generated reports ./reports

Development

  1. Install dependencies:

    npm install
  2. Start the development server:

    npm run dev
  3. Run tests:

    npm test

Running the MCP Server

This project includes an MCP (Multi-Command Protocol) server for AI-powered analysis and comparison of Allure reports via CLI or compatible clients.

Prerequisites

  • Node.js 16+
  • (Recommended) An OpenAI API key for AI insights

Install dependencies

npm install

Start the MCP server

You can run the MCP server using tsx:

npx tsx src/server.ts

The server will start and listen for MCP. You can connect to it using compatible MCP clients or tools.

MCP Tools Available

  • analyze_reports: Analyze a single Allure report with AI-powered insights. Prompts for a report URL and analysis type (overview, failures, performance, trends, or custom).
  • compare_reports: Compare two Allure reports and get a detailed AI-powered comparison. Prompts for two report URLs and comparison type (overview, detailed, trends, or custom).
  • export_comparison_report: Generate and export comparison report as HTML by making API call to our smart report tool

Example Usage

  • When prompted, provide a report URL in the format: http://report.url.com/RN_WIDGETS_Latest/android/447/awesome/index.html
  • The server will automatically construct the required CSV and JSON URLs for analysis.

Environment Variable

  • Set your OpenAI API key as an environment variable for best results:

    export OPENAI_API_KEY=your_openai_api_key_here

    Setup MCP server

{
  "mcpServers": {
    "smart-report": {
      "command": "npx",
      "args": ["tsx", "/Users/izhanali_700071/Desktop/smart-report/src/server.ts"]
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages