Repository navigation
Speed up the test suite - #286
Merged
Merged
Conversation
* Load the test data once per run, and shorten the API sweep Thirty-eight test classes each reloaded both fixtures (0.8s apiece), and the saint search tests backfilled slugs and rebuilt the search index before every test. A test runner now does all of that once, after the test database is created, as the Dockerfile does for production. The day API sweep in test_errors covers one year instead of seven; the fasting snapshot already covers ten years of Day. The tests now take 13s instead of 87-102s. Building the test database, which loads the scriptures, still takes about 38s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Start the tests from the database the Docker image built The image's db.sqlite3 already has the migrations applied, including the scripture loads that took about 38s of every run, and the fixtures, slugs and search index loaded. The test runner now copies it into place as the test database and keeps it, so a Docker test run takes 14s instead of 57s. Without a current db.sqlite3 it builds from scratch and loads the data once, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Load the scriptures with expat and bulk_create parse_usfx went through pulldom, which builds a DOM node and attribute objects for every element and text run, and the migrations inserted the 171,116 verses one row at a time. The same parsing logic now runs from expat callbacks, and the verses go in with bulk_create. Loading the scriptures takes 6.4s instead of 31.2s, which every image build and every fresh test database pays; the verse table comes out byte for byte the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove the unused ingest_usfx command It passed parse_usfx a language argument it never accepted, so it failed as soon as it ran. The scripture migrations load the Bibles instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- 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.
#285 merged into
feasts-speedupafter #284 had already been merged into main, so its changes never reached main. This is the same squashed commit, cherry-picked onto main. It applies cleanly and all 309 tests pass.See #285 for the details: the test runner starts from the Docker image's database, fixtures load once per run, scriptures load with expat and
bulk_create, and the unusedingest_usfxcommand is removed.🤖 Generated with Claude Code