Skip to content

Commit 8ebcdfc

Browse files
committed
fix(tests): Add separate database dumps for MySQL and PostgreSQL
PostgreSQL tests were failing because they were trying to import a MySQL database dump. Split the single db.sql.gz into: - db-mysql.sql.gz (for MySQL and MariaDB tests) - db-postgres.sql.gz (for PostgreSQL tests) Updated per_test.sh to select the correct dump based on EXPECTED_DB_TYPE variable set by the test framework. This fixes postgres-flex and postgres-fixed test failures on CI.
1 parent ad4fd66 commit 8ebcdfc

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/per_test.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ per_test_setup() {
1717
run ddev composer install --no-dev --no-interaction
1818
assert_success
1919

20-
if [ -f ${PROJECT_SOURCE}/tests/testdata/drupal11-base/db.sql.gz ]; then
21-
echo "# Importing database ${PROJECT_SOURCE}/tests/testdata/drupal11-base/db.sql.gz" >&3
22-
run ddev import-db --file=${PROJECT_SOURCE}/tests/testdata/drupal11-base/db.sql.gz
20+
# Select database dump based on database type
21+
if [[ "${EXPECTED_DB_TYPE:-}" == "postgres" ]]; then
22+
DB_DUMP="${PROJECT_SOURCE}/tests/testdata/drupal11-base/db-postgres.sql.gz"
23+
else
24+
DB_DUMP="${PROJECT_SOURCE}/tests/testdata/drupal11-base/db-mysql.sql.gz"
25+
fi
26+
27+
if [ -f "${DB_DUMP}" ]; then
28+
echo "# Importing database ${DB_DUMP}" >&3
29+
run ddev import-db --file="${DB_DUMP}"
2330
assert_success
2431
fi
2532
}
1.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)