allure-store provides a flexible and extensible data store for interacting with Allure test results. It offers a unified API, the AllureStore, to read, write, and transform various Allure data entities like test results, containers, categories, environment information, and executor details. The library supports reading from traditional `allure-results` directories, as well as compiled Allure2 reports (local directories, HTML files, or HTTP/HTTPS URLs), and allows writing data back. It is currently at version 1.2.0, with a relatively active release cadence since its initial release in late 2024, focusing on feature enhancements and bug fixes. Key differentiators include its pluggable `AllureReader` and `AllureWriter` interfaces, enabling custom storage backends and result aggregation capabilities, making it highly adaptable for CI/CD pipelines or custom reporting tools.
npm install allure-storeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize an AllureStore from an existing `allure-results` directory, retrieve various Allure test data (all results, latest results, categories), and also shows how to write new environment information to a specified output directory.
Monitor GitHub repository for updates and breaking changes. Consider this for non-critical parts of your infrastructure initially.
Ensure your Node.js environment is updated to version 16.14.0 or newer (e.g., using `nvm install 16` or `nvm use 16`).
Initialize the store with `await fromDirectory('output-dir', { overwrite: true });` if you intend to replace or fully update existing data in the target directory.Review any custom `Category` type implementations or data structures after upgrading to `v1.1.1` or later to ensure compatibility with the refined type definitions.
Update your import statements to use ES module syntax: `import { fromDirectory } from 'allure-store';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).Verify the path to your Allure results directory is correct and that the directory actually exists. Create it if you intend to write to it and it's missing, or ensure a test runner has generated results there.
Ensure you are using a store initialized with write capabilities, such as `fromDirectory`, and if overwriting is intended for an existing directory, pass `{ overwrite: true }` in options for `fromDirectory`.No dependency data recorded yet.