phparch icon indicating copy to clipboard operation
phparch copied to clipboard

Docker support for unit tests

Open swharden opened this issue 4 years ago • 3 comments

Added docker files to the home directory and added notes at the bottom of the main readme to make it easy for new developers to run/test phparch in a Linux container

Note that 1 test currently fails: https://github.com/j6s/phparch/issues/22

swharden avatar Oct 02 '21 21:10 swharden

Curiously, I could not reproduce #22 - after checking out that branch and running the compose setup, it worked on my machine (TM)

j6s avatar Oct 02 '21 21:10 j6s

When starting from a clean repository without a vendor/ directory, composer install inside of the container fails because a php extension is missing.

php_1  | Installing dependencies from lock file (including require-dev)
php_1  | Verifying lock file contents can be installed on current platform.
php_1  | Package operations: 39 installs, 0 updates, 0 removals
php_1  |     Failed to download symfony/polyfill-ctype from dist: The zip extension and unzip/7z commands are both missing, skipping.
php_1  | The php.ini used by your command-line PHP is: /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
php_1  |     Now trying to download from source
php_1  | 
php_1  |                                                             
php_1  |   [RuntimeException]                                        
php_1  |   git was not found in your PATH, skipping source download  
php_1  |                                                             

j6s avatar Oct 19 '21 18:10 j6s

Thanks for pointing that out! To prevent "it works on my machine" problems like this I created another GitHub action that builds the docker container (and runs the tests inside it) in the cloud.

I'm not proposing this replace the tests that already run in the cloud (#24), but this will at least let you spot-check that the testing container is building as expected. If it's not helpful you may wish to modify it so it only runs manually (not on every push).

image

swharden avatar Oct 19 '21 23:10 swharden