Test deployment
Previous step
When your code, files, and data is successfully migrated to Staging or Production, use the environment URLs to test your site(s) and store(s). For a list of your URLs, see Starter and Pro access information.
The following information provides information on verifying logs, testing Fastly configurations, user acceptance testing (UAT), and more.
Log files
If you encounter errors on deployment or other issues when testing, check the log files. Log files are located under the var/log
directory.
The deployment log is located in /var/log/platform/<prodject ID>/deploy.log
. The value of <project ID>
depends on the project ID and whether the environment is Staging or Production. For example, with a project ID of yw1unoukjcawe
, the Staging user is yw1unoukjcawe_stg
and the Production user is yw1unoukjcawe
.
When accessing logs in Production, you need to use SSH to log in to each of the three nodes to locate the logs. See Log locations.
Check the code base
Verify your master
code base correctly deployed to Staging and Production environments. The environments should have identical code bases.
Verify configuration settings
Check the Magento configuration settings through the Admin panel including the Base URL, Base Admin URL, multi-site settings, and more. If you need to make any additional changes, complete edits in your local Git branch and push to the master
branch in Integration, Staging, and Production.
Check Fastly caching
Verify Fastly is caching properly on Staging and Production. Configuring Fastly requires careful attention to details, using the correct Fastly Service ID and Fastly API token, and a proper VCL snippet uploaded.
First, check for headers with a dig command to the URL. In a terminal application, enter dig <url>
to verify Fastly services display in the headers. For additional dig
tests, see Fastly’s Testing before changing DNS.
The following examples use Pro URLs. You can use any URL with the dig
command.
- Staging:
dig http[s]://staging.<your domain>.c.<instanceid>.ent.magento.cloud
- Production:
dig http[s]://<your domain>.{1|2|3}.<project ID>.ent.magento.cloud
Next, use a curl
command to verify X-Magento-Tags exist and additional header information. The format for the command is:
1
curl http[s]://<full site URL> -H "host: <url>" -k -vo /dev/null -HFastly-Debug:1
For Starter, enter the full site URL from your environment Access info in the command to view the headers.
For Pro Staging and Production, the command differs per server:
- Staging:
curl http[s]://staging.<your domain>.c.<instanceid>.ent.magento.cloud -H "host: <url>" -k -vo /dev/null -HFastly-Debug:1
- Production:
- The load balancer:
curl http[s]://<your domain>.c.<project ID>.ent.magento.cloud -H "host: <url>" -k -vo /dev/null -HFastly-Debug:1
- A direct Origin node:
curl http[s]://<your domain>.{1|2|3}.<project ID>.ent.magento.cloud -H "host: <url>" -k -vo /dev/null -HFastly-Debug:1
- The load balancer:
After you are live, you can also check your live site: curl https://<your domain> -k -vo /dev/null -HFastly-Debug:1
. You can also add --resolve
if your live URL is not set up with DNS.
Check the returned response headers and values:
Fastly-Magento-VCL-Uploaded
should be presentX-Magento-Tags
should be returnedFastly-Module-Enabled
should be eitherYes
or the Fastly extension version numberX-Cache
should be eitherHIT
orHIT, HIT
x-cache-hits
should be 1,1Cache-Control: max-age
should be greater than 0Pragma
should becache
To verify Fastly is enabled in Staging and Production, check the configuration in the Magento Admin for each environment:
- Log into the Admin console for Staging and Production using the URL with /admin (or the changed Admin URL).
- Navigate to Stores > Settings > Configuration > Advanced > System. Scroll and click Full Page Cache.
- Ensure Fastly CDN is selected.
- Click on Fastly Configuration. Ensure the Fastly Service ID and Fastly API token are entered (your Fastly credentials). Verify you have the correct credentials entered for the Staging and Production environment. Click Test credentials to help.
Make sure you entered the correct Fastly Service ID and API token in your Staging and Production environments. If you enter Staging credentials in your Production environment, you may not be able to upload your VCL snippets, caching will not work correctly, and your caching will be pointed to the wrong server and stores. Your Fastly credentials are created and mapped per service environment.
The module must be enabled to cache your site. If you have additional extensions enabled that affect headers, one of them could cause issues with Fastly. If you have further issues, see Set up Fastly and Fastly troubleshooting.
Complete UAT testing
Complete User Acceptance Testing (UAT) on Staging and Production. The following tests are a quick list of possible tasks and areas to test as a Merchant and Customer. Your list may be longer and include additional tests for custom modules, extensions, and 3rd party integrations. When testing, use desktops, laptops, and mobile devices.
If you encounter issues, save your reproduction steps, error messages, strange screen captures, and links. Use this information to investigate and fix issues in Integration environment code and configurations or environment settings.
User management |
|
Catalogs & Products |
|
Carts & Checkout |
|
Order management |
|
Site content |
|
Extensions |
|
3rd party integrations |
|
Backend testing |
|
Complete testing
Load and stress testing
Before launching, we highly recommend performing extensive traffic and performance testing on your Staging and Production environments. You should consider performance testing for your frontend and backend processes.
Before you begin testing, enter a ticket with support advising the environments you are testing, what tools you are using, and the time frame. Update the ticket with results and information to track performance. When you complete testing, add your updated results and note in the ticket testing is complete with a date and time stamp.
We recommend that you review the Magento Performance Toolkit options as part of your pre-launch readiness process.
For best results, we recommend the following tools:
- Magento application performance test—Test Magento application performance by configuring the
TTFB_TESTED_PAGES
environment variable to test site response time. - Siege—Traffic shaping and testing software to push your store to the limit. Hit your site with a configurable number of simulated clients. Siege supports basic authentication, cookies, HTTP, HTTPS and FTP protocols.
- Jmeter—Excellent load testing to help gauge performance for spiked traffic, like for flash sales. Create custom tests to run against your site.
- New Relic (provided)—Helps locate processes and areas of the site causing slow performance with tracked time spent per action like transmitting data, queries, Redis, and so on.
- WebPageTest and Pingdom—Real-time analysis of your site pages load time with different origin locations. Pingdom may require a fee. WebPageTest is a free tool.
Functional testing
You can use the Magento Functional Testing Framework (MFTF) to complete functional testing for Magento Commerce from the Cloud Docker environment. See Magento application testing.
Set up Magento Security Scan Tool
We provide a free Security Scan Tool for your sites. To add your sites and run the tool, see Magento Security Scan Tool.