Repository navigation
feat(scripts): add an end-to-end upgrade check - #264
Merged
Merged
Conversation
The unit tests do not cover the Wagtail admin or page rendering, so dependency upgrades (Wagtail, Django) had to be checked by hand. scripts/upgrade-check/run.sh automates it: - start a disposable PostgreSQL 17 container - migrate and seed representative content with the base ref (master by default) in a temporary worktree - with the current checkout: apply the pending migrations, run check, makemigrations --check and collectstatic --clear - diff the rendered public pages before and after the upgrade - run the server with DEBUG off and drive the admin with Playwright (explorer, rich text editing and publishing, page creation, preview, history, snippets, images, documents, settings, Django admin, public pages, redirect and 404) Exposed as `task upgrade:check`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The settings never need a Redis client, and fakeredis is being removed from the dev dependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The unit tests do not cover the Wagtail admin or page rendering, so every Wagtail/Django upgrade needs a manual check. This PR turns the check done for #262 (Wagtail 8.1) into a reusable script.
Usage
From the checkout of an upgrade branch:
The script exits with status 0 on success and 1 on failure. Logs, HTML snapshots and screenshots are kept in a temporary run directory.
What it does
check,makemigrations --checkandcollectstatic --clear.DEBUGoff and drives the admin with Playwright: login, page explorer, listing and search, rich-text edit and publish, page creation, preview, history, draft, snippets, images, documents, settings, Django admin, public pages, redirect and 404.The container, server and temporary worktree are always cleaned up.
See
scripts/upgrade-check/README.mdfor requirements and configuration.Files
scripts/upgrade-check/run.sh: orchestrationscripts/upgrade-check/seed.py,snapshot.py,browser_check.py: seed data, HTML snapshots, browser stepsscripts/upgrade-check/upgrade_check_settings.py,upgrade_check_urls.py: settings and URLs for the checkTaskfile.yaml:upgrade:checktaskTested
Ran it on the #262 branch (Wagtail 7.3.4 → 8.1) against
master, with and without--docker. All 12 browser steps pass, the HTML is identical before and after, and the cleanup leaves no container, server or worktree behind.🤖 Generated with Claude Code