markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.53k stars 996 forks source link

MFTF Configuration Issue #1038

Open mjogi-rave opened 8 months ago

mjogi-rave commented 8 months ago

Description I have installed Magento 2.4.6-p3 using docker steps under folder /var/www/html/magento246p3/ and I want to use MFTF feature in docker, but bin/mftf build:project command is creating .env and .credential file under /var/www/html/dev/tests/acceptance/, but this file is not creating under this given path.

Also bin/mftf doctor command is not working

Here are my docker container details docker-ps

Steps To Reproduce

  1. Run command : bin/mftf build:project
  2. Run command : bin/mftf doctor

bin/mftf build:project mftf-build-project

Alternative MFTF checked below command, but it not worked for me

bin/mftf doctor This command is not able to use .env and .credential file mftf-doctor

I switched to src folder /var/www/html/magento246p3/src and run below command vendor/bin/mftf doctor Output: image

I have attached my docker and mftf file for refernce. docker-files.zip

Expected Result

  1. .env and .credential file should create under /var/www/html/magento246p3/src/dev/tests/acceptance/
  2. bin/mftf doctor should execute successfully

Actual Result

  1. These files are not creating under this given path /var/www/html/magento246p3/src/dev/tests/acceptance/.
  2. bin/mftf doctor gives error
JesperHerrloff commented 8 months ago

The given path is /var/www/html/dev/tests/acceptance as this is the path in the docker. You could add a bind mount for the files in dev/tests if needed.

And restart the docker. So should the tests directory be synced.

when running vendor/bin/mftf locally it has probably no connection with the selenium container if not opened ports.

mjogi-rave commented 8 months ago

The given path is /var/www/html/dev/tests/acceptance as this is the path in the docker. You could add a bind mount for the files in dev/tests if needed.

  • ./src/dev/tests:/var/www/html/dev/tests:cached

And restart the docker. So should the tests directory be synced.

when running vendor/bin/mftf locally it has probably no connection with the selenium container if not opened ports.

Thanks @JesperHerrloff it is worked.

After running bin/mftf build:project successfully. I could not run bin/mftf doctor command. Here is error: image

Note: Frontend and backend url working file in browser

Thanks

JesperHerrloff commented 8 months ago

Did you enable the path to commands.php in nginx.conf in your project folder?

Example below.

location ~* ^/dev/tests/acceptance/utils($|/) { root $MAGE_ROOT; location ~ ^/dev/tests/acceptance/utils/command.php { fastcgi_pass fastcgi_backend; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

mjogi-rave commented 8 months ago

Yes, I have added these line of code inside src/nginx.conf file

nginx conf

mjogi-rave commented 8 months ago

I have fixed other errors. Now I am facing only one error related to Magento CLI. See: image

Magento CLI step is not working.

Thanks