Skip to content
Snippets Groups Projects
Commit c7b7c9d5 authored by Lee Rowlands's avatar Lee Rowlands Committed by Fran Garcia-Linares
Browse files

#3375827 Fixing tests

parent dfe2ab42
No related branches found
No related tags found
1 merge request!5#3375827 Fixing tests
......@@ -94,6 +94,7 @@ variables:
_TARGET_PHP: "8.1"
_TARGET_DB_TYPE: "mysql"
_TARGET_DB_VERSION: "5.7"
_DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
trigger:
# Rely on the status of the child pipeline.
strategy: depend
......@@ -108,6 +109,7 @@ variables:
_TARGET_PHP: "8.1"
_TARGET_DB_TYPE: "mysql"
_TARGET_DB_VERSION: "8"
_DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
trigger:
# Rely on the status of the child pipeline.
strategy: depend
......@@ -123,6 +125,7 @@ variables:
_TARGET_PHP: "8.1"
_TARGET_DB_TYPE: "pgsql"
_TARGET_DB_VERSION: "13.5"
_DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
trigger:
# Rely on the status of the child pipeline.
strategy: depend
......@@ -138,6 +141,7 @@ variables:
_TARGET_PHP: "8.1"
_TARGET_DB_TYPE: "pgsql"
_TARGET_DB_VERSION: "14.1"
_DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
trigger:
# Rely on the status of the child pipeline.
strategy: depend
......@@ -146,3 +150,35 @@ variables:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
# 'PHP 8.1 SQLite 3.26.0':
# stage: test
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB_TYPE: "sqlite"
# _TARGET_DB_VERSION: "3.26.0"
# _DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
# trigger:
# # Rely on the status of the child pipeline.
# strategy: depend
# include:
# - local: .gitlab-ci/pipeline.yml
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# when: manual
# 'PHP 8.1 MariaDB 10.3.22':
# stage: test
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB_TYPE: "mariadb"
# _TARGET_DB_VERSION: "10.3.22"
# _DB_IMAGE: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
# trigger:
# # Rely on the status of the child pipeline.
# strategy: depend
# include:
# - local: .gitlab-ci/pipeline.yml
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# when: manual
......@@ -140,7 +140,7 @@ stages:
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-dev-shm-usage","--disable-gpu","--headless"]}}, "http://localhost:9515"]'
.with-database: &with-database
name: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB_TYPE-$_TARGET_DB_VERSION:production
name: $_DB_IMAGE
alias: database
.with-chrome: &with-chrome
......@@ -172,11 +172,12 @@ stages:
script:
# Determine DB driver.
- |
[[ $_TARGET_DB_TYPE == "sqlite" ]] && export SIMPLETEST_DB=sqlite://localhost/sites/default/files/.sqlite
[[ $_TARGET_DB_TYPE == "sqlite" ]] && export SIMPLETEST_DB=sqlite://localhost/subdirectory/sites/default/files/db.sqlite
[[ $_TARGET_DB_TYPE == "mysql" ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
[[ $_TARGET_DB_TYPE == "mariadb" ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
[[ $_TARGET_DB_TYPE == "pgsql" ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB
- export
- mkdir -p ./sites/simpletest ./build/logs/junit /var/www/.composer
- mkdir -p ./sites/simpletest ./sites/default/files ./build/logs/junit /var/www/.composer
- 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
# We need to pass this along directly even though it's set in the environment parameters.
......@@ -349,8 +350,9 @@ stages:
script:
# Determine DB driver.
- |
[[ $_TARGET_DB_TYPE == "sqlite" ]] && export DRUPAL_TEST_DB_URL=sqlite://localhost/sites/default/files/.sqlite
[[ $_TARGET_DB_TYPE == "sqlite" ]] && export DRUPAL_TEST_DB_URL=sqlite://localhost/subdirectory/sites/default/files/db.sqlite
[[ $_TARGET_DB_TYPE == "mysql" ]] && export DRUPAL_TEST_DB_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
[[ $_TARGET_DB_TYPE == "mariadb" ]] && export DRUPAL_TEST_DB_URL=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE
[[ $_TARGET_DB_TYPE == "pgsql" ]] && export DRUPAL_TEST_DB_URL=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB
- export
- cp ./core/.env.example ./core/.env
......@@ -365,8 +367,8 @@ stages:
- echo "DRUPAL_TEST_WEBDRIVER_PORT='9515'" >> ./core/.env
- echo "DRUPAL_NIGHTWATCH_OUTPUT='"nightwatch_output"'" >> ./core/.env
- cat ./core/.env
- mkdir -p ./sites/simpletest /var/www/.cache/yarn /var/www/.yarn ./nightwatch_output
- chown -R www-data:www-data ./sites/simpletest /var/www/.cache/yarn /var/www/.yarn ./nightwatch_output ./core/.env
- mkdir -p ./sites/simpletest ./sites/default/files /var/www/.cache/yarn /var/www/.yarn ./nightwatch_output
- chown -R www-data:www-data ./sites/simpletest ./sites/default/files /var/www/.cache/yarn /var/www/.yarn ./nightwatch_output ./core/.env
- sudo BABEL_DISABLE_CACHE=1 -u www-data yarn --cwd ./core test:nightwatch
artifacts:
when: always
......
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