Skip to content

Commit be13cd1

Browse files
committed
Run the tests inside the docker container
1 parent 22878f3 commit be13cd1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ jobs:
105105
# Run plugin tests
106106
- name: Run Plugin Tests
107107
run: |
108-
# Example: running PHPUnit test suite located in /tests directory.
109-
# Customize the following command based on your actual testing framework.
110-
composer update --no-interaction --prefer-dist
111-
vendor/bin/phpunit --configuration phpunit.xml.dist
108+
CONTAINER_ID=$(docker-compose -f .github/docker/docker-compose.yml ps -q wordpress)
109+
doker exec $CONTAINER_ID composer update --no-interaction --prefer-dist
110+
doker exec $CONTAINER_ID phpunit --configuration phpunit.xml.dist
112111
113112
# Tear down Docker Compose
114113
- name: Shut down Docker Compose

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @package Shortpixel_Image_Optimiser
66
*/
77

8-
$_tests_dir = '/var/www/html/tests/';
8+
$_tests_dir = '/var/www/html/tests';
99

1010
if ( ! $_tests_dir ) {
1111
$_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';

0 commit comments

Comments
 (0)