Remove dependencies installation from acceptace tests

[MAILPOET-1535]
This commit is contained in:
Rostislav Wolny
2018-09-17 18:10:29 +02:00
parent 78967c8d6a
commit 079fe6f280
4 changed files with 15 additions and 20 deletions

View File

@ -102,7 +102,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
docker-compose run codeception --steps --debug -vvv --html --xml
docker-compose run -e SKIP_DEPS=1 codeception --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
- store_test_results:
@ -126,7 +126,7 @@ jobs:
- run:
name: Run acceptance tests
command: |
docker-compose run -e MULTISITE=1 codeception --steps --debug -vvv --html --xml
docker-compose run -e SKIP_DEPS=1 -e MULTISITE=1 codeception --steps --debug -vvv --html --xml
- store_artifacts:
path: tests/_output
- store_test_results:

View File

@ -197,4 +197,9 @@ If youre on a Mac, you can open vnc://localhost:5900 in Safari to watch the t
To run tests:
```sh
$ ./do test:acceptance
```
```
You can skip installation of composer dependencies using --skip-deps parameter.
```sh
$ ./do test:acceptance --skip-deps
```

View File

@ -231,19 +231,19 @@ class RoboFile extends \Robo\Tasks {
return $this->_exec($command);
}
function testAcceptance($opts=['file' => null, 'keep-deps' => false]) {
function testAcceptance($opts=['file' => null, 'skip-deps' => false]) {
return $this->_exec(
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
($opts['keep-deps'] ? '-e KEEP_DEPS=1 ' : '') .
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
'codeception --steps --debug -vvv ' .
'-f ' . ($opts['file'] ? $opts['file'] : '')
);
}
function testAcceptanceMultisite($opts=['file' => null, 'keep-deps' => false]) {
function testAcceptanceMultisite($opts=['file' => null, 'skip-deps' => false]) {
return $this->_exec(
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
($opts['keep-deps'] ? '-e KEEP_DEPS=1 ' : '') .
($opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
'-e MULTISITE=1 ' .
'codeception --steps --debug -vvv' .
'-f ' . ($opts['file'] ? $opts['file'] : '')

View File

@ -94,14 +94,9 @@ fi
sed -i "s/define( *'WP_DEBUG', false *);/define('WP_DEBUG', true);define('WP_DEBUG_DISPLAY', true);define('WP_DEBUG_LOG', true);/" ./wp-config.php
# Load Composer dependencies
# Set KEEP_DEPS environment flag to not redownload them on each run, only for the 1st time, useful for development.
# Example: docker-compose run -e KEEP_DEPS=1 codeception ...
# Don't forget to restore your original /vendor folder from /vendor_backup manually or by running acceptance tests without this flag.
if [[ -z "${KEEP_DEPS}" ]]; then
rm -rf /project/vendor_backup
fi
if [ ! -d "/project/vendor_backup" ]; then
mv /project/vendor /project/vendor_backup
# Set SKIP_DEPS environment flag to not download them. E.g. you have downloaded them yourself
# Example: docker-compose run -e SKIP_DEPS=1 codeception ...
if [[ -z "${SKIP_DEPS}" ]]; then
cd /project
php composer.phar install
fi
@ -111,9 +106,4 @@ cd /wp-core/wp-content/plugins/mailpoet
/project/vendor/bin/codecept run acceptance -c codeception.acceptance.yml $@
exitcode=$?
if [[ -z "${KEEP_DEPS}" ]]; then
rm -rf /project/vendor
mv /project/vendor_backup /project/vendor
fi
exit $exitcode