Skip to content

fix(data-machine-events): isolate committed test fixtures and clear lint errors - #4239

Merged
chubes4 merged 1 commit into
mainfrom
fix/events-hidden-failures-4237
Dec 3, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/events-hidden-failures-4237

Conversation

@chubes4

@chubes4 chubes4 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

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, TicketUrlCanonicalBackfillAbilitiesTest and FilterAbilitiesTest assert global counts, and they failed only in the full run (each passes alone). Earlier tests left committed rows behind:

  • EventTaxonomyAssignerTest runs in autocommit mode. It needs that mode: removing it fails 4 venue tests. It never deleted its posts and terms.
  • EventUpdateAbilitiesTest exercises source updates that issue their own START TRANSACTION/COMMIT. That implicitly commits the test transaction.
  • EffectiveEndTest creates an event, then calls EventDatesTable::create_table(). Its ALTER TABLE implicitly commits.

I traced these by logging every transaction statement and DDL per test. New tests/Support/CommittedFixtureCleanup records posts and terms created during a test (wp_insert_post, created_term). In tearDown it rolls back, deletes whatever survived, and commits. The three leaking classes use it. Core TransactionScope correctly uses savepoints and wasn't involved.

Ticketmaster: concurrency limit wiped by the next settings write

#4228 replaced the removed datamachine_pipeline_ai_concurrency_limit filter with PluginSettings::update(). The very next line overwrote datamachine_settings from 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 core RuntimeEnvironment::is_wp_cli().
  • EventDateQueryAbilities had three copies of a DB_ENGINE/DATABASE_TYPE SQLite check. All three now use core BaseRepository::is_sqlite().

The other main-lint findings from #4237 were already fixed on main.

Still open in #4237

The three CalendarExactSearchTest cases fail because mdi-native rejects ORDER 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:

  • main: 2087 tests, 7 failed.
  • this branch: 2087 tests, 3 failed (the 3 calendar cases above), 18 skipped. The 18th skip is 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.

@chubes4
chubes4 marked this pull request as ready for review December 3, 2026 04:27
@chubes4
chubes4 merged commit f7fdccb into main Dec 3, 2026
7 of 8 checks passed
@chubes4
chubes4 deleted the fix/events-hidden-failures-4237 branch December 3, 2026 04:28
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.

events: fix the 7 PHPUnit failures and lint errors hidden while CI ran 0 tests

1 participant