diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fcc616daad01706f87aee339001f1ab4e97570b0..203e6ecb62c9e88133160d95a0ec041f12310f01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,6 +39,7 @@ variables: REDIS_INTERFACE: PhpRedis OPT_IN_TEST_PREVIOUS_MINOR: 1 OPT_IN_TEST_PREVIOUS_MAJOR: 1 + OPT_IN_TEST_NEXT_MINOR: 1 # Concurrency can not be enabled as environment variables are not passed # through _PHPUNIT_CONCURRENT: 0 @@ -50,17 +51,41 @@ variables: before_script: - composer require --dev predis/predis --no-update +# For now, use Predis by default as this avoids issues with packages. .phpunit-base: + variables: + REDIS_INTERFACE: Predis + before_script: + - *setup-extension + services: + - !reference [ .with-database ] + - !reference [ .with-chrome ] + - name: redis:7 + alias: redis + command: ["redis-server", "--maxmemory-policy", "allkeys-lru", "--maxmemory", "100M"] + +phpunit: parallel: matrix: - REDIS_INTERFACE: - PhpRedis - Predis - Relay - before_script: - - *setup-extension + +phpunit (previous minor): + extends: .phpunit-base + +phpunit (previous major): + extends: .phpunit-base + +phpunit (next minor): + extends: .phpunit-base + +phpunit (valkey): + extends: phpunit services: - !reference [ .with-database ] - !reference [ .with-chrome ] - - name: redis:6 - command: ["redis-server", "--maxmemory-policy", "allkeys-lru", "--maxmemory", "100M"] + - name: valkey/valkey:8 + alias: redis + command: [ "valkey-server", "--maxmemory-policy", "allkeys-lru", "--maxmemory", "100M" ] diff --git a/src/Cache/CacheBase.php b/src/Cache/CacheBase.php index 696f4cb6e88f0c3e3c2ef69c61dd63dc05225df2..240fa22f6f31f356b351a86b19a914538e5abbb9 100644 --- a/src/Cache/CacheBase.php +++ b/src/Cache/CacheBase.php @@ -445,6 +445,7 @@ abstract class CacheBase implements CacheBackendInterface { * {@inheritdoc} */ public function invalidateAll() { + @trigger_error("CacheBackendInterface::invalidateAll() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use CacheBackendInterface::deleteAll() or cache tag invalidation instead. See https://www.drupal.org/node/3500622", E_USER_DEPRECATED); if (Settings::get('redis_invalidate_all_as_delete', FALSE) === FALSE) { // To invalidate the whole bin, we invalidate a special tag for this bin. $this->checksumProvider->invalidateTags([$this->getTagForBin()]); diff --git a/tests/src/Functional/WebTest.php b/tests/src/Functional/WebTest.php index fd63ef4e122f0e4b32b35ea0e3967ed43aaf2f4e..3cbc53e34c56e7fd5ff4ce5095ac4f1ee3c37a3a 100644 --- a/tests/src/Functional/WebTest.php +++ b/tests/src/Functional/WebTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\redis\Functional; use Drupal\Component\Utility\OpCodeCache; use Drupal\Core\Database\Database; +use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\Site\Settings; use Drupal\cron_queue_test\Plugin\QueueWorker\CronQueueTestException; use Drupal\Tests\BrowserTestBase; @@ -162,9 +163,12 @@ class WebTest extends BrowserTestBase { $assert->elementTextContains('css', '.messages--status', 'Filter'); $assert->checkboxChecked('edit-modules-field-ui-enable'); + \Drupal::service(FieldTypePluginManagerInterface::class)->clearCachedDefinitions(); + // Create a node type with a field. $edit = [ 'name' => $this->randomString(), + 'options[promote]' => '1', 'type' => $node_type = mb_strtolower($this->randomMachineName()), ]; $this->drupalGet('admin/structure/types/add'); @@ -175,7 +179,6 @@ class WebTest extends BrowserTestBase { // Create a node, check display, edit, verify that it has been updated. $edit = [ 'title[0][value]' => $this->randomMachineName(), - 'body[0][value]' => $this->randomMachineName(), 'field_' . $field_name . '[0][value]' => $this->randomMachineName(), ]; $this->drupalGet('node/add/' . $node_type); @@ -189,7 +192,6 @@ class WebTest extends BrowserTestBase { $this->drupalLogin($admin_user); $this->drupalGet('node'); $this->clickLink($edit['title[0][value]']); - $this->assertSession()->responseContains($edit['body[0][value]']); $this->clickLink(t('Edit')); $update = [ 'title[0][value]' => $this->randomMachineName(), @@ -202,7 +204,6 @@ class WebTest extends BrowserTestBase { $this->drupalLogout(); $this->drupalGet('node'); $this->clickLink($update['title[0][value]']); - $this->assertSession()->responseContains($edit['body[0][value]']); // Manually add a queue item and process it, to test the queue factory. // Get the queue to test the normal Exception.