Skip to content
Snippets Groups Projects
Verified Commit d0cfc6d0 authored by Dave Long's avatar Dave Long
Browse files

Issue #3385620 by fjgarlin, andypost: [GitlabCI] SQLite currently not working

parent da9fb154
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,7 @@ stages:
allow_failure: false
variables:
_TARGET_PHP: "8.2"
_TARGET_DB: "mysql-8"
_TARGET_DB: "sqlite-3"
image:
name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
rules:
......@@ -180,11 +180,11 @@ stages:
_TARGET_PHP: "8.2"
_TARGET_DB: "pgsql-16"
# 'PHP 8.2 SQLite 3.34.0':
# <<: [ *default-stage, *run-on-commit ]
# variables:
# _TARGET_PHP: "8.2"
# _TARGET_DB: "php-$_TARGET_PHP-apache"
'PHP 8.2 SQLite 3':
<<: [ *default-stage, *run-on-commit ]
variables:
_TARGET_PHP: "8.2"
_TARGET_DB: "sqlite-3"
# Run daily, or manually.
# 'PHP 8.1 MariaDB 10.3.22':
......@@ -205,11 +205,11 @@ stages:
_TARGET_PHP: "8.1"
_TARGET_DB: "pgsql-14.1"
# 'PHP 8.1 SQLite 3.27.0':
# <<: [ *default-stage, *run-daily ]
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB: "php-$_TARGET_PHP-apache"
'PHP 8.1 SQLite 3':
<<: [ *default-stage, *run-daily ]
variables:
_TARGET_PHP: "8.1"
_TARGET_DB: "sqlite-3"
################
......
......@@ -123,7 +123,7 @@ stages:
script:
# Determine DB driver.
- |
[[ $_TARGET_DB == php* ]] && export SIMPLETEST_DB=sqlite://localhost/subdirectory/sites/default/files/db.sqlite?module=sqlite
[[ $_TARGET_DB == sqlite* ]] && export SIMPLETEST_DB=sqlite://localhost/$CI_PROJECT_DIR/sites/default/files/db.sqlite?module=sqlite
[[ $_TARGET_DB == mysql* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mariadb* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == pgsql* ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
......@@ -131,7 +131,7 @@ stages:
- chown -R www-data:www-data ./sites ./build/logs/junit ./vendor /var/www/
- sudo -u www-data git config --global --add safe.directory $CI_PROJECT_DIR
# Need to pass this along directly.
- sudo MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data php ./core/scripts/run-tests.sh --color --keep-results --types "$TESTSUITE" --concurrency "$CONCURRENCY" --repeat "1" --sqlite "./sites/default/files/.sqlite" --dburl $SIMPLETEST_DB --url $SIMPLETEST_BASE_URL --verbose --non-html --all --ci-parallel-node-index $CI_PARALLEL_NODE_INDEX --ci-parallel-node-total $CI_PARALLEL_NODE_TOTAL
- sudo MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data php ./core/scripts/run-tests.sh --color --keep-results --types "$TESTSUITE" --concurrency "$CONCURRENCY" --repeat "1" --sqlite "./sites/default/files/tests.sqlite" --dburl $SIMPLETEST_DB --url $SIMPLETEST_BASE_URL --verbose --non-html --all --ci-parallel-node-index $CI_PARALLEL_NODE_INDEX --ci-parallel-node-total $CI_PARALLEL_NODE_TOTAL
################
# Jobs
......@@ -292,7 +292,7 @@ stages:
script:
# Determine DB driver.
- |
[[ $_TARGET_DB == php* ]] && export DRUPAL_TEST_DB_URL=sqlite://localhost/subdirectory/sites/default/files/db.sqlite?module=sqlite
[[ $_TARGET_DB == sqlite* ]] && export DRUPAL_TEST_DB_URL=sqlite://localhost/$CI_PROJECT_DIR/sites/default/files/db.sqlite?module=sqlite
[[ $_TARGET_DB == mysql* ]] && export DRUPAL_TEST_DB_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mariadb* ]] && export DRUPAL_TEST_DB_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == pgsql* ]] && export DRUPAL_TEST_DB_URL=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
......
......@@ -47,6 +47,10 @@ protected function setUp(): void {
* - The checkRequirements() method throws a RequirementsException.
*/
public function testMissingDatabase(): void {
if (Database::getConnection()->driver() === 'sqlite') {
$this->markTestSkipped('Not compatible with sqlite');
}
$migration = $this->migrationPluginManager->createInstance('missing_database');
$this->assertInstanceOf(MigrationInterface::class, $migration);
$this->assertInstanceOf(MigrateIdMapInterface::class, $migration->getIdMap());
......
......@@ -132,6 +132,10 @@ public function testConnectionTypes() {
* Tests the exception when a connection is defined but not available.
*/
public function testBrokenConnection(): void {
if (Database::getConnection()->driver() === 'sqlite') {
$this->markTestSkipped('Not compatible with sqlite');
}
$sql_base = new TestSqlBase([], $this->migration);
$target = 'test_state_db_target2';
$key = 'test_state_migrate_connection2';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment