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

/var/www/html in wordpress-for-tests should not be a volume#1380

Closed
candrews wants to merge 1 commit intoversionpress:masterfrom
candrews:wordpress-for-tests-not-a-volume
Closed

/var/www/html in wordpress-for-tests should not be a volume#1380
candrews wants to merge 1 commit intoversionpress:masterfrom
candrews:wordpress-for-tests-not-a-volume

Conversation

@candrews
Copy link
Copy Markdown
Contributor

@candrews candrews commented Mar 4, 2019

This directory is used for running tests; it is entirely ephemeral.

Also, having it as a volume causes the mkdir and chown in
./dev-env/wordpress-cli-image/Dockerfile
to not take effect (since the volume is mounted over
/var/www/html), resulting in the tests not being able to
write to /var/www/html since its not owned by www-data,
resulting in tests failing with this error:

Exception: Error executing cmd 'php '/tmp/wp-cli-latest-stable.phar' core download --path='/var/www/html/wptest' --version='4.9' --force --locale='en_US'' from working directory '/var/www/html/wptest':
Error: '/var/www/html/wptest/' is not writable by current user.
 in /opt/versionpress/tests/Automation/WpAutomation.php:621

Resolves #

Write a paragraph or two about the proposed changes here.

This directory is used for running tests; it is entirely ephemeral.

Also, having it as a volume causes the mkdir and chown in
./dev-env/wordpress-cli-image/Dockerfile
to not take effect (since the volume is mounted over
/var/www/html), resulting in the tests not being able to
write to /var/www/html since its not owned by www-data,
resulting in tests failing with this error:
```
Exception: Error executing cmd 'php '/tmp/wp-cli-latest-stable.phar' core download --path='/var/www/html/wptest' --version='4.9' --force --locale='en_US'' from working directory '/var/www/html/wptest':
Error: '/var/www/html/wptest/' is not writable by current user.
 in /opt/versionpress/tests/Automation/WpAutomation.php:621
```
@candrews candrews mentioned this pull request Mar 4, 2019
@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 4, 2019

I forgot the details but the idea was that if your tests fail, you can inspect the folder as it's mounted to dev-env/wp-for-tests. What would the workflow be after the proposed change?

@candrews
Copy link
Copy Markdown
Contributor Author

candrews commented Mar 4, 2019

You could exec into the docker container and look that way.

@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 4, 2019

Do you know why we don't have a similar problem with other mounts from dev-env? The goal is to have various folders mapped to a host OS filesystem which is much more developer-friendly than having to inspect containers via docker exec. I've also never seen the permission issue myself, could it be related to your OS?

Don't get me wrong, your reasoning sounds solid to me but I care about the experience of troubleshooting failed tests.

@candrews
Copy link
Copy Markdown
Contributor Author

candrews commented Mar 4, 2019

could it be related to your OS?

Travis CI experiencing the exact same error as I do on my Fedora system, so if it's OS dependent, it's probably for all Linux distros.

I care about the experience of troubleshooting failed tests.

I do too :) But right now, we have no CI test running and tests are failing.

Do you have other thoughts as to how we can solve this problem? It looks like you worked on a closely related issue in 87769bf

@borekb
Copy link
Copy Markdown
Member

borekb commented Mar 4, 2019

Yes, I was quite familiar with many of the details a year ago, more than I would have liked :) I would have to research it again though, which I'm happy to do after I return from holiday later this week.

@candrews
Copy link
Copy Markdown
Contributor Author

candrews commented Mar 6, 2019

Superseded by #1388

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants