Closed
Description
Preconditions
- Any compatible Magento version
- Any compatible MFTF version
- Have your web server (Apache or Nginx) point to the
<MAGE_ROOT_DIR>/pub
as recommended in the DevDocs
Steps to reproduce
Run any test or suite with a magentoCLI
step in test <before>
or <after>
Expected result
CLI command is executed properly
Actual result
The command is not executed via shell exec but via POST call to the Magento instance
The problem is that the file to be executed, /dev/tests/acceptance/utils/command.php
, is outside the /pub
directory and as such usually not accessible.
To overcome this, there is additional configuration necessary on web server level (example ngnix configuration):
location /dev/tests/acceptance/ {
root $MAGE_ROOT;
location ~ ^/dev/tests/acceptance/utils/[^.]+\.php {
fastcgi_pass $FASTCGI_BACKEND;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
allow <local_ip>;
deny all;
}
}
This should probably either be documented in the setup guides for MFTF or rectified to use the shell command instead.