Skip to content
Snippets Groups Projects
Commit 13b35a8f authored by Jonathan Smith's avatar Jonathan Smith
Browse files

Issue #3495229 by jonathan1055: Part 1 - Set workbench moderation tests to...

Issue #3495229 by jonathan1055: Part 1 - Set workbench moderation tests to manual (and align template with 2.x)
parent 0989383c
Branches
No related tags found
1 merge request!220#3495229 Align template with 2.x
Pipeline #375432 passed
......@@ -5,7 +5,7 @@
################
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: 'main'
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
......@@ -16,11 +16,12 @@ include:
################
variables:
OPT_IN_TEST_CURRENT: 1
OPT_IN_TEST_MAX_PHP: 0
OPT_IN_TEST_MAX_PHP: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_DRUPAL9: 1
OPT_IN_TEST_DRUPAL8: 1
RUN_JOB_UPGRADE_STATUS: 1
_SHOW_ENVIRONMENT_VARIABLES: 1
......@@ -44,13 +45,18 @@ variables:
printf "CI_PAGES_URL = %s\n" $CI_PAGES_URL &&
printf "CI_PROJECT_NAME = %s\n" $CI_PROJECT_NAME &&
printf "CI_JOB_NAME = %s\n" "$CI_JOB_NAME" &&
printf "CI_JOB_NAME chopped = %s\n" "${CI_JOB_NAME%:*}" &&
printf "CI_JOB_NAME trimmed from : = %s\n" "${CI_JOB_NAME%:*}" &&
printf "DRUPAL_CORE = %s\n" $DRUPAL_CORE &&
printf "PHP_VERSION = %s\n" $PHP_VERSION &&
printf "MODULE_NAME = %s\n" $MODULE_NAME
printf "PHP_IMAGE_VARIANT = %s\n" $PHP_IMAGE_VARIANT &&
printf "PHP_IMAGE_TAG = %s\n" $PHP_IMAGE_TAG
# -------------------------------- BUILD ---------------------------------------
.opt-in-drupal9-rule: &opt-in-drupal9-rule
if: '$OPT_IN_TEST_DRUPAL9 != "1"'
when: never
.opt-in-drupal8-rule: &opt-in-drupal8-rule
if: '$OPT_IN_TEST_DRUPAL8 != "1"'
when: never
......@@ -72,16 +78,21 @@ variables:
- if [[ $DRUPAL_CORE =~ ^11 ]]; then rm composer.json; mv composer_for_d11_testing.json composer.json; echo "Using composer_for_d11_testing.json"; fi;
after_script:
- !reference [ .create-environment-variables ]
- pwd && echo "Top-level directories" && ls -tldr */
- printf "Top 10 folders by size:\n" && du -m web/* | sort -n -r | head -n 10 || true
# Show the last two commits. Current directory /builds/project/scheduler ($CI_PROJECT_DIR) is correct.
- git show -2 --stat --oneline
- |
[[ $CI_PIPELINE_SOURCE == "merge_request_event" ]] && BASELINE=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} && git diff --stat $BASELINE && git diff $BASELINE -- .gitlab-ci.yml | head -n 30 || true
- *show-variables
# - cat composer.json
- COLUMNS=120 composer show | grep -E '\/(core |rules|commerce|entity|inline_entity_form|workbench|drush|devel_generate|address)'
- COLUMNS=130 composer show | grep -E '\/(core |rules|commerce|entity|inline_entity_form|workbench|drush|devel_generate|address)'
composer (max PHP version):
# Using when: manual needs 'allow failure: true' otherwise the overall pipeline status shows 'blocked'
rules:
- !reference [ .opt-in-max-php-rule ]
- !reference [ .check-max-php-version-rule ]
- when: manual
allow_failure: true
......@@ -94,7 +105,8 @@ composer (previous minor):
composer (previous major):
rules:
- !reference [ .opt-in-previous-major-rule ]
- *manual-if-not-mr-rule
- when: manual
allow_failure: true
composer (next minor):
rules:
......@@ -107,6 +119,17 @@ composer (next major):
- !reference [ .opt-in-next-major-rule ]
- *manual-if-not-mr-rule
composer (drupal 9):
extends: .composer-base
rules:
- *opt-in-drupal9-rule
- when: manual
allow_failure: true
variables:
PHP_VERSION: 8.1
DRUPAL_CORE: ^9.5
PHP_IMAGE_VARIANT: 'apache'
composer (drupal 8):
extends: .composer-base
rules:
......@@ -122,8 +145,10 @@ composer (drupal 8):
eslint:
allow_failure: false
after_script:
- echo "Change to directory above the project"
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom
- ls -lG .{eslint,prettier}* || true
- echo "Change to the project directory"
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
- ls -lG .{eslint,prettier}* || true
- test -f .eslintignore && echo "=== This is .eslintignore ===" && cat .eslintignore || true
......@@ -142,17 +167,30 @@ phpstan:
# -------------------------------- TEST ----------------------------------------
.scheduler-testgroup-rule: &scheduler-testgroup-rule
# Run some test groups manually not automatically.
# @todo put back "scheduler_drush" when https://www.drupal.org/project/scheduler/issues/3359998 is solved.
# @todo put back "scheduler_workbench" when https://www.drupal.org/project/scheduler/issues/3495229 is solved.
- if: $_MATRIX_VALUE == "scheduler_drush" || $_MATRIX_VALUE == "scheduler_workbench"
when: manual
allow_failure: true
- when: on_success
phpunit:
parallel:
matrix:
# Run test groups in parallel. This also speeds up identification of failing tests.
# @todo put back "scheduler_drush" when https://www.drupal.org/i/3359998 is solved.
- _MATRIX_VALUE:
- scheduler
- scheduler_api
# - scheduler_drush
- scheduler_drush
- scheduler_js
- scheduler_rules_integration
- scheduler_workbench
rules:
- !reference [ .opt-in-current-rule ]
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
before_script:
# If any variation also needs a before_script then add - !reference [phpunit, before_script] to include this script.
- *show-variables
......@@ -161,7 +199,8 @@ phpunit:
printf "_PHPUNIT_CONCURRENT = %s\n" $_PHPUNIT_CONCURRENT &&
printf "_PHPUNIT_TESTGROUPS = %s\n" "$_PHPUNIT_TESTGROUPS" &&
printf "_PHPUNIT_EXTRA = %s\n" "$_PHPUNIT_EXTRA" &&
printf "SYMFONY_DEPRECATIONS_HELPER = %s\n" $SYMFONY_DEPRECATIONS_HELPER
printf "SYMFONY_DEPRECATIONS_HELPER = %s\n" "$SYMFONY_DEPRECATIONS_HELPER" &&
printf "MINK_DRIVER_ARGS_WEBDRIVER = %s\n" "$MINK_DRIVER_ARGS_WEBDRIVER"
- |
if [[ "$_MATRIX_VALUE" != "" ]]; then
if [[ "$_PHPUNIT_CONCURRENT" == "0" ]]; then
......@@ -176,31 +215,71 @@ phpunit:
fi
# Patch to disable strict config schema validation on older versions of core.
# See https://www.drupal.org/project/scheduler/issues/3451750
- if [[ $DRUPAL_CORE =~ ^(8.9|9.5|10.2) ]]; then patch -p1 --verbose < tests/3451750-strict-config-schema.patch; fi
- vendor/bin/drush status | awk "NR==1{print \$4}" | grep -E '^(8.|9.|10.2)' && echo 'Core version is before 10.3, patching to remove strict config validation' && patch -p1 < tests/3451750-strict-config-schema.patch
- echo "End of before_script _PHPUNIT_CONCURRENT=$_PHPUNIT_CONCURRENT _PHPUNIT_EXTRA=$_PHPUNIT_EXTRA"
phpunit (max PHP version):
rules:
- !reference [ .opt-in-max-php-rule ]
- !reference [ .skip-phpunit-rule ]
- !reference [ .check-max-php-version-rule ]
- *scheduler-testgroup-rule
phpunit (previous minor):
rules:
- !reference [ .opt-in-previous-minor-rule ]
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
phpunit (previous major):
rules:
- !reference [ .opt-in-previous-major-rule ]
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
phpunit (next minor):
rules:
- !reference [ .opt-in-next-minor-rule ]
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
variables:
# Use core ignoreFile to show deprecations. This is only used when $_PHPUNIT_CONCURRENT=1 so make sure that is also set.
_PHPUNIT_CONCURRENT: 1
SYMFONY_DEPRECATIONS_HELPER: "ignoreFile=$CI_PROJECT_DIR/$_WEB_ROOT/core/.deprecation-ignore.txt"
phpunit (next major):
rules:
- !reference [ .opt-in-next-major-rule ]
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
variables:
# Use core ignoreFile to show deprecations. This is only used when $_PHPUNIT_CONCURRENT=1 so make sure that is also set.
_PHPUNIT_CONCURRENT: 1
SYMFONY_DEPRECATIONS_HELPER: "ignoreFile=$CI_PROJECT_DIR/$_WEB_ROOT/core/.deprecation-ignore.txt"
phpunit (drupal 8):
phpunit (drupal 9):
extends: phpunit
services:
- !reference [ .with-database ]
- !reference [ .with-chrome-legacy ]
rules:
- *opt-in-drupal9-rule
- !reference [ .skip-phpunit-rule ]
- *scheduler-testgroup-rule
needs:
- "composer (drupal 9)"
allow_failure: true
variables:
MINK_DRIVER_ARGS_WEBDRIVER: $MINK_DRIVER_ARGS_WEBDRIVER_LEGACY
phpunit (drupal 8):
extends: phpunit (drupal 9)
rules:
- *opt-in-drupal8-rule
- !reference [ .skip-phpunit-rule ]
- !reference [ .phpunit-tests-exist-rule ]
- when: on_success
- *scheduler-testgroup-rule
needs:
- "composer (drupal 8)"
allow_failure: true
test-only changes:
# Remove the parallel definition that is defined in the customized phpunit.
......
......@@ -5,7 +5,7 @@ namespace Drupal\Tests\scheduler\Functional;
/**
* Tests Scheduler with Workbench Moderation installed.
*
* @group scheduler
* @group scheduler_workbench
*/
class SchedulerWorkbenchModerationTest extends SchedulerBrowserTestBase {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment