Repository navigation
fix(data-machine-events): isolate committed test fixtures and clear lint errors - #4239
Merged
Merged
Conversation
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.
Fixes #4237 (umbrella #4233).
The events suite now runs 2087 tests on WP Codebox ≥ 0.34.7 instead of 0. This PR fixes 4 of the 7 failures it surfaced, plus the lint on main.
Test isolation: fixtures committed past the per-test rollback
MissingVenueRepairerTest,TicketUrlCanonicalBackfillAbilitiesTestandFilterAbilitiesTestassert global counts, and they failed only in the full run (each passes alone). Earlier tests left committed rows behind:EventTaxonomyAssignerTestruns in autocommit mode. It needs that mode: removing it fails 4 venue tests. It never deleted its posts and terms.EventUpdateAbilitiesTestexercises source updates that issue their ownSTART TRANSACTION/COMMIT. That implicitly commits the test transaction.EffectiveEndTestcreates an event, then callsEventDatesTable::create_table(). ItsALTER TABLEimplicitly commits.I traced these by logging every transaction statement and DDL per test. New
tests/Support/CommittedFixtureCleanuprecords posts and terms created during a test (wp_insert_post,created_term). IntearDownit rolls back, deletes whatever survived, and commits. The three leaking classes use it. CoreTransactionScopecorrectly uses savepoints and wasn't involved.Ticketmaster: concurrency limit wiped by the next settings write
#4228 replaced the removed
datamachine_pipeline_ai_concurrency_limitfilter withPluginSettings::update(). The very next line overwrotedatamachine_settingsfrom a snapshot taken before that update, so the limit was gone and the AI step ran instead of parking. The limit now goes into the same settings write.Lint
EventOwnership::isActingHuman()uses coreRuntimeEnvironment::is_wp_cli().EventDateQueryAbilitieshad three copies of a DB_ENGINE/DATABASE_TYPE SQLite check. All three now use coreBaseRepository::is_sqlite().The other main-lint findings from #4237 were already fixed on main.
Still open in #4237
The three
CalendarExactSearchTestcases fail because mdi-native rejectsORDER BY (ID IN (SELECT …)) DESC. That's an engine gap, tracked upstream in Automattic/markdown-database-integration#490 (fix in progress). Once it ships through the WP Codebox and Homeboy pins, those tests should pass without plugin changes.Evidence
Local WP Codebox 0.35.0 (origin/main build), full suite:
CalendarCacheTest's before-06:00 time guard.homeboy review lint data-machine-events: exit 0.AI disclosure: Claude (Anthropic) in the Pi coding agent, via a Roadie session at the maintainer's direction, wrote this change.
Update: the calendar cases now pass. This needed no plugin change: Automattic/markdown-database-integration#491 (v0.15.7) shipped through Automattic/wp-codebox#2625 (v0.35.3) and Extra-Chill/homeboy#19984 (wordpress-v3.58.15). CI on this PR: 2087 tests, 0 failed, 18 skipped.