fix(report): let a bare --log-html fall back to the default report path - #311
Merged
Merged
Conversation
…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>
roxblnfk
approved these changes
Aug 28, 2026
roxblnfk
left a comment
Member
There was a problem hiding this comment.
Reviewed in depth: Symfony lifecycle ordering, parser edge cases, full local suite run against baseline. No regressions, tests follow the module conventions. Thanks!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What
log-htmlis nowInputOption::VALUE_OPTIONAL, and a newRun::initialize()override normalizes the valueless form to the existingHtmlPlugin::DEFAULT_PATH(no new config) — producing the documentedruntime/report/index.html.--log-html=<path>and the absent-flag case are unchanged;--log-reportstays commented out — as requested in the issue.Why
tests/README.mddocuments that--log-htmlwith no path writes the report toruntime/report/index.html, but the option was registeredVALUE_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.phpdrives the command end-to-end down to the files on disk: bare flag →runtime/report/index.htmlexists; explicit path → single file; flag absent → nothing written. The sandbox config swaps the process-wide defaultHtmlPluginfor a freshHtmlPlugin::inert(), since the shared instance's single-shot guard is already spent by the outer run.Docs
HtmlPlugindocblock (Activation) now mentions the bare form.skills/testo-run-tests/SKILL.mdupdated to document the bare form (skills must match behavior per AGENTS.md).Checklist
--log-htmlwith no path is documented to use the default location, but the CLI rejects the bare flag #310