Skip to content

Commit f38954d

Browse files
committed
B2B-1986: Get Cloud-Native-Testing Integration Test Builds to Work Against Aurora
1 parent fea0bba commit f38954d

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

dev/tests/setup-integration/framework/bootstrap.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@
8383
$application->createInstallDir();
8484
//We do not want to install anything
8585
$application->initialize([]);
86-
$application->cleanup();
86+
87+
if ($settings->getAsBoolean('TESTS_CLEANUP')) {
88+
$application->cleanup();
89+
}
8790

8891
\Magento\TestFramework\Helper\Bootstrap::setInstance(new \Magento\TestFramework\Helper\Bootstrap($bootstrap));
8992

setup/src/Magento/Setup/Validator/DbValidator.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,15 @@ public function checkDatabaseConnectionWithDriverOptions(
141141
*/
142142
private function checkDatabaseName(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $dbName)
143143
{
144-
$query = "SHOW DATABASES";
145-
$accessibleDbs = $connection->query($query)->fetchAll(\PDO::FETCH_COLUMN, 0);
146-
foreach ($accessibleDbs as $accessibleDbName) {
147-
if ($dbName == $accessibleDbName) {
148-
return true;
149-
}
144+
try {
145+
$connection->query("SHOW TABLES FROM $dbName")->fetchAll(\PDO::FETCH_COLUMN, 0);
146+
return true;
147+
} catch (\Exception $e) {
148+
throw new \Magento\Setup\Exception(
149+
"Database '{$dbName}' does not exist "
150+
. "or specified database server user does not have privileges to access this database."
151+
);
150152
}
151-
throw new \Magento\Setup\Exception(
152-
"Database '{$dbName}' does not exist "
153-
."or specified database server user does not have privileges to access this database."
154-
);
155153
}
156154

157155
/**

0 commit comments

Comments
 (0)