jenkins-bot has submitted this change and it was merged. Change subject: Temporary fix for SQLite in persistence test ......................................................................
Temporary fix for SQLite in persistence test Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653 --- M tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php 1 file changed, 12 insertions(+), 5 deletions(-) Approvals: AndyRussG: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php index 2300bf0..27be520 100644 --- a/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php +++ b/tests/phpunit/persistence/internal/db/DBPersistenceManagerTest.php @@ -30,11 +30,18 @@ // Create a table to use for test $db = $this->db; - $db->query( 'CREATE TEMPORARY TABLE IF NOT EXISTS ' - . $db->tableName( $this->table ) . ' (' . - 'id int unsigned NOT NULL PRIMARY KEY auto_increment,' . - 'field1 varchar(255) UNIQUE,' . - 'field2 varchar(255) );', + // Temporary measure due to the lack of accommodation in core for + // differences in table creation options. (For WMF CI, tests must run in + // SQLite.) + // TODO Remove this if this is addressed in core. + $autoincrement = + $db->getType() === 'sqlite' ? 'autoincrement' : 'auto_increment'; + + $db->query( "CREATE TEMPORARY TABLE IF NOT EXISTS + {$db->tableName( $this->table )} ( + id integer NOT NULL PRIMARY KEY {$autoincrement}, + field1 varchar(255) UNIQUE, + field2 varchar(255) )", __METHOD__ ); // TestHelper provides some convenience functionality that we use -- To view, visit https://gerrit.wikimedia.org/r/133890 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c770c6becd3e24d8d0b653ceab0f912baca7653 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Campaigns Gerrit-Branch: wip/editorcampaigns Gerrit-Owner: Awight <awi...@wikimedia.org> Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com> Gerrit-Reviewer: Awight <awi...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits