2024-07-24 08:40:15 +00:00
|
|
|
|
# cspell:ignore cobertura drupaltestbot drupaltestbotpw Dwebdriver logfile XVFB
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
|
|
|
|
stages:
|
|
|
|
|
- 🗜️ Test
|
|
|
|
|
|
|
|
|
|
#############
|
|
|
|
|
# Templates #
|
|
|
|
|
#############
|
|
|
|
|
|
2023-11-15 10:40:40 +00:00
|
|
|
|
default:
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
interruptible: true
|
2023-10-04 14:58:47 +00:00
|
|
|
|
retry:
|
|
|
|
|
max: 2
|
|
|
|
|
when:
|
|
|
|
|
- unknown_failure
|
|
|
|
|
- api_failure
|
|
|
|
|
- stuck_or_timeout_failure
|
|
|
|
|
- runner_system_failure
|
|
|
|
|
- scheduler_failure
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
image:
|
|
|
|
|
name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
|
2023-11-15 10:40:40 +00:00
|
|
|
|
before_script:
|
2023-11-23 10:33:20 +00:00
|
|
|
|
- |
|
2023-11-15 10:40:40 +00:00
|
|
|
|
[[ $_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
|
2023-11-24 12:48:52 +00:00
|
|
|
|
- echo "SIMPLETEST_DB = $SIMPLETEST_DB"
|
2023-11-23 10:33:20 +00:00
|
|
|
|
- $CI_PROJECT_DIR/.gitlab-ci/scripts/server-setup.sh
|
2023-11-22 22:13:09 +00:00
|
|
|
|
after_script:
|
|
|
|
|
- sed -i "s#$CI_PROJECT_DIR/##" ./sites/default/files/simpletest/phpunit-*.xml || true
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
artifacts:
|
2023-11-15 10:40:40 +00:00
|
|
|
|
when: always
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
expire_in: 6 mos
|
|
|
|
|
reports:
|
2023-11-15 10:40:40 +00:00
|
|
|
|
junit: ./sites/default/files/simpletest/phpunit-*.xml
|
|
|
|
|
paths:
|
|
|
|
|
- ./sites/default/files/simpletest/phpunit-*.xml
|
|
|
|
|
- ./sites/simpletest/browser_output
|
2023-11-25 20:47:06 +00:00
|
|
|
|
- '*.log'
|
2023-11-15 10:40:40 +00:00
|
|
|
|
|
|
|
|
|
.default-job-settings: &default-job-settings
|
|
|
|
|
stage: 🗜️ Test
|
|
|
|
|
rules:
|
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "parent_pipeline" && $PERFORMANCE_TEST != "1"
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
2023-10-05 06:52:57 +00:00
|
|
|
|
.with-composer: &with-composer
|
|
|
|
|
needs:
|
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
2024-07-26 22:26:06 +00:00
|
|
|
|
job: '🧹 PHP Coding standards (PHPCS)'
|
2023-10-05 06:52:57 +00:00
|
|
|
|
|
2023-09-22 05:50:51 +00:00
|
|
|
|
.with-composer-and-yarn: &with-composer-and-yarn
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
needs:
|
2023-10-05 06:52:57 +00:00
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
2024-07-26 22:26:06 +00:00
|
|
|
|
job: '🧹 PHP Coding standards (PHPCS)'
|
2023-10-05 06:52:57 +00:00
|
|
|
|
- pipeline: $PARENT_PIPELINE_ID
|
2024-07-26 22:26:06 +00:00
|
|
|
|
job: '📔 Spell-checking'
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
2023-11-15 10:40:40 +00:00
|
|
|
|
variables:
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
FF_NETWORK_PER_BUILD: 1
|
|
|
|
|
SIMPLETEST_BASE_URL: http://localhost/subdirectory
|
|
|
|
|
DB_DRIVER: mysql
|
|
|
|
|
MYSQL_ROOT_PASSWORD: root
|
|
|
|
|
MYSQL_DATABASE: mysql
|
|
|
|
|
MYSQL_USER: drupaltestbot
|
|
|
|
|
MYSQL_PASSWORD: drupaltestbotpw
|
|
|
|
|
POSTGRES_DB: drupaltestbot
|
|
|
|
|
POSTGRES_USER: drupaltestbot
|
|
|
|
|
POSTGRES_PASSWORD: drupaltestbotpw
|
2024-07-24 08:40:15 +00:00
|
|
|
|
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox","--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://selenium:4444"]'
|
|
|
|
|
MINK_DRIVER_ARGS_WEBDRIVER_CHROMEDRIVER_NON_W3C: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-dev-shm-usage","--disable-gpu","--headless","--dns-prefetch-disable"]}}, "http://localhost:9515"]'
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
CI_PARALLEL_NODE_INDEX: $CI_NODE_INDEX
|
|
|
|
|
CI_PARALLEL_NODE_TOTAL: $CI_NODE_TOTAL
|
|
|
|
|
|
|
|
|
|
.with-database: &with-database
|
2023-09-15 08:41:49 +00:00
|
|
|
|
name: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB:production
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
alias: database
|
|
|
|
|
|
|
|
|
|
.with-chrome: &with-chrome
|
|
|
|
|
name: $_CONFIG_DOCKERHUB_ROOT/chromedriver:production
|
|
|
|
|
alias: chrome
|
|
|
|
|
entrypoint:
|
|
|
|
|
- chromedriver
|
|
|
|
|
- "--no-sandbox"
|
2023-11-25 20:47:06 +00:00
|
|
|
|
- "--log-path=/builds/chromedriver.log"
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
- "--whitelisted-ips="
|
2024-02-02 14:22:05 +00:00
|
|
|
|
- "--allowed-origins=*"
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
2024-07-24 08:40:15 +00:00
|
|
|
|
.with-selenium-chrome: &with-selenium-chrome
|
|
|
|
|
name: selenium/standalone-chrome:latest
|
|
|
|
|
alias: selenium
|
|
|
|
|
variables:
|
|
|
|
|
JAVA_OPTS: "-Dwebdriver.chrome.logfile=/builds/chromedriver.log"
|
|
|
|
|
SE_NODE_OVERRIDE_MAX_SESSIONS: "true"
|
|
|
|
|
SE_NODE_MAX_SESSIONS: "5"
|
|
|
|
|
SE_START_XVFB: "false"
|
|
|
|
|
SE_START_VNC: "false"
|
|
|
|
|
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
.run-tests: &run-tests
|
|
|
|
|
script:
|
|
|
|
|
# Need to pass this along directly.
|
2023-09-29 16:01:46 +00:00
|
|
|
|
- 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
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
2023-10-31 14:15:55 +00:00
|
|
|
|
.run-repeat-class-test: &run-repeat-class-test
|
|
|
|
|
script:
|
|
|
|
|
- echo "ℹ️ Running class ${REPEAT_TEST_CLASS}"
|
|
|
|
|
- |
|
|
|
|
|
if [[ $REPEAT_TEST_CLASS == "Drupal\Tests\Change\Me" ]]; then
|
|
|
|
|
echo '❗ You need to change the REPEAT_TEST_CLASS variable to an existing class before running the job.'
|
|
|
|
|
echo ' You just need to click on the job that you want to run (do not press the play button straight away) and then set the following:'
|
|
|
|
|
echo ' "Key" to "REPEAT_TEST_CLASS" and "Value" to "Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLinkabilityTest"';
|
|
|
|
|
exit 1;
|
|
|
|
|
else
|
|
|
|
|
sudo MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data php ./core/scripts/run-tests.sh --color --keep-results --concurrency "$CONCURRENCY" --repeat "100" --sqlite "./sites/default/files/tests.sqlite" --dburl $SIMPLETEST_DB --url $SIMPLETEST_BASE_URL --verbose --non-html --class $REPEAT_TEST_CLASS
|
|
|
|
|
fi
|
|
|
|
|
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
################
|
|
|
|
|
# Jobs
|
|
|
|
|
#
|
|
|
|
|
# Jobs define what scripts are actually executed in each stage.
|
|
|
|
|
#
|
|
|
|
|
# The 'rules' keyword can also be used to define conditions for each job.
|
|
|
|
|
#
|
|
|
|
|
# Documentation: https://docs.gitlab.com/ee/ci/jobs/
|
|
|
|
|
################
|
|
|
|
|
|
2023-09-29 09:02:33 +00:00
|
|
|
|
'🩹 Test-only changes':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer, *default-job-settings ]
|
2023-09-29 09:02:33 +00:00
|
|
|
|
when: manual
|
|
|
|
|
allow_failure: true
|
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
- <<: *with-chrome
|
|
|
|
|
script:
|
2023-11-23 10:33:20 +00:00
|
|
|
|
- $CI_PROJECT_DIR/.gitlab-ci/scripts/test-only.sh
|
2023-09-29 09:02:33 +00:00
|
|
|
|
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
'🖱️️️ PHPUnit Functional Javascript':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer, *run-tests, *default-job-settings ]
|
2024-07-24 08:40:15 +00:00
|
|
|
|
parallel: 4
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-FunctionalJavascript
|
|
|
|
|
CONCURRENCY: 15
|
2023-11-30 14:30:05 +00:00
|
|
|
|
KUBERNETES_CPU_REQUEST: "24"
|
2024-07-24 08:40:15 +00:00
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
- <<: *with-selenium-chrome
|
|
|
|
|
after_script:
|
|
|
|
|
- echo $MINK_DRIVER_ARGS_WEBDRIVER
|
|
|
|
|
- sed -i "s#$CI_PROJECT_DIR/##" ./sites/default/files/simpletest/phpunit-*.xml || true
|
|
|
|
|
- cp /builds/chromedriver.log ./
|
|
|
|
|
|
|
|
|
|
'🖱️️️ PHPUnit Functional Javascript (non W3C legacy)':
|
|
|
|
|
<<: [ *with-composer, *default-job-settings ]
|
|
|
|
|
parallel: 1
|
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-FunctionalJavascript
|
|
|
|
|
CONCURRENCY: 15
|
|
|
|
|
KUBERNETES_CPU_REQUEST: "24"
|
|
|
|
|
MINK_DRIVER_ARGS_WEBDRIVER: $MINK_DRIVER_ARGS_WEBDRIVER_CHROMEDRIVER_NON_W3C
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
- <<: *with-chrome
|
2024-07-24 08:40:15 +00:00
|
|
|
|
script:
|
|
|
|
|
# Run a small subset of tests to prove non W3C testing still works.
|
|
|
|
|
- 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 javascript
|
|
|
|
|
|
2023-11-25 20:47:06 +00:00
|
|
|
|
after_script:
|
|
|
|
|
- sed -i "s#$CI_PROJECT_DIR/##" ./sites/default/files/simpletest/phpunit-*.xml || true
|
|
|
|
|
- cp /builds/chromedriver.log ./
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
|
2024-01-04 16:56:28 +00:00
|
|
|
|
'🌐️️ PHPUnit Functional':
|
|
|
|
|
<<: [ *with-composer, *run-tests, *default-job-settings ]
|
|
|
|
|
parallel: 7
|
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-Functional
|
|
|
|
|
KUBERNETES_CPU_REQUEST: "24"
|
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
|
|
|
|
|
'⚙️️ PHPUnit Kernel':
|
|
|
|
|
<<: [ *with-composer, *run-tests, *default-job-settings ]
|
2024-01-30 22:53:00 +00:00
|
|
|
|
parallel: 3
|
2024-01-04 16:56:28 +00:00
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-Kernel
|
|
|
|
|
KUBERNETES_CPU_REQUEST: "16"
|
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
'👷️️️ PHPUnit Build':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer, *run-tests, *default-job-settings ]
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-Build
|
2023-11-02 22:49:46 +00:00
|
|
|
|
KUBERNETES_CPU_REQUEST: "2"
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
|
2023-10-04 08:52:51 +00:00
|
|
|
|
'⚡️ PHPUnit Unit':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer, *run-tests, *default-job-settings ]
|
2023-10-04 08:52:51 +00:00
|
|
|
|
services:
|
|
|
|
|
# There are some unit tests that need a database.
|
|
|
|
|
# @todo Remove after https://www.drupal.org/project/drupal/issues/3386217
|
|
|
|
|
- <<: *with-database
|
|
|
|
|
variables:
|
|
|
|
|
TESTSUITE: PHPUnit-Unit
|
2023-11-02 22:49:46 +00:00
|
|
|
|
KUBERNETES_CPU_REQUEST: "16"
|
2023-10-04 08:52:51 +00:00
|
|
|
|
|
2024-05-03 16:39:33 +00:00
|
|
|
|
'✅️ PHPStan Tests':
|
|
|
|
|
<<: [ *default-job-settings ]
|
|
|
|
|
variables:
|
|
|
|
|
KUBERNETES_CPU_REQUEST: "2"
|
|
|
|
|
# Run if PHPStan files have changed, or manually.
|
|
|
|
|
rules:
|
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "parent_pipeline" && $PERFORMANCE_TEST != "1"
|
|
|
|
|
changes:
|
|
|
|
|
- core/tests/PHPStan/*
|
|
|
|
|
- composer/Metapackage/PinnedDevDependencies/composer.json
|
|
|
|
|
- when: manual
|
|
|
|
|
allow_failure: true
|
|
|
|
|
# Default job settings runs a script that expects vendor to exist.
|
|
|
|
|
before_script: []
|
|
|
|
|
script:
|
|
|
|
|
- docker-php-ext-enable pcov
|
|
|
|
|
- cd core/tests/PHPStan
|
|
|
|
|
- composer install
|
|
|
|
|
- vendor/bin/phpunit tests --coverage-text --colors=never --coverage-cobertura=coverage.cobertura.xml --log-junit junit.xml
|
|
|
|
|
# Default job settings runs a script that junit files in a specific location..
|
|
|
|
|
after_script: []
|
|
|
|
|
artifacts:
|
|
|
|
|
when: always
|
|
|
|
|
reports:
|
|
|
|
|
junit: core/tests/PHPStan/junit.xml
|
|
|
|
|
coverage_report:
|
|
|
|
|
coverage_format: cobertura
|
|
|
|
|
path: core/tests/PHPStan/coverage.cobertura.xml
|
|
|
|
|
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
'🦉️️️ Nightwatch':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer-and-yarn, *default-job-settings ]
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
variables:
|
2023-11-30 14:30:05 +00:00
|
|
|
|
KUBERNETES_CPU_REQUEST: "24"
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
2024-07-24 08:40:15 +00:00
|
|
|
|
- <<: *with-selenium-chrome
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
script:
|
2023-10-31 14:15:55 +00:00
|
|
|
|
- export DRUPAL_TEST_DB_URL=$SIMPLETEST_DB
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
- cp ./core/.env.example ./core/.env
|
|
|
|
|
# dotenv-safe/config does not support environment variables
|
|
|
|
|
# @see https://github.com/rolodato/dotenv-safe/issues/126
|
|
|
|
|
# @todo move this to `variables` when the above is resolved
|
|
|
|
|
- echo "DRUPAL_TEST_BASE_URL='http://localhost/subdirectory'" >> ./core/.env
|
|
|
|
|
- echo "DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false" >> ./core/.env
|
|
|
|
|
- echo "DRUPAL_TEST_DB_URL='${DRUPAL_TEST_DB_URL}'" >> ./core/.env
|
2024-07-24 08:40:15 +00:00
|
|
|
|
- echo "DRUPAL_TEST_WEBDRIVER_HOSTNAME='selenium'" >> ./core/.env
|
2024-01-26 09:36:24 +00:00
|
|
|
|
- echo "DRUPAL_TEST_WEBDRIVER_CHROME_ARGS='--disable-dev-shm-usage --disable-gpu --headless --dns-prefetch-disable'" >> ./core/.env
|
2024-07-24 08:40:15 +00:00
|
|
|
|
- echo "DRUPAL_TEST_WEBDRIVER_W3C=true" >> ./core/.env
|
|
|
|
|
- echo "DRUPAL_TEST_WEBDRIVER_PORT='4444'" >> ./core/.env
|
2023-11-15 15:07:44 +00:00
|
|
|
|
- echo "DRUPAL_NIGHTWATCH_OUTPUT='"../nightwatch_output"'" >> ./core/.env
|
2024-01-23 12:28:49 +00:00
|
|
|
|
- echo "COLUMNS=1000" >> ./core/.env
|
2023-11-15 15:07:44 +00:00
|
|
|
|
- chown -R www-data:www-data ./sites /var/www
|
2024-03-15 18:08:24 +00:00
|
|
|
|
- cd core
|
|
|
|
|
- corepack enable
|
|
|
|
|
- sudo -u www-data yarn run test:nightwatch --workers=4
|
2023-11-25 20:47:06 +00:00
|
|
|
|
after_script:
|
|
|
|
|
- cp /builds/chromedriver.log ./
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
artifacts:
|
|
|
|
|
when: always
|
|
|
|
|
expire_in: 6 mos
|
|
|
|
|
reports:
|
2023-11-15 15:07:44 +00:00
|
|
|
|
junit: ./nightwatch_output/**/*.xml
|
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
|
|
|
|
paths:
|
|
|
|
|
- ./nightwatch_output
|
2023-11-25 20:47:06 +00:00
|
|
|
|
- '*.log'
|
2023-10-31 14:15:55 +00:00
|
|
|
|
|
|
|
|
|
'🔁 Repeat Class Test':
|
2023-11-15 10:40:40 +00:00
|
|
|
|
<<: [ *with-composer, *run-repeat-class-test, *default-job-settings ]
|
2023-10-31 14:15:55 +00:00
|
|
|
|
when: manual
|
|
|
|
|
allow_failure: true
|
|
|
|
|
variables:
|
|
|
|
|
REPEAT_TEST_CLASS: 'Drupal\Tests\Change\Me'
|
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
2023-11-03 15:17:09 +00:00
|
|
|
|
|
|
|
|
|
'🚲 Performance tests':
|
2024-07-26 22:26:06 +00:00
|
|
|
|
<<: [ *default-job-settings ]
|
2023-11-03 15:17:09 +00:00
|
|
|
|
rules:
|
|
|
|
|
- if: $PERFORMANCE_TEST == "1"
|
2024-07-25 08:19:51 +00:00
|
|
|
|
- when: manual
|
2024-07-25 13:49:16 +00:00
|
|
|
|
allow_failure: true
|
2023-11-03 15:17:09 +00:00
|
|
|
|
variables:
|
|
|
|
|
KUBERNETES_CPU_REQUEST: "24"
|
2024-07-25 08:19:51 +00:00
|
|
|
|
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-dev-shm-usage","--disable-gpu","--headless","--no-sandbox"]}}, "http://chrome:9515"]'
|
2024-02-02 14:22:05 +00:00
|
|
|
|
tags:
|
|
|
|
|
- performance-test-runner
|
2023-11-03 15:17:09 +00:00
|
|
|
|
services:
|
|
|
|
|
- <<: *with-database
|
2024-07-25 08:19:51 +00:00
|
|
|
|
- <<: *with-chrome
|
2023-11-03 15:17:09 +00:00
|
|
|
|
script:
|
|
|
|
|
# Determine DB driver.
|
|
|
|
|
- |
|
|
|
|
|
[[ $_TARGET_DB == sqlite* ]] && export SIMPLETEST_DB=sqlite://localhost/subdirectory/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
|
2024-07-26 22:26:06 +00:00
|
|
|
|
- composer install --optimize-autoloader
|
2023-11-03 15:17:09 +00:00
|
|
|
|
- export OTEL_COLLECTOR="$OTEL_COLLECTOR"
|
|
|
|
|
- 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
|
2024-05-08 09:19:32 +00:00
|
|
|
|
- sudo SIMPLETEST_BASE_URL="http://$HOSTNAME/subdirectory" SIMPLETEST_DB="$SIMPLETEST_DB" MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" OTEL_COLLECTOR="$OTEL_COLLECTOR" -u www-data ./vendor/bin/phpunit -c core --group OpenTelemetry --log-junit=./sites/default/files/simpletest/phpunit-performance.xml
|