Skip to content

Settings page regression tests (5/6): Logging and Debug tabs - #137

Merged
joaquimds merged 6 commits into
masterfrom
admin-e2e-logging-debug
Nov 12, 2026
Merged

joaquimds merged 6 commits into
masterfrom
admin-e2e-logging-debug

Conversation

@conatus

@conatus conatus commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Fifth of six settings page regression test PRs, and the last that adds tests (#138 adds type and format checks on top). Stacked on #136 → #135 → #134 → #133.

With this, every setting on the settings page has regression tests: what's saved, read back through Settings::get, its effect on the plugin and the join form, and still working when stored the way Carbon Fields stores it.

What's covered (tests/settings/logging-debug.spec.ts)

Logging

  • With Log Retention blank, 10 days of log files are kept, and the tab says so.
  • Log Retention (days) sets how many days' files are kept (checked by laying down dated files and letting Monolog rotate them). The tab says where the number came from.
  • 0, 2.5 and -1 are refused by the browser's own field check, and by the plugin when that check is skipped. Nothing on any tab is saved.
  • The tab shows the latest log.

Debug

  • In a test-data build the form is prefilled. Disable Test Data leaves it empty.

Legacy: retention and Disable Test Data in Carbon Fields' storage format are still read and still apply.

Supporting changes

  • JoinSettingsPage.expectSaveRefused() also counts the browser refusing to submit. New saveSkippingBrowserChecksExpectingErrors() turns that check off, so the plugin's own validation is tested too.
  • Docs: the coverage table now has every tab filled in.

Testing

Locally, the whole E2E suite: 208 passed, 7 skipped (6 known problems from the settings PRs, plus JOIN-158).


Generated by Claude Code

Logging: Log Retention's default and its effect on how many days of log
files are kept, its validation (in the browser and in the plugin), the
tab's note on the retention in force, and the log viewer. Debug: Disable
Test Data. A legacy fixture checks settings stored by Carbon Fields.

With this, every setting on the settings page has regression tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
Comment thread docs/e2e-testing.md Resolved

@conatus conatus left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Supplementary review: one spec selector depends on Carbon Fields. This adds to the inline findings already posted.


Generated by Claude Code

# Conflicts:
#	packages/join-e2e/tests/settings/support.ts
- One expectSaveRefused (from the Membership Plans branch), which tries
  the save rather than asking the form whether it's valid, so a form with
  `novalidate` can't slip through; saveSkippingBrowserChecksExpectingErrors
  is replaced by saveSkippingPageChecksExpectingErrors. The retention test
  re-enters its invalid values before the second save, whichever way the
  first was refused.
- Log rotation is checked against the dates the test laid down, so a run
  across midnight passes, with fewer WP-CLI calls.
- Each test's log files are backed up and put back afterwards.
- The default retention test is skipped, saying why, when
  JOIN_FLOW_LOG_RETENTION_DAYS is set in packages/join-block/.env.
- Skipped test for the Logging tab showing a stale log file (JOIN-172).
- logInfo, logInvalidPlan and PHP_LOG_FILES are shared from support.ts
  with the Integrations logging spec.
- No Carbon Fields class in the spec.
- Docs: GoCardless, Chargebee and address lookup are no longer listed as
  untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
@conatus conatus changed the title Settings page regression tests: Logging and Debug tabs Settings page regression tests (5/6): Logging and Debug tabs Oct 25, 2026
@linear-code

linear-code Bot commented Oct 25, 2026

Copy link
Copy Markdown

JOIN-173

@conatus conatus self-assigned this Oct 30, 2026
… tests

Brings in #133 as merged, including its follow-up review changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
@joaquimds
joaquimds changed the base branch from admin-e2e-integrations to master November 11, 2026 13:58
joaquimds and others added 2 commits November 11, 2026 13:59
Resolves a conflict in integrations-logging.spec.ts: this branch moved the
logging helpers to support.ts as logInfo() and logInvalidPlan(), and master
added sentTo() and a Sentry check that waits for the error's event. Keep
both, using the renamed helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An interrupted run no longer loses the real log files: the backup
  folder is empty between tests, so if it isn't, the next backup puts
  those files back first instead of replacing them.
- The log helpers fail clearly if the plugin has no log directory,
  instead of working on files at the filesystem root.
- Only tests that replace the log files back them up, instead of every
  test in the file.
- "The tab shows the latest log" starts from no log files, so a stale
  one can't be shown instead (JOIN-172).
- The Debug tests skip, rather than fail or pass trivially, when the form
  wasn't built with test data. The form says so in the console.
- Whether JOIN_FLOW_LOG_RETENTION_DAYS replaces the default is read from
  the Logging tab, which the web server renders, not from WP-CLI.
- One helper enters the invalid Log Retention values.
- oauth2.googleapis.com is back in the hosts the default logging test
  checks: the fake API now serves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

conatus commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

The e2e check on 0628de0 failed before any test ran, and so did its re-run. In both, the runner couldn't resolve archive.ubuntu.com and security.ubuntu.com while playwright install --with-deps was fetching the browsers' font packages ("Temporary failure resolving … Failed to install browsers").

This is a network problem on GitHub's runner, not something in this PR or the repo, so there's no fix to push. Every other check is green. The e2e job needs running again once the runners can reach Ubuntu's package servers. I've used my one re-run, so it needs someone to click Re-run failed jobs, or a push to the branch will retrigger it.


Generated by Claude Code

@joaquimds
joaquimds merged commit 6a61970 into master Nov 12, 2026
6 of 8 checks passed
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.

3 participants