Closed (fixed)
Project:
Automatic Updates
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
18 Aug 2022 at 20:18 UTC
Updated:
15 Dec 2022 at 20:42 UTC
Jump to comment: Most recent
Comments
Comment #2
tedbowComment #3
rahul_ commentedComment #5
rahul_ commentedComment #6
omkar.podey commentedTest case Missing otherwise looks good .
Comment #8
tedbowHere is the test case we need
\Drupal\Tests\automatic_updates\Functional\UpdaterFormTest::testSuccessfulUpdatewhere$maintenance_mode_onstarts as false. Basically no need to call$state->set('system.maintenance_mode', $maintenance_mode_on);This will ensure we get inside this IF block
That was we will go into the `foreach` loop in the block with an `$messages` array with 1 element, because "Operating in maintenance mode" would have been filtered out.
automatic_updates_testtest module but I think it would be more useful to add the ability to just set messages in\Drupal\package_manager_test_validation\EventSubscriber\TestSubscriber. so we would need a method on that classpublic static function setMessage(string $message, string $message_type, string $event)Then we would update
\Drupal\package_manager_test_validation\EventSubscriber\TestSubscriber::handleEventto handle the case where we have message set. See howhandleEventcurrent interacts with the other `set*` methods on that class.Then we could set a message in our tests like this
TestSubscriber1::setMessage("my message", PostApply::class);like we do now for validation results.so the end of our test would be
$assert_session->pageTextContains('Update complete!');This line should currently fail, proving the bug
Comment #9
rahul_ commentedI created a failure testcase for reproduce the message override issue.
Could you please re-review MR. please let me know if any improvement needed.
Comment #10
tedbow@rahul_ thanks you for making the 2nd MR. I only review https://git.drupalcode.org/project/automatic_updates/-/merge_requests/433
Left some comments there.
Comment #11
rahul_ commentedI updated the MR, with '3304640-test-fail' rebased into '3304640-logic-error-in'.
Needs re-review of MR.
Thanks
Comment #12
tedbow@rahul_ I pushed up 2 comment changes. I checked the failures on `3304640-test-fail` branch and they are what we could expect.
This looks good now. will merge if tests still pass/fail as expected with the last commits
Comment #14
tedbowThanks @rahul_! 🎉
Comment #16
tedbow