You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
Full tests (npm run tests:full) currently take over an hour to run on a relatively powerful machine (Core i7 MacBook Pro) and there are some other issues related to tests as we reviewed them with @JanVoracek today.
UPDATE: In the end, this issue is a major update of the dockerized dev / testing environment last updated in #1329.
Highlights
Full tests now run much faster thanks to volumes instead of host-mounted folders. On my machine, the time dropped from 1 hour 15 minutes to just 11 minutes. Use named volumes for tests #1396
The main testing scripts is now just npm run tests (the :full suffix has been dropped).
Also, all the tests:custom scripts have been dropped as run-tests.ts now accepts parameters, for example: npm run tests -- --testsuite Unit --filter CursorTest
They are uglier, e.g., busybox:latest becomes busybox@sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b52004ee8502d, but it's the only way to make runs predictable (docker-compose lacks a concept of a lock file).
Document how to stop tests on Mac – Ctrl+C doesn't work, I have to open another terminal, type docker ps, copy the container ID and do docker stop <id>. Resolved as part of New run-tests.ts, making test runs more reliable #1401 – Ctrl+C now kills the Node.js script.
Rename images to something like versionpress/wordpress and versionpress/cli, i.e., make "CLI" part of the image name so that it's clear when digests are used.
Only enable Xdebug for ...:debug scripts.
Right now, it's always enabled and just not configured with the right idekey in non-debug scripts which makes things slower. Here and here.
Update Xdebug to 2.7.0. (Let's still stay on PHP 7.2 for tests for now.)
Make PHP 7.2 the minimum required version? (We don't have an issue for it yet, will create it.)
The WP-CLI installation into the WP image looks a bit weird, review it.
Try updating PHPUnit (I remember it wasn't so easy due to supported PHP versions or something but it's worth looking again).
Don't base our CLI image on wordpress:cli, it does a lot more than we need.
Another big one is WP-CLI / Selenium worker switching – revised approach #1258 (WP-CLI / Selenium worker switching). That issue is a bit old but overall, we should still be able to run all tests with both workers, or pick a worker with a flag like npm run tests --worker=selenium. Things like a worker or a specific test site to use shouldn't be hardcoded in test-config.yml.
Full tests (
npm run tests:full) currently take over an hour to run on a relatively powerful machine (Core i7 MacBook Pro) and there are some other issues related to tests as we reviewed them with @JanVoracek today.UPDATE: In the end, this issue is a major update of the dockerized dev / testing environment last updated in #1329.
Highlights
run-tests.tsscript that orchestrates how tests run. For example, it decides when to start a WordPress stack (if at all), cleans up after itself, etc. Newrun-tests.ts, making test runs more reliable #1401npm run tests(the:fullsuffix has been dropped).tests:customscripts have been dropped asrun-tests.tsnow accepts parameters, for example:npm run tests -- --testsuite Unit --filter CursorTestDuring the work, I've also encountered several other things that are noted in the "Deferred items" section below.
TODO list
docker-compose.ymlanddocker-compose.tests.yml. Separate docker-compose files for dev and tests #1395busybox:latestbecomesbusybox@sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b52004ee8502d, but it's the only way to make runs predictable (docker-compose lacks a concept of a lock file).docker-compose config --resolve-image-digestscan help with that.package.jsonimpl), then Newrun-tests.ts, making test runs more reliable #1401 (run-tests.tsimpl)run-tests.tsand make test runs more reliable. Make tests pass on the updated testing infrastructure #1400 (PR Newrun-tests.ts, making test runs more reliable #1401)run-tests.ts, making test runs more reliable #1401.docker ps, copy the container ID and dodocker stop <id>. Resolved as part of Newrun-tests.ts, making test runs more reliable #1401 – Ctrl+C now kills the Node.js script.npm run testspass. Make tests pass on the updated testing infrastructure #1400Deferred items
These should be done separately in future PRs.
versionpress/wordpressandversionpress/cli, i.e., make "CLI" part of the image name so that it's clear when digests are used....:debugscripts.npm run tests --worker=selenium. Things like a worker or a specific test site to use shouldn't be hardcoded intest-config.yml.