diff --git a/.opts.yml b/.opts.yml index ef0b24ef44507cfb5e4c814feddfddff64acfe34..f1309c7adda7a10a561ac4269b40fc302b14bdc7 100644 --- a/.opts.yml +++ b/.opts.yml @@ -6,7 +6,7 @@ upgrade_commands: default: - touch disable-config-readonly - - DRUPAL_MEMCACHE_HOSTS="" ./vendor/bin/drush deploy --yes + - ./vendor/bin/drush deploy --yes - ./vendor/bin/drush search-api:reset-tracker --yes - ./vendor/bin/drush joinup:node-access-rebuild - rm disable-config-readonly diff --git a/composer.json b/composer.json index 86776c236a79b8ad15347683eaf2ca00544b641b..5a94d90d2e40f5026d4dce28ab051a505035d17a 100644 --- a/composer.json +++ b/composer.json @@ -279,7 +279,8 @@ "Cannot implement a custom user cancellation method @see https://www.drupal.org/project/drupal/issues/3135592": "https://git.drupalcode.org/project/drupal/-/merge_requests/1675.diff", "If you don't set the \"version\" of a profile, the report/status displays an empty dash @see https://www.drupal.org/project/drupal/issues/3270892": "https://git.drupalcode.org/project/drupal/-/merge_requests/2003.diff", "Restrict images to this site\" restricts images that, by definition, *are* on this site @see https://www.drupal.org/project/drupal/issues/2998318": "https://git.drupalcode.org/project/drupal/-/merge_requests/3810.diff", - "Have responsive image module ignore svg @see https://www.drupal.org/project/drupal/issues/2957924": "https://www.drupal.org/files/issues/2022-06-23/drupal-responsive_image_svg_support-2957924-11.patch" + "Have responsive image module ignore svg @see https://www.drupal.org/project/drupal/issues/2957924": "https://www.drupal.org/files/issues/2022-06-23/drupal-responsive_image_svg_support-2957924-11.patch", + "Verify that the existing cache bin exists before calling it @see https://www.drupal.org/project/drupal/issues/2429321": "https://git.drupalcode.org/project/drupal/-/merge_requests/1521.diff" }, "drupal/default_content": { "Allow manual imports @see https://www.drupal.org/i/2640734": "https://git.drupalcode.org/project/default_content/-/merge_requests/20.diff" diff --git a/composer.lock b/composer.lock index 8b9477c8ea5e8e3f810dd9f1ff02f051d3ee828c..f393b76eb43a35708dd7f8b3377719861ee96b86 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "41b60771b460d41a0aca0aa1bb0be367", + "content-hash": "362927c016e3e904254904bfd755dfd1", "packages": [ { "name": "asm89/stack-cors", diff --git a/tests/features/update/smoke_test.feature b/tests/features/update/smoke_test.feature index 11d19420ec771be40391ede25e54de436e2422fc..ddc213bbd1e35c6f68a5e0c0e98d704088921d8f 100644 --- a/tests/features/update/smoke_test.feature +++ b/tests/features/update/smoke_test.feature @@ -10,3 +10,6 @@ Feature: Minimal install clone testing. # Check that the Solr index has been restored. When I visit "/search?keys=joinup&f[0]=type:collection" Then I should see "The platform Joinup is the European Commission's one-stop shop for interoperable, open and free digital government ICT solutions" + + Scenario: Assert that the cache backend is set to memcache. + Given the default cache backend is set to "cache.backend.memcache" diff --git a/tests/src/Context/JoinupCoreContext.php b/tests/src/Context/JoinupCoreContext.php index 97cb553e6f7f64ee3007487901870014daa74f90..d0b6a7daa92e3656b570fda47155b320bc3a74c7 100644 --- a/tests/src/Context/JoinupCoreContext.php +++ b/tests/src/Context/JoinupCoreContext.php @@ -352,4 +352,22 @@ public static function setDefaultTimezone(BeforeSuiteScope $before_suite): void date_default_timezone_set('UTC'); } + /** + * Assert the default cache backend service. + * + * @param string $expected + * The expected cache backend service. + * + * @Given /^the default cache backend is set to "([^"]*)"$/ + */ + public function theDefaultCacheBackendIsSetTo(string $expected): void { + $container = \Drupal::getContainer(); + $factory = $container->get($expected); + Assert::assertNotNull($factory, "The service $expected does not exist. Note, that you need to pass a service ID, not a class name."); + + $actual = get_class(\Drupal::cache()); + $expected = get_class($factory->get('default')); + Assert::assertSame($expected, $actual); + } + } diff --git a/web/modules/custom/joinup_core/drush.services.yml b/web/modules/custom/joinup_core/drush.services.yml index 6d4ff19c6776efc390cf22fb2a508d33a840436d..bfb2ac447582c9f5919e932c8894bfdffb2220e9 100644 --- a/web/modules/custom/joinup_core/drush.services.yml +++ b/web/modules/custom/joinup_core/drush.services.yml @@ -4,9 +4,3 @@ services: arguments: ['@database'] tags: - { name: drush.command } - - joinup_core.clean_cache_tables.commands: - class: Drupal\joinup_core\Commands\JoinupCleanCacheTablesCommands - arguments: ['@database'] - tags: - - { name: drush.command } diff --git a/web/modules/custom/joinup_core/src/Commands/JoinupCleanCacheTablesCommands.php b/web/modules/custom/joinup_core/src/Commands/JoinupCleanCacheTablesCommands.php deleted file mode 100644 index 3b74ac1000505faeccbb07c3785d0b45ee584002..0000000000000000000000000000000000000000 --- a/web/modules/custom/joinup_core/src/Commands/JoinupCleanCacheTablesCommands.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -declare(strict_types = 1); - -namespace Drupal\joinup_core\Commands; - -use Drupal\Core\Database\Connection; -use Drush\Commands\DrushCommands; - -/** - * Commands related to the cache tables. - * - * @see \Drush\Drupal\Commands\sql\SanitizeCommands::sanitize() - */ -class JoinupCleanCacheTablesCommands extends DrushCommands { - - /** - * Constructs a new Drush commands class instance. - * - * @param \Drupal\Core\Database\Connection $db - * The database connection. - */ - public function __construct(protected Connection $db) { - parent::__construct(); - } - - /** - * Cleans the cahce tables. - * - * @command joinup:clean-cache-tables - */ - public function cleanCacheTables(): void { - // Load all tables from the database that start with `cache_`. - $tables = $this->db->schema()->findTables('cache_%'); - - // Truncate all cache tables. - foreach ($tables as $table) { - $this->db->truncate($table)->execute(); - } - } - -}