# nonealexq/jmeter-allure-reporting architecture

> Architecture diagram of the GitHub repository nonealexq/jmeter-allure-reporting, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nonealexq/jmeter-allure-reporting
- Repository: https://github.com/nonealexq/jmeter-allure-reporting

## Overview

##### Project type and purpose
- This is an open-source testing/reporting tool that integrates Apache JMeter with the Allure Report framework.
- It is designed to run functional JMeter tests (not load tests), capture test steps and metadata via a Groovy reporter plugin, and produce rich Allure HTML reports.
- It supports two usage modes:
a) Dockerized (“docker-compose up”)
b) Local GUI (installer.sh + JMeter GUI + Allure CLI)

##### File structure
- Top-level artifacts:
- Dockerfile / docker-compose.yml – defines a JMeter container that bundles tests and the allure-reporter.groovy script.
- installer.sh – bootstraps a local JMeter installation with the custom Groovy plugin.
- allure-reporter.groovy – the JSR223 Groovy script that captures JMeter events and writes Allure-compatible XML into the allure-results folder.
- allure-jmeter-example.jmx – sample test plan illustrating how to wire in the reporter.
- jmeter/… – a self-contained JMeter distribution plus all required jars and JMeter plugins.
- allure-results/ – output folder for raw Allure result files.
- images/ – screenshots used in README.

##### Key points from the README
- Two modes of operation: Docker Compose and local GUI.
- Environment variables and JMeter User Defined Variables must be set to point to the results folder and the Groovy script.
- After execution, raw Allure XML is in allure-results; then ‘allure generate’ produces the final HTML report.
- Additional features: skipped/critical annotations, parameters, links, custom labels, CI-friendly test fragments layout.

##### Main components
A. User / CI Agent
- Triggers test execution (local installer.sh + JMeter GUI or ‘docker-compose up’).
- Runs Allure CLI to generate HTML.
B. Docker Host (or Local Machine)
- Docker Engine + Docker Compose
- Volume mounts:
- Project root → /mnt/jmeter inside container
- ./allure-results → /result/allure-results inside container
C. JMeter Container
- JMETER_HOME: contains binary and libs (jmeter/lib, jmeter/lib/ext)
- Contains the ‘allure-reporter.groovy’ script on the classpath
- Executes the .jmx test plan(s)
- The reporter script intercepts JMeter events and writes Allure XML into /result/allure-results
D. Allure CLI (host or separate container)
- Reads raw results from ./allure-results
- Runs ‘allure generate’ → outputs ./allure-report
E. Optional: CI Pipeline (Jenkins/GitLab CI)
- Steps: clone repo → docker-compose up → docker cp results → allure generate → archive report

##### Relationships and data flow
1) User/CI invokes either:
- Local mode: installer.sh → JMeter GUI launches → user runs JMX → results in local allure-results
- Docker mode: docker-compose up → container spins, runs tests headlessly → writes to volume
2) Once tests complete, raw Allure XML sits in allure-results folder (host or volume)
3) User/CI runs Allure CLI generate → transforms XML → static HTML site in allure-report
4) User opens the report in a browser or CI publishes it

##### Architectural patterns and design principles
- Plugin/extension pattern: uses JMeter’s JSR223 Sampler with Groovy to hook into test execution.
- Containerization: isolates JMeter environment in Docker, ensures consistent dependencies.
- Volume-based data exchange between container and host.
- CI-friendly layout: test fragments, environment variables, and mount paths are parameterized for pipelines.

##### Relevant technologies/frameworks/libraries
- Apache JMeter + standard plugins + JMeter-Plugins library jars
- Groovy (JSR223 scripting)
- Docker & Docker Compose
- Allure Report CLI
- Bash installer.sh for local setup

