Skip to content

Pass test theme through to WPLoader in module CI#1061

Open
mikelittle wants to merge 2 commits into
masterfrom
fix-wploader-theme-override
Open

Pass test theme through to WPLoader in module CI#1061
mikelittle wants to merge 2 commits into
masterfrom
fix-wploader-theme-override

Conversation

@mikelittle
Copy link
Copy Markdown
Contributor

Summary

Module CI runs (e.g. altis-core run 25849311914) fail during WPLoader bootstrap with:

In WPLoader.php line 839:
WPLoader: Failed to switch to theme . The theme directory "default" does not exist.

The workflow already requires `altis/test-theme` and sets it as the CMS module's `default-theme` in `composer.json`, but WPLoader reads its own `theme` value from `extra.altis.modules.dev-tools.codeception.modules.config.WPLoader.theme`. Without a value there, the dev-tools-command default of `theme: ''` reaches WPLoader, and wp-browser's `activatePluginsSwitchThemeInSeparateProcess()` casts the empty string to `['']` and tries to switch to a theme with an empty name — WordPress resolves that to a non-existent "default" theme directory and aborts the test bootstrap.

dev-tools' own CI runs green because the caller `ci.yml` sets `test-command: phpunit`, which skips WPLoader entirely. All modules that use the default (`codecept`) hit this.

This extends the `jq` filter that writes the CMS default-theme to also write the WPLoader override under `extra.altis.modules.dev-tools.codeception`, so the merged codeception config picks up a real theme to switch to.

Test plan

  • Trigger CI on a downstream module that uses `test-command: codecept` (e.g. open a no-op PR on altis-core after this lands) and confirm the WPLoader theme-switch error is gone.
  • Confirm dev-tools' own self-CI (`phpunit`) still passes.

🤖 Generated with Claude Code

The module-ci workflow already requires altis/test-theme and sets it as the
CMS module's default-theme, but WPLoader reads its own `theme` value from
extra.altis.modules.dev-tools.codeception.* in composer.json. With no value
there, the dev-tools-command default of `theme: ''` reaches WPLoader, and
wp-browser's `activatePluginsSwitchThemeInSeparateProcess()` casts the empty
string to `[ '' ]` and tries to switch to a theme with an empty name, which
WordPress resolves to a non-existent "default" theme directory and aborts
the test bootstrap.

Threading test-theme through to the WPLoader override gives the bootstrap a
real theme to switch to.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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