Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/scheduler
  • issue/scheduler-1345666
  • issue/scheduler-3167193
  • issue/scheduler-3175184
  • issue/scheduler-2416135
  • issue/scheduler-2096585
  • issue/scheduler-3206654
  • issue/scheduler-2941946
  • issue/scheduler-3180264
  • issue/scheduler-3221220
  • issue/scheduler-3221289
  • issue/scheduler-3196989
  • issue/scheduler-3225635
  • issue/scheduler-3225695
  • issue/scheduler-3227338
  • issue/scheduler-3224340
  • issue/scheduler-3232857
  • issue/scheduler-3238728
  • issue/scheduler-2977887
  • issue/scheduler-3282068
  • issue/scheduler-3282982
  • issue/scheduler-3282071
  • issue/scheduler-3282341
  • issue/scheduler-3244884
  • issue/scheduler-3248470
  • issue/scheduler-3238953
  • issue/scheduler-3155034
  • issue/scheduler-3251399
  • issue/scheduler-3252531
  • issue/scheduler-3249050
  • issue/scheduler-3260070
  • issue/scheduler-3260215
  • issue/scheduler-3260067
  • issue/scheduler-3259200
  • issue/scheduler-3265440
  • issue/scheduler-2916730
  • issue/scheduler-3268149
  • issue/scheduler-3268167
  • issue/scheduler-3266795
  • issue/scheduler-3037483
  • issue/scheduler-3268584
  • issue/scheduler-3267429
  • issue/scheduler-3270082
  • issue/scheduler-3272548
  • issue/scheduler-3273938
  • issue/scheduler-3284289
  • issue/scheduler-3276637
  • issue/scheduler-3285242
  • issue/scheduler-3291771
  • issue/scheduler-3176822
  • issue/scheduler-3317185
  • issue/scheduler-3293936
  • issue/scheduler-3311425
  • issue/scheduler-3297995
  • issue/scheduler-3289475
  • issue/scheduler-3271462
  • issue/scheduler-3312069
  • issue/scheduler-3312200
  • issue/scheduler-3049585
  • issue/scheduler-3318332
  • issue/scheduler-3313443
  • issue/scheduler-3313848
  • issue/scheduler-3314158
  • issue/scheduler-3314267
  • issue/scheduler-3314451
  • issue/scheduler-3317944
  • issue/scheduler-3210321
  • issue/scheduler-3316719
  • issue/scheduler-3318972
  • issue/scheduler-3326114
  • issue/scheduler-3320341
  • issue/scheduler-3331246
  • issue/scheduler-3336108
  • issue/scheduler-3080979
  • issue/scheduler-3336969
  • issue/scheduler-3356800
  • issue/scheduler-3357619
  • issue/scheduler-3357836
  • issue/scheduler-3358806
  • issue/scheduler-3358927
  • issue/scheduler-3359081
  • issue/scheduler-3359093
  • issue/scheduler-3359532
  • issue/scheduler-3359790
  • issue/scheduler-3400631
  • issue/scheduler-3401828
  • issue/scheduler-3285427
  • issue/scheduler-3371935
  • issue/scheduler-3373725
  • issue/scheduler-3373860
  • issue/scheduler-3376411
  • issue/scheduler-3369158
  • issue/scheduler-3360744
  • issue/scheduler-3387331
  • issue/scheduler-3388029
  • issue/scheduler-3388199
  • issue/scheduler-3389642
  • issue/scheduler-3390389
  • issue/scheduler-3386861
  • issue/scheduler-3393356
  • issue/scheduler-3397181
  • issue/scheduler-3412854
  • issue/scheduler-3417444
  • issue/scheduler-2907382
  • issue/scheduler-3418728
  • issue/scheduler-3420859
  • issue/scheduler-3421936
  • issue/scheduler-3421984
  • issue/scheduler-3417340
  • issue/scheduler-3221881
  • issue/scheduler-3427971
  • issue/scheduler-3446881
  • issue/scheduler-3442356
  • issue/scheduler-3437739
  • issue/scheduler-3439850
  • issue/scheduler-3445052
  • issue/scheduler-3443183
  • issue/scheduler-3359998
  • issue/scheduler-3434325
  • issue/scheduler-3432376
  • issue/scheduler-3432976
  • issue/scheduler-3442310
  • issue/scheduler-3440026
  • issue/scheduler-3451111
  • issue/scheduler-3451287
  • issue/scheduler-3451737
  • issue/scheduler-3451750
  • issue/scheduler-3103334
  • issue/scheduler-3453345
  • issue/scheduler-3453360
  • issue/scheduler-3453359
  • issue/scheduler-3454508
  • issue/scheduler-3456628
  • issue/scheduler-3458430
  • issue/scheduler-3463141
  • issue/scheduler-3463136
  • issue/scheduler-3463494
  • issue/scheduler-3465015
  • issue/scheduler-3465213
  • issue/scheduler-3458578
  • issue/scheduler-3423469
  • issue/scheduler-3423200
  • issue/scheduler-3467349
  • issue/scheduler-3468320
  • issue/scheduler-3469273
  • issue/scheduler-3282128
  • issue/scheduler-3473851
  • issue/scheduler-3249560
  • issue/scheduler-3476450
  • issue/scheduler-3454624
  • issue/scheduler-3477201
  • issue/scheduler-3477348
  • issue/scheduler-3476369
  • issue/scheduler-3480311
  • issue/scheduler-3480501
  • issue/scheduler-3327577
  • issue/scheduler-3481016
  • issue/scheduler-3493930
  • issue/scheduler-3495229
  • issue/scheduler-2712465
  • issue/scheduler-3496138
  • issue/scheduler-3500296
  • issue/scheduler-3498553
  • issue/scheduler-3500821
  • issue/scheduler-3502530
  • issue/scheduler-3507012
  • issue/scheduler-3363972
  • issue/scheduler-3510926
