Skip to content

fix(report): let a bare --log-html fall back to the default report path - #311

Merged
roxblnfk merged 1 commit into
php-testo:1.xfrom
Meacue:fix/log-html-bare-flag
Aug 28, 2026
Merged

fix(report): let a bare --log-html fall back to the default report path#311
roxblnfk merged 1 commit into
php-testo:1.xfrom
Meacue:fix/log-html-bare-flag

Conversation

@Meacue

@Meacue Meacue commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

What

  • log-html is now InputOption::VALUE_OPTIONAL, and a new Run::initialize() override normalizes the valueless form to the existing HtmlPlugin::DEFAULT_PATH (no new config) — producing the documented runtime/report/index.html.
  • --log-html=<path> and the absent-flag case are unchanged; --log-report stays commented out — as requested in the issue.

Why

tests/README.md documents that --log-html with no path writes the report to runtime/report/index.html, but the option was registered VALUE_REQUIRED, so Symfony rejected the bare flag before the run even started — see #310 for the full picture.

Tests

New acceptance test bridge/symfony-console/tests/Acceptance/RunCommandTest.php drives the command end-to-end down to the files on disk: bare flag → runtime/report/index.html exists; explicit path → single file; flag absent → nothing written. The sandbox config swaps the process-wide default HtmlPlugin for a fresh HtmlPlugin::inert(), since the shared instance's single-shot guard is already spent by the outer run.

Docs

  • HtmlPlugin docblock (Activation) now mentions the bare form.
  • skills/testo-run-tests/SKILL.md updated to document the bare form (skills must match behavior per AGENTS.md).

Checklist

…path

`tests/README.md` documents the flag with no path as writing
`runtime/report/index.html`, but the option was registered VALUE_REQUIRED,
so Symfony rejected the bare form before the run even started.

Register it VALUE_OPTIONAL and normalize the valueless form in
`Run::initialize()`, which runs before `Base::execute()` snapshots the
options for config hydration. Symfony reports null both for an absent and a
valueless option, so presence is read from the raw parameters — the
technique `Base::resolveColorMode()` already uses — and mapped to
`HtmlPlugin::DEFAULT_PATH`; a directory destination then produces the
documented `runtime/report/index.html`.

The acceptance tests run the command end-to-end down to the files on disk.
Their sandbox config swaps the default reporter for a fresh
`HtmlPlugin::inert()`: the application defaults hold one shared instance
per process, and its single-shot guard is already spent by the outer run
executing the tests.

Refs php-testo#310

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
@Meacue
Meacue requested a review from a team as a code owner August 28, 2026 18:09

@roxblnfk roxblnfk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed in depth: Symfony lifecycle ordering, parser edge cases, full local suite run against baseline. No regressions, tests follow the module conventions. Thanks!

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@roxblnfk
roxblnfk merged commit 4275e2c into php-testo:1.x Aug 28, 2026
14 of 15 checks passed
@roxblnfk roxblnfk mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test command: --log-html with no path is documented to use the default location, but the CLI rejects the bare flag

2 participants