Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Use named volumes for tests#1396

Merged
borekb merged 7 commits intomasterfrom
1389-test-volumes
Mar 10, 2019
Merged

Use named volumes for tests#1396
borekb merged 7 commits intomasterfrom
1389-test-volumes

Conversation

@borekb
Copy link
Copy Markdown
Member

@borekb borekb commented Mar 9, 2019

Issue: #1389

This is one of the major items of #1389 that should lead to much faster test runs and to a better encapsulation of tests (fewer host mounts). It has already been drafted by @candrews in #1380, this PR delivers it with all the details.

  • Use a named volume for /var/www/html
  • Named volume for logs – I'm currently hitting the same error that @candrews reported in Make sure the test-logs directory exists #1379, let's see...
  • Document ways to inspect WordPress files and site logs after tests finish.
  • Unify volume names (snake_case vs. dashed-names)

Useful resource: Manage data in Docker from Docker Documentation – discusses differences between volumes and "bind mounts" (host OS mounts).

@borekb
Copy link
Copy Markdown
Member Author

borekb commented Mar 9, 2019

718a29f implements a named volume for /var/www/html and the speedup is really significant:

npm run tests:stop-and-cleanup
npm run tests:custom-with-wordpress -- -c phpunit.xml --filter End2End

Before: 41m 33s
After 718a29f: 7m 45s

Full tests took 11m 18s instead of 1h 15m (!) on my machine.

🎉

@borekb borekb self-assigned this Mar 9, 2019
borekb added 2 commits March 10, 2019 02:53
It wasn't really used so let's not worry about mkdir and permissions in `phpunit-bootstrap.php`...

This also reverts f77af2e – we don't need to ".keep" test-logs in the repository.
With this, there are no more host mounts from dev-env.
borekb added 3 commits March 10, 2019 14:50
Part of this is a new helper script `tests:copy-files-to-host` that copies files from named volumes to host folders. This is convenient but quite slow – the tradeoffs have been documented in `testing.md`.
@borekb
Copy link
Copy Markdown
Member Author

borekb commented Mar 10, 2019

5369b0c merges in the important PR #1397 that fixed www-data permissions.

@borekb borekb marked this pull request as ready for review March 10, 2019 18:38
@borekb borekb added scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. scope: tests Testing code. For infrastructure (CI, etc.), use "dev-infrastructure". labels Mar 10, 2019
@borekb borekb added this to the 4.0 milestone Mar 10, 2019
@borekb
Copy link
Copy Markdown
Member Author

borekb commented Mar 10, 2019

PR description updated, I'm going to merge this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. scope: tests Testing code. For infrastructure (CI, etc.), use "dev-infrastructure".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant