Conversation
- Custom WP image build that includes WP-CLI and Git - docker-file.yml to start the services easily - Fresh start on Dev-Setup.md Current status: the site can be started in a container and changes in the source folder are reflected there.
dev-env/Dockerfile
Outdated
| RUN yes | pecl install xdebug \ | ||
| && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ | ||
| && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
| && echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/xdebug.ini \ |
There was a problem hiding this comment.
This is what makes the responses slow. See http://stackoverflow.com/a/19273025/1243495
…her smaller improvements
…s to start debugging sessions updated
…ated because the build was failing with Node 8. While at it, Dev-Setup updated to recommend Node 8.
7a3de8f to
500ad42
Compare
- Section about Testing in Dev-Setup.md - Composer dependencies revisited and slimmed down to a currently required minimum (packages for end2end tests are currently missing so those tests are broken; to be fixed soon). - Most of the dependencies updated to a "reasonable latest", as far as PHP 5.6 compatibility allows (config.platform.php in composer.json updated to PHP 5.6). - Some small fixes in actual code were required because of different paths in Docker containers or newer PHPUnit versions. - PhpStorm .idea templates updated.
…WebTest` but this has been WIP for a couple of days so I'm going to commit the current state, with further updates coming soon. Details:
- New `tests/docker-compose.yml` that defines the testing stack.
- Two new images, `apache-php5.6` to run the site and `testenv` to provide an environment for test execution.
- Two test suites implemented as docker-compose "services": `unit-tests` and `selenium-tests`.
- Tests can be run by npm scripts like `npm run test:unit-tests` or directly by docker-compose: `docker-compose run unit-tests`.
- Some VersionPress code has been updated to support the new testing setup:
- ❗ `VERSIONPRESS_TEMP_DIR` changed from `VERSIONPRESS_PLUGIN_DIR/temp` to `WP_CONTENT_DIR/vpcache` as the plugin directory is now mounted as a read-only file system.
- I took the opportunity to also update the name of the folder, it seems that the main use case is now to cache the definition files. So in `WP_CONTENT_DIR`, VersionPress currently creates two folders, `vpdb` and `vpcache`.
- `WpAutomation` now deals with various permission issues (some path are mounted as read-only file systems with unchangeable `root:root` owner, some can and should be changed to www-data, etc.).
- Running WP-CLI command as `root` is only needed in `ensureCleanInstallationIsAvailable()` so maybe this could go away soon.
- `TestConfig::adminName` renamed to `adminUser` to be consistent with newer versions of WP-CLI.
- Selenium test classes set host to `selenium-hub` (used to be `localhost`; maybe this should be a dynamic value coming from `test-config.yml`).
- `phpunit.xml` split to several `phpunit-<test-type>.xml` files. Each test suite / docker-compose service runs one of them.
- `test-config.yml` is no longer meant to be updated manually so it was committed to the repo directly. `test-config.sample.yml` was removed.
- Major updates to `Dev-Setup.md`: mostly the _Testing_ section but also added better intro and a new section _Docker tips_. Full debugging workflows around docker-compose tests are described.
Known issues:
- Those permissions in `WpAutomation`.
- `WpConfigSplitterTest` "unit" tests are failing because they write to file system which is now read-only.
- By far not all tests have been incorporated yet.
- I've used the name `vp01` for testing site, maybe it should be renamed to something more intuitive.
- Testing section of `Dev-Setup.md` will need some cleanup. VNC viewer setup would be cool.
|
Major progress on dockerizing integration tests in 6843b87. I'm very happy that running full-blown Selenium tests is now as easy as unit tests. Compare:
It won't get much better than that :) Good resource I used: sandrokeil/docker-selenium-grid-phpunit: An example how to use a Selenium-Grid with Docker and PHPUnit/Mink Next steps: Moved to OP. |
|
@JanVoracek I'm seeking feedback on certain things from 6843b87 please:
|
…ry for clone with correct permissions
…ything uses Docker Compose now.
# Conflicts: # CONTRIBUTING.md # docs/README.md # gulpfile.js # package.json # plugins/versionpress/composer.json # plugins/versionpress/composer.lock
…, npm@5 is now good enough)
…don't understand how it could have passed back then

Resolves #1041 (Dockerized development environment)
Resolves #1144 (Update .idea template files)
Resolves #974 (Update project dependencies)
Resolves parts of #1213 (Update dev setup and dependencies for 4.0-beta)
This is not perfect yet but already implements a lot of work so let's merge it.
Summary
wp-content/plugins/versionpressis a read-only mount), for example, there's a newwp-content/vpcachefolder instead ofwp-content/plugins/versionpress/temp.Dev-Setup.mdrewritten and simplified,Testing.mdincorporated into it..editorconfigfiles unified.Known issues
npm run tests). This needs further inspection. Fix remaining tests under Docker for 4.0-beta #1257Future work
TODO list:
<repo>/plugins/versionpressinto the containerxdebug.remote_autostartfor performance reasonsPublicWebTestis run). There will very likely be many smaller issues, for example,WpConfigSplitterTesttests are failing because file system is now read-only.WpAutomationcurrently does tricky handling of users and permissions (root vs. www-data), this could most likely be simplified.Make both Selenium and WP-CLI workers work easily at the same time (right now, it is a test-config.yml value that needs to be switched manually).Will be a separate PR.test-config.yml.Dev-Setup.mdwill need some cleanup.selenium-tests.Testing.mdintoDev-Setup.mdfrontenddevdocker-compose up -d