Autoupgrade - Verification of the different error before the upgrade

Details

Steps

Step Description Expected result
Install A fresh 8.1.5 You should have the selection of where in your shop you want to go ( BO or FO )
Go to the BO You should have your dashboard showed
Go to the Module Catalog" page" Module Catalog page is displayed correctly
Search for the 1-click Install" module. Install it" Module is correctly installed
Go to the General Parameters > Maintenance" page. Put the shop in maintenance mode" Maintenance page is displayed correctly. Maintenance mode is activated
Set your “Maintenance IP” by clicking the button “+ Add my IP” and clic on “Save” button Your IP should be setted on the field and you will have the green notification
* Go to the update assistant page * You should see the configuration page of the module
Go to your folder [yourshopname_folder] > module > Autoupgrade > Upgrade Some files should be named upgrade […].php instead of install[…].php
* Go to your folder [yourshopname_folder] > module > Autoupgrade > classes > Task > Upgrade > Download.php
* At line 49, in “public function run”, put “throw new Exception(“Brique”);” and save the folder
* You should see the diffenrent fonction in this php files
* The files should be saved
Click on get started and follow the different step until the update step. Upgrade is launched and at the “Step download”, you should have an exception with : 
* a yellow exception with title “Update failed” and description : “Your store may not work properly anymore. Select the backup you want to use and restore it to avoid any data loss.” 
* A restore button should be on the right in the yellow exception 
* You should have 3 red cross :
** the first one with on the first line at the end “Exception: Brique”
** the second with “It seems there was an issue with the server. This type of error usually happens when […]"
** the third with " HTTP request failed. Type: ERR_BAD_RESPONSE - HTTP Code: 500”
* You should have an “Error Summary” where the 3 red cross is repeted but have a link See error at the end of the line 
* a button “Download update logs”
* a button “Send error report “
* a blue “Restore” button with an icon in it
* Next to the first cross error on “Error summary”, click on see Error
* Click on “Download update logs”
* The background of the first error on logs part should be put on grey and fade to the basic color of the background 
* The download of the update logs should be launched by your bowser
Click on “Send error report” button You should have a modal with : 
* title on bold : Send error report? 
* a description with :  Help us improve the module by sending us this error report. For your information, the logs will be attached with your message. You can add more details in the description if you wish. 
* a link with text : Learn more about your data and your rights”
* An “Error message” box with the last error on it and with a grey bacjground, this box can’t be edited and when your mouse is put on it you should have a error icon on your cursor
* An “Email (optional)” box where you can edit the box 
* A “Description (optional)” box where you can edit the box 
* A “Cancel” button 
* A “Send error report” button
* Click on “Learn more about your data and your rights” 
* Close the tab of Data transparency
* Click on “Email (optional)” box
* Click on “Description (optional)” box 
* Click on the cross or the “Cancel” button or not int he modal
* A new page should be open with title “Data transparency” 
* You should return on the send error report 
* The Background of the"Email” box should be put on yellow
* The background of the “Email” box should be return on grey and the background of the “Description” box should be put on yellow 
* The modal should be closed
* Click on “Send error report” button 
* Fill the Email and description part 
* Click on “Send error report” button
* The modal “Send error report?” should be opened
* The “Email” and “Description” part should be set up
* The modal should be closed
Go to the link  on other tab : [https://prestashop.sentry.io/feedback/?feedbackSlug=autoupgrade-module%3A6504514401&mailbox=ignored&project=4507254110552064&referrer=feedback_list_page] * You should be on a page named “User feedback”, on the spam categorie
* The last user feedback should be yours with the email you set and under the description you said 
* On the right of the list of feedback, you should have the detail of the error with : 
** The different files linked to the error : “logs.txt” “response_raws.txt” and “summary_errors.txt”
** the Url 
** Linked Error 
** Linked Replay 
** Tags 
** Internal Activity
* Go to the link on another tab  “https://eu.mixpanel.com/project/2828312/view/3362352/app/events#9ad5X2HJqJ7y"
* set on filter the parameters
You should see : 
* [SUE] Upgrade Launched
* [SUE] Upgrade Failed 
* Identity

With the same Anonymous ID and php write like “X.X.XX”
* Close the tab 
* Reload your page
* You should return on your update page 
* Update should be relaunch from the start of the loading bar and it should fail after few second
Click on “Restore” button in the yellow exception You should be redirected to the “Backup Selection” page
* Return at the Download.php files and replace “throw new Exception(“Brique”);” by “exit(0);” and save
* Clic on “Update assistant” in the sideboard menu
* The files should be saved
* You should be on the page “Welcome to PrestaShop Update Assistant”
Click on get started and follow the different step until the update step. * Upgrade is launched
* You quickly only have two red cross error : 

** It looks like there is no data received from the server. This can happen if: The server is temporarily unavailable. There’s an issue with the network or connection.
** HTTP request failed. Type: APP_ERR_RESPONSE_EMPTY - HTTP Code: 200
* Click on the blue “Restore” button
* Click on the button “Delete selection” 
* Click on “Delete” button 
* Click on the button “Delete selection” again 
* Click on “Delete”
* You should be redirected to the “Backup Selection” page
* You should have a “Delete backup " modal 
* The backup should be deleted
* You should have a “Delete backup " modal with description “You are about to delete the [nameOfBackup] backup made on[DateAndTime] As it’s your only backup, you will be redirected to the module’s home page. “
* You should be on Welcome Page of the update assistant
Return at the Download.php files and replace “exit(0);” by “while(true) {}” and save The file should be saved
* Click on get started and follow the different step until the update step without backup
* Reload the page during the loading 
* Click on “Leave page”
* Upgrade is launched
* a modal should be displayed with “This page is asking you to confirm that you want to leave — information you’ve entered may not be saved.” with two button “Stay on page” and “Leave page”
* Upgrade should be launched again
Wait until the end of the load for the upgrade Because we don’t have backup, we should have an exception with : 
* a red exception with title “Update failed” and description : “You didn’t back up your store with the Update assistant module but you can restore using your own manual backup.” 
* You should have 3 red cross :

** the first one with on the first line at the end “Maximum execution time of [yourMaxExecutionTime] seconds exceeded”
** the second with “It seems there was an issue with the server. This type of error usually happens when […]"
** the third with " HTTP request failed. Type: ERR_BAD_RESPONSE - HTTP Code: 500”
* You should have an “Error Summary” where the 3 red cross is repeted but have a link See error at the end of the line 
* a button “Download update logs”
* a button “Send error report “
* a blue “Restore” button with an icon in it
* Clic on “Update assistant” in the sideboard menu * You should be redirected to the welcome page of Upgrade Assistant
Return at the Download.php files and delete “while(true) {}” and save The file should be saved
* Go to your [admin_folder_name] 
* open a terminal in this folder
* On the terminal, launch “sudo chmod 000 autoupgrade”
* You should have “backup”, “autoupgrade”, “export”, “filemanager” and “import” “public” and"theme” folder 
* A new terminal appears ! 
* you should have a new line to enter
* Reload the autoupgrade page
* Enable the debug mode
* Preston should say that there is an issue
* You should have a red exception with “Cannot write to the directory. Please ensure you have the necessary write permissions on “/var/www/html/pr_autoup/admin-dev/autoupgrade”.”
* Return on your terminal and launch “sudo chmod 777 autoupgrade”
* Reload the update assistant page
* You should have a new line to enter
* Your Welcome page is displayed correctly
On the link of your bowser, delete the part “home-page” of “route=home-page” and press enter You should have : 
* A 404 image 
* A title :  Something went wrong… 
* A description with “The requested page or resource could not be found. This might be due to:
* A broken or outdated link.
* The page being moved or deleted.
* A typo in the URL.”
* Reload the page
* Click on “Update your Store”
* Click on “Get Started”
* You should be redirected to Welcome page assistant
* The button “Get Started” should be Enabled
* You should be redirected to “Version Choice” page
* Go to your folder [yourshopname_folder] > module > Autoupgrade > classes > UpgradeSelfCheck.php
* in “public function getErrors(): array” and  “public function getWarnings(): array”, invert all the condition and save the folder
* You should see the diffenrent fonction in this php files
* The files should be saved
Click on the Version set un Online version The checking requirement should have 15 errors and 3 warning :

Errors part with a red cross before the text : 
* Your store’s root directory /var/www/html/pr_autoup isn’t writable. Provide write access to the user running PHP with appropriate permission & ownership.
* The /var/www/html/pr_autoup/admin-dev/autoupgrade directory isn’t writable. Provide write access to the user running PHP with appropriate permission & ownership.
* Files can’t be downloaded. Enable PHP’s “allow_url_fopen” option or install PHP extension “cURL”.
* Missing PHP extension “zip”.
* Maintenance mode needs to be enabled. Enable maintenance mode and add your maintenance IP in Shop parameters > General > Maintenance.
* PrestaShop’s caching features needs to be disabled. Disable caching features in Advanced parameters > Performance > Caching.
* Apache mod_rewrite needs to be enabled.
* The following PHP extensions need to be installed:
* The following PHP functions need to be allowed:
* PHP memory_limit needs to be greater than 256 MB.
* PHP file_uploads configuration needs to be enabled.
* Unable to generate private keys using openssl_pkey_new. Check your OpenSSL configuration, especially the path to openssl.cafile.
* It’s not possible to write in the following folders. Provide write access to the user running PHP with appropriate permission & ownership:
* The version of PrestaShop does not match the one stored in database. Your database structure may not be up-to-date and/or the value of PS_VERSION_DB needs to be updated in the configuration table.
* We were unable to fetch missing or altered files. In these conditions, your store cannot be updated to avoid any further bugs.

Warning part with a yellow warning before 
* Your current version of the module is out of date. Update now Modules > Module Manager > Updates
* Some theme files have been altered or removed. Any changes made to these files may be overwritten during the update. See the list of changes.
* Some core files have been altered or removed. Any changes made to these files may be overwritten during the update. See the list of changes.
* Click on the developper documentation 
* Click on the “Shop parameters > General > Maintenance+.+ " link 
* Click on the " Advanced parameters > Performance > Caching.” link
* Click on the " Modules > Module Manager > Updates” link
* You should be redirect on a new tab with title “Update from the back office” 
* You should be redirect on a new tab of your BO, in the maintenance tab of the general shop parameters
* You should be redirect on a new tab of your BO In your performance page 
* You should be redirect on a new tab of your BO in your Update tab of Module Manager tab