Skip to content

Pass test theme through to WPLoader in module CI#1061

Merged
mikelittle merged 2 commits into
masterfrom
fix-wploader-theme-override
May 19, 2026
Merged

Pass test theme through to WPLoader in module CI#1061
mikelittle merged 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>
Copy link
Copy Markdown
Contributor

@jerico jerico left a comment

Choose a reason for hiding this comment

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

CI passes

@mikelittle mikelittle merged commit 9c25b83 into master May 19, 2026
1 of 2 checks passed
@mikelittle mikelittle deleted the fix-wploader-theme-override branch May 19, 2026 17:07
mikelittle added a commit to humanmade/altis-media that referenced this pull request May 19, 2026
Picks up humanmade/altis-dev-tools#1061 (Pass test theme through to
WPLoader), which was merged to master after our previous run failed at
WPLoader bootstrap. The rebased #1065 branch has both the WPLoader
theme fix and the artifact-name / module-config additions.

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.

2 participants