Skip to content

Commit dfbfbba

Browse files
authored
fix(Spanner): Make System Tests Work & Work Faster (#9401)
* test(spanner): add IF NOT EXISTS to PostgreSQL DDL statements test(spanner): consolidate test database provisioning fix(spanner): fix PgReadTest index creation on shared database test(spanner): Consolidate DDL operations into test setup suite test(spanner): fix schema mismatches for partitionedDml and PgQueryTest test(spanner): rename PgQueryTest_2 back to PgQueryTest test(spanner): fix PostgreSQL column name mismatches for test tables * test(spanner): BackupTest reliability and optimization test(spanner): Handle DEADLINE_EXCEEDED in BackupTest test(spanner): fix BackupTest timeout and PgQueryTest schema collision test(spanner): add deadline exceeded polling to testCreateBackup2 refactor(spanner): DRY up extended polling loop in BackupTest * chore: enable Spanner system tests in CI * test(spanner): avoid ID collisions by using self::randId() with a larger range test(spanner): restore seedTable in BatchTest to fix test coverage test(spanner): fix array_rand bug and batch mutations in seedTable test(spanner): fix fundamentally broken partitionRead test logic in BatchTest fix: move seedTable back to its original location fix(cs): fix style issues in BatchTest.php fix(cs): format multi-line args * fix(spanner): fix test database initialization and teardown on persistent databases, and apply code review fixes for tests * test(spanner): rollback open transaction in ReadTest * test(spanner): clear stale backups before running BackupTest * address PR comments * test(spanner): refactor backup tests (remove backup2) and add ApiException catching Refactors backup tests for clarity and adds catching of ApiException where appropriate. Also adds debug logging to system tests for better observability. * feat(spanner): enable parallel test execution * fix: add break to prevent infinite loop in BackupTest * fix: reload backup object before asserting state * test: add Database::STATE_READY assertion in testRestoreToNewDatabase * chore(Spanner): setting instance processing units to 1000 * fix(Spanner): fixing bugs in UniverseDomainTest and BackupTest * fix(Spanner): fix premature setup flag assignment in system tests * doc(Spanner): Readme clarifications * docs(Spanner): add paratest to dependencies and clarify system test README
1 parent 2b8ac7a commit dfbfbba

27 files changed

Lines changed: 1063 additions & 831 deletions

‎Core/src/Testing/System/SystemTestCase.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function processQueue()
7676
*/
7777
public static function randId()
7878
{
79-
return rand(1, 9999999);
79+
return rand(1, 999999999);
8080
}
8181

8282
/**

‎Spanner/composer.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"dg/bypass-finals": "^1.7",
2323
"dms/phpunit-arraysubset-asserts": "^0.5.0",
2424
"symfony/process": "^6.4",
25-
"nikic/php-parser": "^5.0"
25+
"nikic/php-parser": "^5.0",
26+
"brianium/paratest": "^6.11"
2627
},
2728
"suggest": {
2829
"ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.",

‎Spanner/tests/System/AdminTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testInstance()
6868
$this->assertEquals(Instance::STATE_READY, $instance->state());
6969

7070
$displayName = uniqid(self::TESTING_PREFIX);
71-
$processingUnits = 500;
71+
$processingUnits = 1000;
7272
$op = $instance->update([
7373
'displayName' => $displayName,
7474
'processingUnits' => $processingUnits,

0 commit comments

Comments
 (0)