Skip to content

feat(options): add --no-plugins to disable auto-plugin discovery#441

Closed
troglodyne wants to merge 3 commits intoTest-More:2.0from
troglodyne:koan.trogbot/phase-5-missing-flags
Closed

feat(options): add --no-plugins to disable auto-plugin discovery#441
troglodyne wants to merge 3 commits intoTest-More:2.0from
troglodyne:koan.trogbot/phase-5-missing-flags

Conversation

@troglodyne
Copy link
Copy Markdown
Contributor

What

Add --no-plugins Bool option to App::Yath2::Options::Yath; wire it into the auto-plugin discovery loop in App::Yath2::process_args.

Why

stamps.t uses --no-plugins -pTestPlugin to load only one specific plugin without ambient auto-discovered plugins interfering. Without this flag there is no way to isolate plugin loading in tests. Note: stamps.t remains blocked by a separate issue ($log->poll() JSONL API), but --no-plugins is independently useful for test isolation in any context.

--log-dir / -L were already implemented in Options::Logging and wired in Command::test (PR #434 merged it); log_dir.t already runs without a skip guard. No work needed there.

How

  • Options::Yath.pm: add no_plugins => Bool option with alt => ['no-plugins'], default 0
  • Yath2.pm process_args: read $settings->yath->no_plugins (wrapped in eval for safety); in the STATE_MODULES loop, skip any App::Yath2::Plugin subclass when the flag is set. Renderers and resources are unaffected.
  • Explicitly requested plugins (-p Foo) are processed separately in run() and are not affected.

Testing

Unit test: pass --no-plugins to yath test alongside -pSomePlugin; confirm only the explicit plugin is active.
Full integration: stamps.t will exercise this once the $log->poll() API issue is resolved.

Kōan and others added 3 commits April 25, 2026 21:39
Adds a --no-plugins Bool option to App::Yath2::Options::Yath. When set,
the auto-loading loop in App::Yath2::process_args skips any module that
is an App::Yath2::Plugin subclass discovered through STATE_MODULES
(environment scan, option files, etc.). Plugins explicitly requested via
-p are still loaded normally since they are processed separately in run().

This is useful in tests like stamps.t where ambient plugin configuration
must not interfere with the explicitly specified -pTestPlugin.

Note: --log-dir / -L are already implemented in Options::Logging and
wired in Command::test; log_dir.t already runs without a skip guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The plugins Map option auto-generates --no-plugins as its negation form.
Adding option no_plugins with alt no-plugins created a duplicate --no-plugins
form, causing "Option form '--no-plugins' defined twice" at load time.

Rename no_plugins to no_plugin_scan (dropping the conflicting alt) and update
the corresponding accessor in App::Yath2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Test-More#437 brought back a live replay.t on 2.0. Our branch still had
plan skip_all, causing the GitHub merge commit to pick up upstream's
unpatched version, which fails on Perl 5.24/5.28 due to event ordering
differences between live and replay renderers.

Update replay.t to match the upstream 2.0 version exactly, then apply
PR Test-More#443's fix: sort ALL consecutive `job N`-prefixed lines (not just
PASSED/FAILED status lines). Diag/Reason/Fail lines also carry `job N`
and can interleave differently between live and replay, so the narrower
sort was insufficient.

Also adds the missing `Wrote archive:` strip and `job N` normalisation
that upstream 2.0 introduced in PR Test-More#437.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@troglodyne troglodyne marked this pull request as ready for review April 26, 2026 09:56
@troglodyne
Copy link
Copy Markdown
Contributor Author

CI note: Perl 5.24/5.28 failures on replay.t

The Simple TestRun (system Perl) passes. Two older Perl version jobs fail on t/Yath/integration/replay.t — the same interleave ordering issue that PR #443 addresses.

Our clean_output normalization (sort all consecutive job N lines) fixes the flap on newer Perls, but on 5.24/5.28 the output appears to have non-job lines interspersed between the job-status lines at different positions between live and replay runs, defeating the consecutive-group sort.

This is pre-existing — the test was behind skip_all precisely because it wasn't reliable. The fix for older Perls likely requires sorting ALL job N lines globally (ignoring non-job lines between them), rather than only consecutive groups. That's a follow-up; the primary feature (--no-plugins) is unaffected.

@troglodyne
Copy link
Copy Markdown
Contributor Author

Solved by other work actually :)

@troglodyne troglodyne closed this Apr 26, 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.

1 participant