Skip to content
Snippets Groups Projects
Commit 992df54b authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3369381 by Project Update Bot: Automated Drupal 10 compatibility fixes...

Issue #3369381 by Project Update Bot: Automated Drupal 10 compatibility fixes for Unite and functional tests
parent c3a7b1b6
No related branches found
No related tags found
No related merge requests found
Pipeline #25821 failed
include:
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
variables:
COMPOSER: composer.json
COMPOSER_ROOT_VERSION: "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}-dev"
CONCURRENCY: 32
GIT_DEPTH: "3"
_SHOW_ENVIRONMENT_VARIABLES: 1
#############
......@@ -65,14 +65,6 @@ stages:
policy: pull
<<: *yarn-cache
.junit-artifacts: &junit-artifacts
artifacts:
expose_as: junit
expire_in: 6 mos
paths:
- junit.xml
reports:
junit: junit.xml
.default-stage: &default-stage
stage: 🗜️ Test
trigger:
......@@ -122,7 +114,7 @@ stages:
<<: *composer-cache
artifacts:
expire_in: 1 week
expose_as: 'web-vendor'
expose_as: 'vendor'
paths:
- vendor/
script:
......@@ -136,24 +128,22 @@ stages:
<<: *yarn-cache
artifacts:
expire_in: 1 week
expose_as: 'yarn-vendor'
expose_as: 'node_modules'
paths:
- node_modules/
script:
- yarn add stylelint-junit-formatter
################
# Lint Jobs
################
'🧹 PHP Coding standards (PHPCS)':
<<: [ *with-composer-cache, *junit-artifacts, *default-job-settings-lint ]
<<: [ *with-composer-cache, *default-job-settings-lint ]
stage: 🪄 Lint
script:
- composer phpcs -- --report-junit=junit.xml --report-full --report-summary
'🧹 PHP Static Analysis (phpstan)':
<<: [ *with-composer-cache, *junit-artifacts, *default-job-settings-lint ]
<<: [ *with-composer-cache, *default-job-settings-lint ]
stage: 🪄 Lint
script:
- php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --configuration=phpstan.neon.dist --error-format=junit > junit.xml
......@@ -39,15 +39,6 @@ stages:
policy: pull
<<: *yarn-cache
.junit-artifacts: &junit-artifacts
artifacts:
expose_as: junit
expire_in: 6 mos
paths:
- junit.xml
reports:
junit: junit.xml
.with-composer-and-yarn: &with-composer-and-yarn
needs:
- '📦️ Composer'
......@@ -123,7 +114,7 @@ stages:
<<: *composer-cache
artifacts:
expire_in: 1 week
expose_as: 'web-vendor'
expose_as: 'vendor'
paths:
- vendor/
script:
......@@ -137,11 +128,10 @@ stages:
<<: *yarn-cache
artifacts:
expire_in: 1 week
expose_as: 'yarn-vendor'
expose_as: 'node_modules'
paths:
- node_modules/
script:
- yarn add stylelint-junit-formatter
################
# Test Jobs
......@@ -168,54 +158,6 @@ stages:
services:
- <<: *with-database
'🩹 Test-only changes':
<<: [ *with-composer-cache, *phpunit-artifacts, *setup-webserver, *default-job-settings ]
stage: 🗜️ Test
when: manual
interruptible: true
allow_failure: true
variables:
<<: *test-variables
services:
- <<: *with-database
- <<: *with-chrome
script:
# Determine DB driver.
- |
[[ $_TARGET_DB_TYPE == "sqlite" ]] && export SIMPLETEST_DB=sqlite://localhost/subdirectory/sites/default/files/db.sqlite?module=sqlite
[[ $_TARGET_DB_TYPE == "mysql" ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB_TYPE == "mariadb" ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB_TYPE == "pgsql" ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
- export
- 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
- export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}
- git fetch -vn --depth=3 "$CI_MERGE_REQUEST_PROJECT_URL" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
- |
echo "ℹ️ Changes from ${TARGET_BRANCH}"
git diff refs/heads/${TARGET_BRANCH} --name-only
echo "If this list contains more files than what you changed, then you need to rebase your branch."
echo "1️⃣ Reverting non test changes"
if [[ $(git diff refs/heads/${TARGET_BRANCH} --diff-filter=DM --name-only|grep -Ev "Test.php$"|grep -v .gitlab-ci|grep -v scripts/run-tests.sh) ]]; then
git diff refs/heads/${TARGET_BRANCH} --diff-filter=DM --name-only|grep -Ev "Test.php$"|grep -v .gitlab-ci|grep -v scripts/run-tests.sh|while read file;do
echo "↩️ Reverting $file";
git checkout refs/heads/${TARGET_BRANCH} -- $file;
done
fi
if [[ $(git diff refs/heads/${TARGET_BRANCH} --diff-filter=A --name-only|grep -Ev "Test.php$"|grep -v .gitlab-ci|grep -v scripts/run-tests.sh) ]]; then
git diff refs/heads/${TARGET_BRANCH} --diff-filter=A --name-only|grep -Ev "Test.php$"|grep -v .gitlab-ci|grep -v scripts/run-tests.sh|while read file;do
echo "🗑️️ Deleting $file";
git rm $file;
done
fi
echo "2️⃣ Running test changes for this branch"
if [[ $(git diff refs/heads/${TARGET_BRANCH} --name-only|grep -E "Test.php$") ]]; then
for test in `git diff refs/heads/${TARGET_BRANCH} --name-only|grep -E "Test.php$"`; do
sudo SIMPLETEST_BASE_URL="$SIMPLETEST_BASE_URL" SIMPLETEST_DB="$SIMPLETEST_DB" MINK_DRIVER_ARGS_WEBDRIVER="$MINK_DRIVER_ARGS_WEBDRIVER" -u www-data ./vendor/bin/phpunit -c core $test --log-junit=./sites/default/files/simpletest/phpunit-`echo $test|sed 's/\//_/g' `.xml;
done;
fi
'⚙️️ PHPUnit Kernel':
<<: [*with-composer-cache, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
stage: 🗜️ Test
......
......@@ -34,6 +34,7 @@
"stylelint-checkstyle-formatter": "^0.1.2",
"stylelint-config-standard": "^33.0.0",
"stylelint-order": "^6.0.3",
"stylelint-junit-formatter": "^0.2.2",
"nightwatch": "^2.3.9"
},
"browserslist": [
......
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