- Issue created by @tedbow
- last update
about 1 year ago Custom Commands Failed - last update
about 1 year ago 1 pass, 1 fail - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass, 1 fail - last update
about 1 year ago 1 pass - Status changed to Postponed
about 1 year ago 1:53pm 31 October 2023 - ๐บ๐ธUnited States tedbow Ithaca, NY, USA
Hmmm. with 50 test runs the current tests don't fail.
I think lets just keep an on out for more random failures and re-open this issue if needed
I also wonder if when we finally drop support for Drupalci if this will not happen on gitlabci
- Status changed to Needs work
8 months ago 4:11pm 21 March 2024 - ๐บ๐ธUnited States tedbow Ithaca, NY, USA
I think this happening again now that we are using gitlab ci https://git.drupalcode.org/project/automatic_updates/-/jobs/1113256
example
---- Drupal\Tests\automatic_updates\Build\CoreUpdateTest ---- Status Group Filename Line Function -------------------------------------------------------------------------------- Fail Other phpunit-1.xml 0 Drupal\Tests\automatic_updates\Buil PHPUnit Test failed to complete; Error: PHPUnit 9.6.17 by Sebastian Bergmann and contributors. Testing Drupal\Tests\automatic_updates\Build\CoreUpdateTest F...... 7 / 7 (100%) Time: 13:20.850, Memory: 24.27 MB There was 1 failure: 1) Drupal\Tests\automatic_updates\Build\CoreUpdateTest::testApi Error response: The website encountered an unexpected error. Please try again later.Drupal\package_manager\Exception\StageEventException: assert(Inspector::assertAll(fn($message) => $message instanceof TranslatableMarkup, $messages)) in Drupal\package_manager\StageBase->dispatch() (line 627 of modules/contrib/automatic_updates/package_manager/src/StageBase.php). Drupal\package_manager\ValidationResult->__construct(2, Array, Object, 1) (Line: 93) Drupal\package_manager\ValidationResult::createError(Array, Object) (Line: 52) Drupal\package_manager\Event\PreOperationStageEvent->addError(Array, Object) (Line: 129) Drupal\package_manager\Validator\SupportedReleaseValidator->validate(Object, 'Drupal\package_manager\Event\PreApplyEvent', Object) call_user_func(Array, Object, 'Drupal\package_manager\Event\PreApplyEvent', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object) (Line: 618) Drupal\package_manager\StageBase->dispatch(Object, Object) (Line: 498) Drupal\package_manager\StageBase->apply() (Line: 37) Drupal\automatic_updates_test_api\ApiController->createAndApplyStage(Object) (Line: 100) Drupal\package_manager_test_api\ApiController->run(Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19) require('/tmp/build_workspace_a63f489ecaf5e45ff6b4b6e418b75a69rZVogN/project/web/index.php') (Line: 71) Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ 4 => 'Drupal\package_manager\Event\PreRequireEvent' 5 => 'Drupal\package_manager\Event\PostRequireEvent' 6 => 'Drupal\package_manager\Event\PreApplyEvent' - 7 => 'Drupal\package_manager\Event\PostApplyEvent' ) /builds/project/automatic_updates/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:79 /builds/project/automatic_updates/web/modules/custom/automatic_updates/package_manager/tests/src/Build/TemplateProjectTestBase.php:621 /builds/project/automatic_updates/web/modules/custom/automatic_updates/tests/src/Build/CoreUpdateTest.php:126 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/TextUI/Command.php:145 /builds/project/automatic_updates/vendor/phpunit/phpunit/src/TextUI/Command.php:98 FAILURES! Tests: 7, Assertions: 495, Failures: 1. Remaining self deprecation notices (9) Remaining direct deprecation notices (3) Other deprecation notices (1)
- ๐บ๐ธUnited States tedbow Ithaca, NY, USA
ok this is very confusing.
- \Drupal\package_manager\Validator\SupportedReleaseValidator::validate was finding an error because
if ($unknown_packages) { $summary = $this->formatPlural( count($unknown_packages), 'Cannot update because the following new or updated Drupal package does not have project information.', 'Cannot update because the following new or updated Drupal packages do not have project information.', ); $event->addError($unknown_packages, $summary); }
was being hit. but the actually was showing up because
$unknown_packages
was was just strings so\Drupal\package_manager\ValidationResult::__construct
threw an exception because ofassert(Inspector::assertAll(fn ($message) => $message instanceof TranslatableMarkup, $messages));
I fixed this problem by
$unknown_packages
was an array of translatable objects.This would at least let us see what packages where in
$unknown_packages
. Basically why did randomly 1 out of 20 times did\Drupal\Tests\automatic_updates\Build\CoreUpdateTest::testApi
fail.which led to.....
-
PHPUnit Test failed to complete; Error: PHPUnit 9.6.18 by Sebastian Bergmann and contributors. Testing Drupal\Tests\automatic_updates\Build\CoreUpdateTest .F.................. 20 / 20 (100%) Time: 42:09.652, Memory: 28.00 MB There was 1 failure: 1) Drupal\Tests\automatic_updates\Build\CoreUpdateTest::testApi with data set #1 (1) Error response: The website encountered an unexpected error. Please try again later.Drupal\package_manager\Exception\StageEventException: The update cannot proceed because the following Drupal project was unexpectedly updated. Only Drupal Core updates are currently supported. module 'drupal/automatic_updates' from 3.1.x-dev to 3.0.x-dev. Cannot update because the following new or updated Drupal package does not have project information. drupal/automatic_updates of type drupal-module in Drupal\package_manager\StageBase->dispatch() (line 622 of modules/contrib/automatic_updates/package_manager/src/StageBase.php). Drupal\package_manager\StageBase->apply() (Line: 37) Drupal\automatic_updates_test_api\ApiController->createAndApplyStage(Object) (Line: 100) Drupal\package_manager_test_api\ApiController->run(Object)
So now that the translation problem has been solved we can see the actual
$unknown_packages
that where change 1 in 20 times of running this test.So we have 2 validation errors here:
StagedProjectsValidator:Drupal project was unexpectedly
updated. Only Drupal Core updates are currently supported.
module 'drupal/automatic_updates' from 3.1.x-dev to 3.0.x-dev.and
\Drupal\package_manager\Validator\SupportedReleaseValidator
Cannot update because the following new or updated Drupal package does not
have project information.
drupal/automatic_updates of type drupal-moduleThis is because there is no
project
key in the info file even though it is adrupal-module
since we testing from the git clone. - Big question is why did composer update 'drupal/automatic_updates' from 3.1.x-dev to 3.0.x-dev but only 1 out of 20 times the test was run ๐ฑ
- \Drupal\package_manager\Validator\SupportedReleaseValidator::validate was finding an error because
- ๐ฎ๐ณIndia samit.310@gmail.com
samit.310@gmail.com โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia samit.310@gmail.com
Hello,
Fixed the conflicts and refactor the test cases code,
Following test cases are getting failed, not sure why, as i am not able to view errors in the pipeline. getting
The current user is not authorized to access the job log.
error, Attaching the screenshot.- phpunit (previous minor): [automatic_updates, Build]
Thanks
Samit K.