Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Commits
07f987bd
Commit
07f987bd
authored
3 years ago
by
Adam G-H
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3260666
by phenaproxima: Readiness checks should not be shown on UpdateReady form
parent
b67915ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!201
Issue #3260666: Readiness checks should not be shown on UpdateREady form or update.php
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Form/UpdaterForm.php
+1
-1
1 addition, 1 deletion
src/Form/UpdaterForm.php
tests/src/Functional/UpdaterFormTest.php
+17
-12
17 additions, 12 deletions
tests/src/Functional/UpdaterFormTest.php
with
18 additions
and
13 deletions
src/Form/UpdaterForm.php
+
1
−
1
View file @
07f987bd
...
...
@@ -198,7 +198,7 @@ class UpdaterForm extends FormBase {
],
];
if
(
$form_state
->
isSubmitted
())
{
if
(
$form_state
->
getUserInput
())
{
$results
=
[];
}
else
{
...
...
This diff is collapsed.
Click to expand it.
tests/src/Functional/UpdaterFormTest.php
+
17
−
12
View file @
07f987bd
...
...
@@ -297,21 +297,34 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
],
]);
// Flag a warning, which will not block the update but should be displayed
// on the updater form.
$this
->
createTestValidationResults
();
$expected_results
=
$this
->
testResults
[
'checker_1'
][
'1 warning'
];
TestChecker1
::
setTestResult
(
$expected_results
,
ReadinessCheckEvent
::
class
);
$messages
=
reset
(
$expected_results
)
->
getMessages
();
$page
=
$this
->
getSession
()
->
getPage
();
$this
->
drupalGet
(
'/admin/modules/automatic-update'
);
// The warning should be visible.
$assert_session
=
$this
->
assertSession
();
$assert_session
->
pageTextContains
(
reset
(
$messages
));
$page
->
pressButton
(
'Update'
);
$this
->
checkForMetaRefresh
();
$this
->
assertUpdateStagedTimes
(
1
);
$this
->
assertUpdateReady
();
// We should see a warning about pending database updates, and once the
// staged changes have been applied, we should be redirected to update.php.
$assert_session
=
$this
->
assertSession
();
// The warning from the updater form should be not be repeated, but we
// should see a warning about pending database updates, and once the staged
// changes have been applied, we should be redirected to update.php, where
// neither warning should be visible.
$assert_session
->
pageTextNotContains
(
reset
(
$messages
));
$possible_update_message
=
'Possible database updates were detected in the following modules; you may be redirected to the database update page in order to complete the update process.'
;
$assert_session
->
pageTextContains
(
$possible_update_message
);
$assert_session
->
pageTextContains
(
'System'
);
$page
->
pressButton
(
'Continue'
);
$this
->
checkForMetaRefresh
();
$assert_session
->
addressEquals
(
'/update.php'
);
$assert_session
->
pageTextNotContains
(
reset
(
$messages
));
$assert_session
->
pageTextNotContains
(
$possible_update_message
);
$assert_session
->
pageTextContainsOnce
(
'Please apply database updates to complete the update process.'
);
}
...
...
@@ -328,23 +341,15 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this
->
setCoreVersion
(
'9.8.0'
);
$this
->
checkForUpdates
();
// Flag a warning, which will not block the update but should be displayed
// on the updater form.
$this
->
createTestValidationResults
();
$expected_results
=
$this
->
testResults
[
'checker_1'
][
'1 warning'
];
TestChecker1
::
setTestResult
(
$expected_results
,
ReadinessCheckEvent
::
class
);
$messages
=
reset
(
$expected_results
)
->
getMessages
();
$page
=
$this
->
getSession
()
->
getPage
();
$this
->
drupalGet
(
$update_form_url
);
$assert_session
=
$this
->
assertSession
();
$assert_session
->
pageTextContains
(
reset
(
$messages
));
$page
->
pressButton
(
'Update'
);
$this
->
checkForMetaRefresh
();
$this
->
assertUpdateStagedTimes
(
1
);
$this
->
assertUpdateReady
();
$page
->
pressButton
(
'Continue'
);
$this
->
checkForMetaRefresh
();
$assert_session
=
$this
->
assertSession
();
$assert_session
->
addressEquals
(
'/admin/reports/updates'
);
$assert_session
->
pageTextContainsOnce
(
'Update complete!'
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment