Skip to content

fix(cli): use resolve instead of join for report path in open command#688

Open
todti wants to merge 2 commits into
mainfrom
fix/open-command-double-path
Open

fix(cli): use resolve instead of join for report path in open command#688
todti wants to merge 2 commits into
mainfrom
fix/open-command-double-path

Conversation

@todti
Copy link
Copy Markdown
Collaborator

@todti todti commented Jun 3, 2026

Summary

  • resolveConfig always resolves output to an absolute path via path.resolve
  • resolveReportPath used path.join(cwd, fallback) where fallback could be that absolute path
  • path.join does not treat an absolute second argument as absolute — it strips the leading / and concatenates, producing a doubled path like /sandbox/Users/.../sandbox/allure-report
  • Fix: use path.resolve(cwd, path) which correctly passes through absolute paths and resolves relative ones against cwd

Reproduces when running allure open without a path argument (the fallback config.output is absolute).

path.join does not treat an absolute second argument as absolute —
it concatenates both, stripping the leading slash. resolveConfig
always returns an absolute output path, so when allure open is
invoked without a path argument the fallback config.output was
doubled into the cwd, producing a path like:
  /sandbox/Users/.../sandbox/allure-report

Switching to path.resolve fixes this: if the fallback is already
absolute it is returned as-is; if it is relative it is resolved
against cwd, which is the correct behaviour in both cases.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure 3 Report 26m 7s Passed tests 1491   Skipped tests 15 0 0 0 View
My Dashboard 26m 7s Passed tests 1491   Skipped tests 15 0 0 0 View
Allure 3 GitHub actions run (2026-06-03T20:51:12.851Z) 26m 7s Passed tests 1491   Skipped tests 15 0 0 0 View

…path

path.join(cwd, absolutePath) strips the leading slash of the second
argument and concatenates, doubling the path. Use isAbsolute() to
short-circuit: if the resolved config.output is already absolute
(which readConfig always produces), return it directly; otherwise
fall back to join(cwd, relativePath) for relative inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant