You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Allure Report:多测试框架结果收集存储架构及长期留存咨询

Allure Report: How It Collects Results, Core Architecture, and Long-Term Storage

Hey there! Since you're new to Allure Report and running tests across TestNG and Jasmine Protractor, let's break down your questions clearly and practically:

How Allure Collects Test Results

Allure doesn’t use a database or dedicated server by default for collecting results. Instead, it relies on framework-specific adapters and local result files in a two-step process:

  • First, integrate Allure adapters with your test frameworks:
    • For TestNG: Add the allure-testng dependency to your project. This adapter hooks into TestNG’s test lifecycle events (test start, pass/fail, attachments) and writes structured JSON/XML files to a local allure-results directory.
    • For Jasmine Protractor: Use the allure-jasmine plugin. It captures Jasmine’s test outcomes and outputs the same format of result files to the same allure-results folder.
  • Then, run commands like allure serve or allure generate: the Allure CLI reads these local result files and converts them into the interactive HTML report you see.

Allure’s Core Architecture

Here’s a simplified breakdown of how Allure works under the hood:

  • Test Framework Adapters: The bridge between your test code and Allure. They translate native test results (from TestNG/Jasmine) into Allure’s standardized format, including metadata like test steps, attachments, and statuses.
  • Allure Results Directory: A local folder (default: allure-results) that stores all raw JSON/XML result files generated by the adapters. This is the single source of truth for your test data before report generation.
  • Allure CLI Tool: A command-line utility that processes the result files. It can either:
    • Spin up a temporary local server (allure serve) to display the report instantly, or
    • Generate a static HTML report directory (allure generate) that you can host or share.
  • Allure Report UI: The interactive HTML interface that visualizes your test data—showing trends, test suites, failure details, attachments, and more. It’s entirely static, so you can host it anywhere without needing a backend.
  • Optional Enterprise Tools: For team collaboration and advanced management, you can use Allure TestOps (a commercial platform) or open-source alternatives like Allure Server. These tools store result files in databases, provide centralized access, and offer features like historical trend tracking and CI/CD integration.

Long-Term Storage of Test Results

Since your company needs to preserve test history long-term, here are the most reliable approaches:

  • Archive the allure-results directory: After each test run, zip and store this directory in a versioned storage system (like Git LFS, AWS S3, or your company’s internal file server). Name the archive with a timestamp, build number, or release version—you can always regenerate the full report later by pointing the Allure CLI to this archived folder.
  • Generate and host static HTML reports: Use allure generate --clean to create a static allure-report directory. Upload this directory to a static web server (e.g., Nginx, GitHub Pages, or your company’s internal hosting) so anyone can access historical reports without needing to run the Allure CLI.
  • Use Allure TestOps: This is the most robust solution for enterprise teams. It integrates with CI/CD pipelines (like Jenkins, GitLab CI) to automatically collect test results, stores them in a database, and provides a centralized dashboard to view historical trends, compare runs, and manage test cases.
  • CI/CD Integration: Configure your CI pipeline to upload either the allure-results folder or the generated static report to a persistent storage service (e.g., Artifactory, Azure Blob Storage). Most CI tools have Allure plugins that can display historical reports directly in the pipeline dashboard.

内容的提问来源于stack exchange,提问作者Perkiqi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:39:24