diff --git a/drupalci.yml b/drupalci.yml index ff326d13cfcd9b5fcf3a59b15796be66d49cf6ae..3cd1b3cc07ae5dc0f4bb4bc8816680aba848a582 100644 --- a/drupalci.yml +++ b/drupalci.yml @@ -14,7 +14,7 @@ build: # Update to latest Composer. - composer self-update # @todo Replace in favor of commit-code-check.sh once https://www.drupal.org/project/drupal/issues/3314100 lands. - # - modules/contrib/automatic_updates/scripts/commit-code-check.sh --drupalci + - modules/contrib/automatic_updates/scripts/commit-code-check.sh --drupalci halt-on-fail: true # run_tests task is executed several times in order of performance speeds. # halt-on-fail can be set on the run_tests tasks in order to fail fast. diff --git a/package_manager/tests/src/Build/TemplateProjectTestBase.php b/package_manager/tests/src/Build/TemplateProjectTestBase.php index 6e603ac3a6be8ee8922263e13d76adb915c8ae73..1863c8b2750fe878abac75704a94c5a5bcfb13f1 100644 --- a/package_manager/tests/src/Build/TemplateProjectTestBase.php +++ b/package_manager/tests/src/Build/TemplateProjectTestBase.php @@ -571,7 +571,7 @@ END; * * @see \Drupal\package_manager_test_event_logger\EventSubscriber\EventLogSubscriber::logEventInfo */ - protected function assertExpectedStageEventsFired(string $expected_stage_class, ?array $expected_events = NULL, ?string $message = NULL, bool $allow_additional_events = FALSE): void { + protected function assertExpectedStageEventsFired(string $expected_stage_class, ?array $expected_events = NULL, ?string $message = NULL): void { if ($expected_events === NULL) { $expected_events = [ PreCreateEvent::class, @@ -613,13 +613,7 @@ END; foreach ($expected_events as $event) { $expected_titles[] = "package_manager_test_event_logger-start: Event: $event, Stage instance of: $expected_stage_class:package_manager_test_event_logger-end"; } - if (!$allow_additional_events) { - $this->assertSame($expected_titles, $actual_titles, $message ?? ''); - } - else { - $this->assertEmpty(array_diff($expected_titles, $actual_titles), $message ?? ''); - } - + $this->assertSame($expected_titles, $actual_titles, $message ?? ''); } /** diff --git a/src/CronUpdateStage.php b/src/CronUpdateStage.php index 64017e70e47b9d01994bee93103399b0eebe16e3..019b2f73a3e655eeea03cc9888234408acb2e4ad 100644 --- a/src/CronUpdateStage.php +++ b/src/CronUpdateStage.php @@ -112,22 +112,22 @@ class CronUpdateStage extends UnattendedUpdateStageBase implements CronInterface $process = Process::fromShellCommandline($phpBinaryFinder->find() . " $drush_path auto-update &"); // Temporary command to test detached process still runs after response. - //$process = Process::fromShellCommandline($phpBinaryFinder->find() . " $drush_path test-process &"); - $process->setworkingdirectory($this->pathLocator->getProjectRoot() . DIRECTORY_SEPARATOR . $this->pathLocator->getWebRoot()); - //$process->disableOutput(); + // $process = Process::fromShellCommandline($phpBinaryFinder->find() . " $drush_path test-process &"); + $process->setWorkingDirectory($this->pathLocator->getProjectRoot() . DIRECTORY_SEPARATOR . $this->pathLocator->getWebRoot()); + // $process->disableOutput(); $process->setTimeout(0); try { $process->start(); sleep(1); $wait_till = time() + 5; - //Wait for the process to start. + // Wait for the process to start. while (is_null($process->getPid()) && $wait_till > time()) { } } catch (\Throwable $throwable) { - watchdog_exception('automatic_updates', $throwable, 'affff'); + watchdog_exception('automatic_updates', $throwable, 'Unable to start background update.'); } } diff --git a/tests/src/Build/CoreUpdateTest.php b/tests/src/Build/CoreUpdateTest.php index 7bd823e711e40a2ec88505e6823e70b1cf7f042a..50342ae47ba607e4370f5b1e3374d9a50e0250d9 100644 --- a/tests/src/Build/CoreUpdateTest.php +++ b/tests/src/Build/CoreUpdateTest.php @@ -378,7 +378,7 @@ class CoreUpdateTest extends UpdateTestBase { } /** - * + * Assert a cron update ran successfully. */ protected function assertCronUpdateSuccessful(): void { $mink = $this->getMink(); @@ -412,7 +412,7 @@ class CoreUpdateTest extends UpdateTestBase { // There should be a log entry about the successful update. $log_entry = $assert_session->elementExists('named', [ 'link', - 'Drupal core has been updated from 9.8.0 to 9.8.1' + 'Drupal core has been updated from 9.8.0 to 9.8.1', ]); $this->assertStringContainsString('/admin/reports/dblog/event/', $log_entry->getAttribute('href')); $this->assertUpdateSuccessful('9.8.1'); diff --git a/tests/src/Kernel/DrushUpdateStageTest.php b/tests/src/Kernel/DrushUpdateStageTest.php index 99a79db522c41d375635ab070b2ad3da3d9399f4..0ad104940617730efb802ff722f0bb3f92550062 100644 --- a/tests/src/Kernel/DrushUpdateStageTest.php +++ b/tests/src/Kernel/DrushUpdateStageTest.php @@ -5,7 +5,6 @@ declare(strict_types = 1); namespace Drupal\Tests\automatic_updates\Kernel; use Drupal\automatic_updates\CronUpdateStage; -use Drupal\automatic_updates\DrushUpdateStage; use Drupal\automatic_updates\UnattendedUpdateStageBase; use Drupal\automatic_updates_test\EventSubscriber\TestSubscriber1; use Drupal\Core\DependencyInjection\ContainerBuilder;