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-testngdependency 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 localallure-resultsdirectory. - For Jasmine Protractor: Use the
allure-jasmineplugin. It captures Jasmine’s test outcomes and outputs the same format of result files to the sameallure-resultsfolder.
- For TestNG: Add the
- Then, run commands like
allure serveorallure 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.
- Spin up a temporary local server (
- 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-resultsdirectory: 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 --cleanto create a staticallure-reportdirectory. 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-resultsfolder 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
相关产品推荐
相关产品推荐

