Open kopepasah opened 4 years ago
I will note, however, that bypassing the platform requirements performs the installation as expected:
composer install --ignore-platform-reqs
Hi @kopepasah, what is your OS you're using locally? And how did you install PHP for that host machine?
From there I created a blank test plugin, configured Composer with minimum-stability of dev and ran the installer command for WP Acceptance (within shell)
Does the shell here mean that the shell of the docker container after you run 10updocker shell
?
When you run WPAcceptance locally, you should install and run it on your HOST machine, not within another Docker environment.
Hi @kopepasah, what is your OS you're using locally? And how did you install PHP for that host machine?
MacOS, but this is not related unless running from the HOST machine is really a requirement.
Does the shell here mean that the shell of the docker container after you run 10updocker shell?
Yes.
When you run WPAcceptance locally, you should install and run it on your HOST machine, not within another Docker environment.
This does not seem correct as WP Acceptance should be able to run in containers on any CI platform, including in containers on a developers personal computer. If it is truly the case that WP Acceptance should run on the host machine then that means it requires the developer to configure the machine according to the requirements, but this is honestly just an old practice. Running in containers is reliable and predictable, unlike the variations found in a personal machine.
Is the requirement to run WP Acceptance directly on the host machine documented somewhere?
Lastly, my expectation here would be that I can create a bespoke WordPress plugin and run the following command to install WP Acceptance:
composer require 10up/wpacceptance:dev-master --dev
But this does not work and there is additional required configuration not documented (as this command throws errors), even when using wp-local-docker
.
@kopepasah I tested installing wpacceptance for a fresh project inside 10updocker shell
and I can install it without the problem you got. I use php-fpm 7.3.
But as I said above, you will need to run WPAcceptance from your host machine because WPAcceptance requires docker
, and it's not available inside the 10up/wp-php-fpm-dev
container (at least, by default).
Is the requirement to run WP Acceptance directly on the host machine documented somewhere?
Yes, see the note at the end of Project setup section. https://wpacceptance.readthedocs.io/en/latest/#project-setup.
CI is different because it has docker service available during the builds, that's why we can use WPA on CI. FYI, see: https://blog.travis-ci.com/2015-08-19-using-docker-on-travis-ci/
Is your enhancement related to a problem? Please describe.
Yes, the documentation for installing WP Acceptance does not clearly define the project, platform and/or system requirements. This causes issue when trying to use Composer without the specific project requirements of WP Acceptance.
For example, while working on improving Composer support for the Restricted Site Access plugin, I ran into an issue when running composer install which stated that my system did not contain the necessary requirements:
This is expected, as these are required to run WP Acceptance. I personally use Lando for local development, so I went into the shell to run the install, but still received errors for missing system requirements. This was unexpected, as my local Lando configuration met the requirements documented on
wpacceptance.readthedocs.io
:As such, I installed
wp-local-docker-v2
in order to test installing WP Acceptance on a new WordPress install, in a blank plugin. In this scenario, I started a new site with10updocker
and configured a Single WordPress installation, with default content deleted. From there I created a blank test plugin, configured Composer withminimum-stability
ofdev
and ran the installer command for WP Acceptance (within shell):While the other requirements above were met (expected), to my surprise there was a different install error:
Here is the composer.json for that blank repo:
Describe the solution you'd like
As a developer that could find WP Acceptance useful, it would be beneficial to use this as a Composer package that clearly stated all requirements in order to use the package. As it stands now, there seem to be some required "behind the scenes" configurations that are not yet documented, including the requirement to run Composer commands within the Docker containers.
My expectation is that when the environment (local, stage, prod) is correctly configured (according to the documentation) running
composer require 10up/wpacceptance:dev-master --dev
would not throw any errors.In those cases where system/platform requirements are not met, better notifications to the developer would be useful in debugging and understanding the requirements of this package.