Added multiple paths/patterns support to `generate`, `open`, and other commands that work with Allure results by delatrie · Pull Request #627 · allure-framework/allure3 · GitHub
Skip to content

Added multiple paths/patterns support to generate, open, and other commands that work with Allure results#627

Merged
baev merged 19 commits into
mainfrom
multi-resultsDir
May 22, 2026
Merged

Added multiple paths/patterns support to generate, open, and other commands that work with Allure results#627
baev merged 19 commits into
mainfrom
multi-resultsDir

Conversation

@delatrie

@delatrie delatrie commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR updates the CLI commands that read Allure results so they can accept multiple resultsDir inputs, including glob patterns, instead of forcing users to merge result files in a single directory.

Why

This is mostly relevant for monorepos, where each module typically writes its own isolated allure-results directory instead of producing one shared output.

This feature is also important for allure-gradle and allure-maven to support multi-project builds.

Without this support, users often have to manually merge or copy result directories before running Allure commands. That extra copying is unnecessary and adds friction to CI scripts and local workflows.

Some commands (generate, open, quality-gate) already supported passing a single glob pattern as resultsDir. However, this made the experience of passing multiple directories awkward. Because these commands expected only one resultsDir, users had to wrap glob patterns in quotes to prevent shell expansion. If the glob was not quoted, the shell could expand it into multiple paths, causing Allure to throw an error.

What Changed

  • Affected commands now accept resultsDir as a rest argument instead of a single positional string.
  • Users can now pass any combination of multiple explicit result directories, quoted globs, and unquoted glob (that some shells expand into multiple paths).
  • Result directory resolution logic is centralized in findAllureResultDirectories.
  • The existing default search behavior for generate, open, and quality-gate is preserved: when no resultsDir is provided, commands still search ./**/allure-results. The PR extends this behavior to other commands that work with result files.
  • open/serve keep the existing behavior of serving an already generated report when a single or default report directory is provided and contains a generated report. Otherwise, they fall back to generating a report from the matched result directories.

Affected Commands

  • generate
  • open / serve
  • allure2
  • awesome
  • classic
  • csv
  • dashboard
  • history
  • known-issue
  • log
  • quality-gate
  • slack
  • testplan
  • watch

Examples

Examples are provided given this repo's layout.

  • Multiple paths:
npx allure generate ./packages/reader-api/out/allure-results ./packages/reader/out/allure-results
  • An unquoted glob:
npx allure open ./packages/*/out/allure-results

In a shell with globbing support, this is equivalent to:

npx allure open ./packages/aql/out/allure-results ./packages/charts-api/out/allure-results ... /packages/web-summary/out/allure-results
  • A quoted glob:
npx allure awesome "./packages/*/out/allure-results"

This is equivalent to the previous example, but instead of the shell, the glob module performs the expansion according to its syntax and rules (which may differ from the shell's). Previously, only generate, open, and quality-gate supported this syntax.

  • Multiple globs, expanded by Allure:
npx allure awesome "./packages/*-api/out/allure-results" "./packages/core*/out/allure-results"
  • Multiple globs, depending on the shell, can be expanded by the shell as well as by Allure (via glob):
npx allure watch ./packages/*-api/out/allure-results ./packages/core*/out/allure-results

Extra changes

  • fix leaking mock implementations affecting neighbor tests
  • improve some help messages
  • allure open and allure serve now require explicit input to generate instead of silently trying to generate from the output directory.

Closes #560

@delatrie delatrie changed the title Support passing multiple paths/patterns to commands that read Allure results Support passing multiple paths/patterns to generate, open, and other commands that work with Allure results May 7, 2026
@delatrie delatrie changed the title Support passing multiple paths/patterns to generate, open, and other commands that work with Allure results Added multiple paths/patterns support to generate, open, and other commands that work with Allure results May 7, 2026
@delatrie delatrie added the type:improvement New feature or request label May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

@delatrie delatrie marked this pull request as ready for review May 7, 2026 09:12
@delatrie delatrie force-pushed the multi-resultsDir branch 2 times, most recently from ed74580 to 56865d0 Compare May 11, 2026 21:59
@baev baev merged commit 4bc5158 into main May 22, 2026
11 checks passed
@baev baev deleted the multi-resultsDir branch May 22, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:cli type:improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to merge results from multiple .xcresult files into a single Allure 3 report?

2 participants