168 results
Show changes
Commits on Source (3)
......@@ -17,15 +17,16 @@ include:
variables:
OPT_IN_TEST_CURRENT: 1
OPT_IN_TEST_MAX_PHP: 0
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 0
OPT_IN_TEST_PREVIOUS_MINOR: 0
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_DRUPAL8: 1
_SHOW_ENVIRONMENT_VARIABLES: 1
_TARGET_PHP: "8.2"
_PHPUNIT_CONCURRENT: 1
_PHPUNIT_TESTGROUPS: ''
_TARGET_PHP: "8.2"
################
# Job overrides
......@@ -51,6 +52,20 @@ variables:
# -------------------------------- BUILD ---------------------------------------
.opt-in-drupal8-rule: &opt-in-drupal8-rule
if: '$OPT_IN_TEST_DRUPAL8 != "1"'
when: never
# Re-usable rule for running the job automatically on Merge Requests and allowing it
# to manually triggered for all other types of pipeline.
# Using 'when: manual' needs 'allow failure: true' otherwise the overall pipeline status
# is shown as 'blocked' and the stages show 'running' without ever appearing to finish.
.manual-if-not-mr-rule: &manual-if-not-mr-rule
- if: $CI_PIPELINE_SOURCE != "merge_request_event"
when: manual
allow_failure: true
- when: on_success
.composer-base:
after_script:
# Show the last two commits. Current directory /builds/project/scheduler ($CI_PROJECT_DIR) is correct.
......@@ -73,17 +88,31 @@ composer (previous minor):
composer (previous major):
rules:
- !reference [ .opt-in-previous-major-rule ]
- *manual-if-not-mr-rule
composer (next minor):
rules:
- !reference [ .opt-in-next-minor-rule ]
- when: manual
allow_failure: true
composer (next major):
allow_failure: true
rules:
- !reference [ .opt-in-next-major-rule ]
- when: manual
allow_failure: true
variables:
_LENIENT_ALLOW_LIST: devel,devel_generate,rules,commerce,entity,address,state_machine,entity_reference_revisions,profile,inline_entity_form,token,workbench_moderation,workbench_moderation_actions
composer (drupal 8):
extends: .composer-base
rules:
- *opt-in-drupal8-rule
- *manual-if-not-mr-rule
variables:
PHP_VERSION: $CORE_PREVIOUS_PHP_MIN
DRUPAL_CORE: 8.9.20
# -------------------------------- VALIDATE ------------------------------------
eslint:
......@@ -104,13 +133,6 @@ phpstan:
- test -f phpstan.neon && echo "=== This is phpstan.neon ===" && cat phpstan.neon
- php $CI_PROJECT_DIR/scripts/phpstan-baseline-summary.php phpstan-baseline-to-fix.neon
# Do not automatically run 'next minor', but allow it to be started manually.
phpstan (next minor):
rules:
- !reference [ .opt-in-next-minor-rule ]
- !reference [ .skip-phpstan-rule ]
- when: manual
# -------------------------------- TEST ----------------------------------------
phpunit:
......@@ -146,15 +168,7 @@ phpunit:
fi
- echo "End of before_script _PHPUNIT_CONCURRENT=$_PHPUNIT_CONCURRENT _PHPUNIT_EXTRA=$_PHPUNIT_EXTRA"
# Do not automatically run 'next minor' PHPUnit but allow it to be started
# manually. To do this the .phpunit-tests-exist-rule has to be removed.
# The other variants all have 'manual' on the Composer job instead.
phpunit (next minor):
allow_failure: true
rules:
- !reference [ .opt-in-next-minor-rule ]
- !reference [ .skip-phpunit-rule ]
- when: manual
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
......@@ -165,3 +179,14 @@ phpunit (next major):
# 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):
extends: phpunit
rules:
- *opt-in-drupal8-rule
- !reference [ .skip-phpunit-rule ]
- !reference [ .phpunit-tests-exist-rule ]
- when: on_success
needs:
- "composer (drupal 8)"
allow_failure: true
# See docs at https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing-for-projects
build:
assessment:
validate_codebase:
container_composer: {}
container_command:
commands:
# Show the eslint version
- echo "eslint version $(${SOURCE_DIR}/core/node_modules/.bin/eslint --version)"
# Show the codesniffer and coder versions.
- composer show | grep -E "(php_codesniffer|phpcs|coder)"
host_command:
commands:
# Apply patch from https://www.drupal.org/project/drupalci_testbot/issues/3251817
# @todo Remove this when Drupal 9.4.9 and 9.5.0 and 10.0.0 have been released.
- cd ${SOURCE_DIR} && sudo -u www-data curl https://www.drupal.org/files/issues/2021-11-30/3251817-4.run-tests-with-multiple-groups.patch | sudo -u www-data patch -p1 --verbose
phplint: {}
csslint: {}
eslint:
halt-on-fail: true
phpcs:
# phpcs halt-on-fail:true gives a gray 'build successful' message but does not stop the job.
halt-on-fail: true
phpstan:
halt-on-fail: false
testing:
container_command:
commands:
# Rules 3.0-alpha7 is not compatible with PHP8.1 but the dev version has been fixed.
# Added mglaman/phpstan-drupal:* to allow downgrade. See https://www.drupal.org/i/3326114
- cd ${SOURCE_DIR} && sudo -u www-data composer require drupal/rules:3.x-dev mglaman/phpstan-drupal:*
# Get workbench moderation modules only when testing with Drupal 9, as these are not compatible with Drupal 10.
# Use * for workbench_moderation_actions because only the dev version is compatible with D9.
- drush core:status | awk "NR==1{print \$2\$3\$4}"
- drush core:status | awk "NR==1{print \$2\$3\$4}" | grep version:9 && sudo -u www-data composer require drupal/workbench_moderation drupal/workbench_moderation_actions:*
# When running with PHP8.2 get the latest Devel 5.x-dev version. This can be removed when Devel 5.1.2 is released.
- php -v | awk "NR==1{print \$2}" | grep '8.2' && cd ${SOURCE_DIR} && sudo -u www-data composer require drupal/devel:5.x-dev
run_tests.functional:
types: 'PHPUnit-Functional'
# testgroups: '--all'
testgroups: 'scheduler,scheduler_api,scheduler_rules_integration'
# The groups are 'scheduler,scheduler_api,scheduler_drush,scheduler_rules_integration'
suppress-deprecations: true
run_tests.js:
types: 'PHPUnit-FunctionalJavascript'
testgroups: 'scheduler_js'
suppress-deprecations: true
concurrency: 1
halt-on-fail: false
......@@ -28,11 +28,12 @@ class SchedulerJavascriptDefaultTimeTest extends SchedulerJavascriptTestBase {
// to local testing having a different locale to drupal.org testing.
// @see https://www.drupal.org/project/scheduler/issues/2913829 from #18.
$this->drupalLogin($this->schedulerUser);
$this->nodetype->setThirdPartySetting('scheduler', 'fields_display_mode', 'fieldset')
->setThirdPartySetting('scheduler', 'expand_fieldset', 'always')->save();
$this->drupalGet('node/add/' . $this->type);
$page = $this->getSession()->getPage();
$title = 'Date format test ' . $this->randomString(12);
$title = "Add a node to determine the date-picker format";
$page->fillField('edit-title-0-value', $title);
$page->clickLink('Scheduling options');
// Set the date using a day and month which could be correctly interpreted
// either way. Set the year to be next year to ensure a future date.
// Use a time format which includes 'pm' as this may be necessary, and will
......@@ -74,11 +75,8 @@ class SchedulerJavascriptDefaultTimeTest extends SchedulerJavascriptTestBase {
// Create a node.
$this->drupalGet('node/add/' . $this->type);
$page = $this->getSession()->getPage();
$title = ucfirst($field) . ($required ? ' required ' : ' not required ') . $this->randomString(12);
$title = ucfirst($field) . ($required ? ' required' : ' not required') . ', datepickerFormat = ' . $this->datepickerFormat;
$page->fillField('edit-title-0-value', $title);
$page->fillField('edit-body-0-value', 'datepickerFormat = ' . $this->datepickerFormat);
$page->clickLink('Scheduling options');
if ($required) {
// Fill in the date value but do nothing with the time field.
$page->fillField('edit-' . $field . '-on-0-value-date', $scheduling_time->format($this->datepickerFormat));
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\scheduler\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Tests\DocumentElement;
use Drupal\Tests\scheduler\Traits\SchedulerSetupTrait;
/**
......@@ -29,9 +30,13 @@ abstract class SchedulerJavascriptTestBase extends WebDriverTestBase {
protected $profile = 'testing';
/**
* {@inheritdoc}
* The default theme.
*
* The vertical tabs test needs 'claro' theme not 'stark'.
*
* @var string
*/
protected $defaultTheme = 'stark';
protected $defaultTheme = 'claro';
/**
* {@inheritdoc}
......@@ -50,4 +55,30 @@ abstract class SchedulerJavascriptTestBase extends WebDriverTestBase {
$module_handler->invokeAll('cache_flush');
}
/**
* Looks for the specified text and returns TRUE when it is unavailable.
*
* Core JSWebAssert has a function waitForText() but there is no equivalent to
* wait until text is hidden, as there is for some other page elements.
* Therefore define that function here, based on waitForText() in
* core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php.
*
* @param string $text
* The text to wait for.
* @param int $timeout
* (Optional) Timeout in milliseconds, defaults to 10000.
*
* @return bool
* TRUE if not found, FALSE if found.
*/
public function waitForNoText($text, $timeout = 10000) {
$page = $this->getSession()->getPage();
return (bool) $page->waitFor($timeout / 1000, function (DocumentElement $page) use ($text) {
$actual = preg_replace('/\\s+/u', ' ', $page->getText());
// Negative look-ahead on the text that should be hidden.
$regex = '/^((?!' . preg_quote($text, '/') . ').)*$/ui';
return (bool) preg_match($regex, $actual);
});
}
}
<?php
namespace Drupal\Tests\scheduler\FunctionalJavascript;
/**
* Tests the JavaScript functionality of vertical tabs summary information.
*
* @group scheduler_js
*/
class SchedulerJavascriptVerticalTabsTest extends SchedulerJavascriptTestBase {
/**
* Test editing a node.
*/
public function testEditEntitySummary() {
$this->drupalLogin($this->schedulerUser);
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
// Set the node edit form to use a vertical tab for the Scheduler dates.
$this->nodetype->setThirdPartySetting('scheduler', 'fields_display_mode', 'vertical_tab')
->setThirdPartySetting('scheduler', 'expand_fieldset', 'always')->save();
// Create a node with a scheduled publishing date.
$node = $this->drupalCreateNode(['type' => $this->type, 'status' => FALSE, 'publish_on' => strtotime('+2 months')]);
$this->drupalGet($node->toUrl('edit-form'));
$assert->pageTextContains('Scheduled for publishing');
$assert->pageTextNotContains('Scheduled for unpublishing');
$assert->pageTextNotContains('Not scheduled');
// Create a node with a scheduled unpublishing date.
$node = $this->drupalCreateNode(['type' => $this->type, 'unpublish_on' => strtotime('+3 months')]);
$this->drupalGet($node->toUrl('edit-form'));
$assert->pageTextNotContains('Scheduled for publishing');
$assert->pageTextContains('Scheduled for unpublishing');
$assert->pageTextNotContains('Not scheduled');
// Fill in a publish_on date and check the summary text.
$page = $this->getSession()->getPage();
$page->fillField('edit-publish-on-0-value-date', '05/02/' . (date('Y') + 1));
$page->fillField('edit-publish-on-0-value-time', '06:00:00pm');
$assert->waitForText('Scheduled for publishing');
$assert->pageTextContains('Scheduled for publishing');
// Remove both date values and check that the summary text is correct.
// Setting the date and time values to '' only actually removes the first
// component of each of the fields. But this is enough for drupal.behaviors
// to update the summary correctly.
$page->fillField('edit-publish-on-0-value-date', '');
$page->fillField('edit-publish-on-0-value-time', '');
$page->fillField('edit-unpublish-on-0-value-date', '');
$page->fillField('edit-unpublish-on-0-value-time', '');
$assert->waitForText('Not scheduled');
$assert->pageTextNotContains('Scheduled for publishing');
$assert->pageTextNotContains('Scheduled for unpublishing');
$assert->pageTextContains('Not scheduled');
}
/**
* Test configuring an entity type.
*/
public function testConfigureEntityTypeSummary() {
/** @var \Drupal\Tests\WebAssert $assert */
$assert = $this->assertSession();
$this->drupalLogin($this->adminUser);
$this->drupalGet($this->nodetype->toUrl('edit-form'));
$page = $this->getSession()->getPage();
// Bring focus to the Scheduler vertical tab.
$page->clickLink('Scheduler');
// Both options are enabled by default.
$assert->pageTextContains('Publishing enabled');
$assert->pageTextContains('Advanced options');
$assert->pageTextContains('Unpublishing enabled');
// Turn off the unpublishing enabled checkbox.
$page->uncheckField('edit-scheduler-unpublish-enable');
$this->waitForNoText('Unpublishing enabled');
$assert->pageTextContains('Publishing enabled');
$assert->pageTextContains('Advanced options');
$assert->pageTextNotContains('Unpublishing enabled');
// Turn off the publishing enabled checkbox.
$page->uncheckField('edit-scheduler-publish-enable');
$this->waitForNoText('Publishing enabled');
$assert->pageTextNotContains('Publishing enabled');
$assert->pageTextNotContains('Advanced options');
// Turn on the publishing enabled checkbox.
$page->checkField('edit-scheduler-publish-enable');
$assert->waitForText('Publishing enabled');
$assert->pageTextContains('Publishing enabled');
$assert->pageTextNotContains('Unpublishing enabled');
$assert->pageTextContains('Advanced options');
// Turn on the unpublishing enabled checkbox.
$page->checkField('edit-scheduler-unpublish-enable');
$assert->waitForText('Unpublishing enabled');
$assert->pageTextContains('Unpublishing enabled');
}
}