##### Elements
- Test plan → JMeter execution → raw results
- Raw results → Allure generate → HTML output
- Containers vs Host processes vs File system volumes
- Scripts vs Binaries vs Data folders
- Notes or callouts for:
- Required environment variables (_ALLURE_REPORT_PATH, _ALLURE_CONFIG_PATH)
- CI-specific variables (TEST_FRAGMENTS_FOLDER, JMETER_HOME)

## Diagram (Mermaid)

```mermaid
flowchart TD
    UserCI["User/CI Agent"]:::actor

    subgraph "Local Execution"
        Installer["installer.sh"]:::script
        JMeterGUI["JMeter GUI"]:::container
        JMX["Sample Test Plan (.jmx)"]:::data
        Script["Allure Reporter Plugin (Groovy)"]:::script
        JMeterDistro["JMeter Distribution"]:::ext
        Installer -->|"bootstraps"| JMeterGUI
        JMX -->|"executes"| JMeterGUI
        JMeterGUI -->|"loads"| Script
        Script -->|"writes XML to"| RawResults
        JMeterDistro -.-> JMeterGUI
    end

    subgraph "Docker Execution"
        Dockerfile["Dockerfile"]:::config
        Compose["docker-compose.yml"]:::config
        JMeterContainer["JMeter Container"]:::container
        MountTests["/mnt/jmeter (tests)"]:::volume
        MountResults["/result/allure-results"]:::volume
        ScriptD["Allure Reporter Plugin (Groovy)"]:::script
        JMXD["Sample Test Plan (.jmx)"]:::data
        Distro["JMETER_HOME & libs"]:::ext

        Dockerfile -->|"defines image"| JMeterContainer
        Compose -->|"orchestrates"| JMeterContainer
        JMeterContainer -->|"mounts"| MountTests
        JMeterContainer -->|"mounts"| MountResults
        MountTests -->|"contains"| JMXD
        JMeterContainer -->|"classpath includes"| ScriptD
        JMeterContainer -->|"includes"| Distro
        JMXD -->|"executes"| JMeterContainer
        JMeterContainer -->|"writes XML to"| RawResults
    end

    RawResults["Raw Allure Results (XML)"]:::data
    CLI["Allure CLI"]:::cli
    HTML["HTML Report"]:::data

    RawResults -->|"allure generate"| CLI
    CLI -->|"outputs"| HTML
    HTML -->|"view in browser"| UserCI

    subgraph "Optional CI Pipeline"
        Pipeline["CI Pipeline (Jenkins/GitLab CI)"]:::actor
        Pipeline -->|"clones repo & runs"| Compose
        Pipeline -->|"runs"| CLI
        CLI -->|"archives"| Pipeline
    end

    click Installer "https://github.com/nonealexq/jmeter-allure-reporting/blob/master/installer.sh"
    click JMX "https://github.com/nonealexq/jmeter-allure-reporting/blob/master/allure-jmeter-example.jmx"
    click Script "https://github.com/nonealexq/jmeter-allure-reporting/blob/master/allure-reporter.groovy"
    click Dockerfile "https://github.com/nonealexq/jmeter-allure-reporting/tree/master/Dockerfile"
    click Compose "https://github.com/nonealexq/jmeter-allure-reporting/blob/master/docker-compose.yml"
    click Distro "https://github.com/nonealexq/jmeter-allure-reporting/tree/master/jmeter/"
    click MountResults "https://github.com/nonealexq/jmeter-allure-reporting/tree/master/allure-results/"
    classDef actor fill:#f9f,stroke:#333,stroke-width:1px
    classDef container fill:#ccf,stroke:#333,stroke-width:1px
    classDef script fill:#cfc,stroke:#333,stroke-width:1px
    classDef data fill:#ffc,stroke:#333,stroke-width:1px
    classDef volume fill:#fcf,stroke:#333,stroke-width:1px
    classDef cli fill:#cff,stroke:#333,stroke-width:1px
    classDef config fill:#fdd,stroke:#333,stroke-width:1px
    classDef ext fill:#ddf,stroke:#333,stroke-width:1px
```
