test: speed up and slim down the integration suite#815
Merged
Conversation
Stacked expectException calls left every assertion after the first dead: ScaffoldedTest salts getters (plus an expectedException typo that made the last check a no-op), MultisiteTest state transitions, WPQueriesTest failing assertions. Replaced with loops/assertFails so each check runs; this exposed four wrong assertNotQueriesByStatementAnd* expectations now pointed at the entities that do produce SELECT queries. SingleMultisiteConversionTest siteurl-conversion test asserted nothing and could not fail; it now expects the WPDieException the flow actually raises. Removed a dead duplicated config block in WPTestCaseStrictTest.
Read-only getter tests rebuilt an identical scaffold/configure/install per test. Each class now lazily builds one shared fixture (plus a variant where 3+ tests share the same custom config) and constructs a fresh state object per test; mutating tests keep their own installation. SingleDirectoriesTest is deleted: Single and Configured share ConfiguredStateTrait, and every getter+config combination it asserted is covered install-free in ConfiguredTest; the installed-state coverage moved to one consolidated test on SingleRuntimeTest's cached fixture. Local wall time: MultisiteTest 35.7s -> 20.2s, SingleRuntime+SingleDirectories 28.9s -> 8.1s, ConfiguredTest 13.2s -> ~9s, ScaffoldedTest 5.2s -> ~2.7s.
WpTestsConfigTest, WPLoaderLoadOnlyTest, WPLoaderRelativeConfigTest, WPLoaderScaffoldedInstallationCustomLocationsTest and SqliteDatabaseTest never load WordPress or touch a database server; they were misfiled in the integration suite.
- WpbrowserTest: plugin/theme/bedrock scaffold pairs differing only by entry filename or recommended-setup answer merged (8 methods -> 4); snapshot files renamed to the provider dataset naming. - SymlinkerTest: relative/absolute path twins and the two no-cleanup tests merged; the 5x duplicated vendor fixture array extracted to one helper. - LoadSandboxTest: the three not-installed variants merged into one provider. - WPCLITest: seven single-flag builder tests and four config-throw variants merged into two provider tests (~200 duplicated lines removed). - DbExportTest: standalone MySQL/SQLite dump tests folded into DbImportTest round-trips, which already exported as a precondition; export exit code now asserted there. - SingleConstructionTest: install-again/scaffold-again twins merged into one test that exercises both throws.
Integration tests use per-file sharding and Random::dbName() databases, so workers do not collide. Cuts the ~8 minute serial run to the slowest shard.
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.
No description provided.