Move test-related Docker files to tests/docker

This commit is contained in:
Jan Jakeš
2019-01-23 15:31:09 +01:00
committed by wxa
parent a8aa4c1afd
commit 4bd38f8e89
6 changed files with 25 additions and 12 deletions

View File

@ -148,6 +148,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 codeception -g acceptance_group_1 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -165,6 +166,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 codeception -g acceptance_group_2 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -182,6 +184,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 codeception -g acceptance_group_3 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -199,6 +202,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 codeception -g acceptance_group_4 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -216,6 +220,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception -g acceptance_group_1 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -233,6 +238,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception -g acceptance_group_2 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -250,6 +256,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception -g acceptance_group_3 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
@ -267,6 +274,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
cd tests/docker
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception -g acceptance_group_4 --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output

View File

@ -257,28 +257,30 @@ class RoboFile extends \Robo\Tasks {
}
function testAcceptance($opts=['file' => null, 'skip-deps' => false, 'timeout' => null]) {
return $this->_exec(
return $this->taskExec(
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
($opts['timeout'] ? '-e WAIT_TIMEOUT=' . (int)$opts['timeout'] . ' ' : '') .
'codeception --steps --debug -vvv ' .
'-f ' . ($opts['file'] ? $opts['file'] : '')
);
)->dir(__DIR__ . '/tests/docker')->run();
}
function testAcceptanceMultisite($opts=['file' => null, 'skip-deps' => false, 'timeout' => null]) {
return $this->_exec(
return $this->taskExec(
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
($opts['timeout'] ? '-e WAIT_TIMEOUT=' . (int)$opts['timeout'] . ' ' : '') .
'-e MULTISITE=1 ' .
'codeception --steps --debug -vvv' .
'-f ' . ($opts['file'] ? $opts['file'] : '')
);
)->dir(__DIR__ . '/tests/docker')->run();
}
function deleteDocker() {
return $this->_exec('docker-compose down -v --remove-orphans --rmi all');
return $this->taskExec(
'docker-compose down -v --remove-orphans --rmi all'
)->dir(__DIR__ . '/tests/docker')->run();
}
function testFailedUnit() {

View File

@ -7,6 +7,6 @@ RUN composer global require --optimize-autoloader "hirak/prestissimo"
WORKDIR /wp-core/wp-content/plugins/mailpoet
ENV WP_ROOT=/wp-core
ADD docker-entrypoint.sh /
ADD tests/docker/codeception/docker-entrypoint.sh /
RUN ["chmod", "+x", "/docker-entrypoint.sh"]

View File

@ -2,16 +2,18 @@ version: '2.1'
services:
codeception:
build: .
build:
context: ../..
dockerfile: tests/docker/codeception/Dockerfile
depends_on:
mailhog:
condition: service_started
wordpress:
condition: service_healthy
volumes:
- ./:/project
- ../..:/project
- wp-core:/wp-core
- ./:/wp-core/wp-content/plugins/mailpoet
- ../..:/wp-core/wp-content/plugins/mailpoet
entrypoint: /docker-entrypoint.sh
mailhog:
@ -21,8 +23,9 @@ services:
- 8025:8025
wordpress:
build: ./tests/wordpressDockerfile
image: wordpress:latest
build:
context: ../..
dockerfile: tests/docker/wordpress/Dockerfile
depends_on:
mysql:
condition: service_healthy
@ -30,7 +33,7 @@ services:
condition: service_started
volumes:
- wp-core:/var/www/html
- ./:/var/www/html/wp-content/plugins/mailpoet
- ../..:/var/www/html/wp-content/plugins/mailpoet
- /tmp:/var/www/html/wp-content/uploads/mailpoet/cache
ports:
- 8080:80