Commit af8f1e25 by Johnny Theill

Added advanced app tests to travis

parent 1af04e1e
...@@ -31,7 +31,16 @@ install: ...@@ -31,7 +31,16 @@ install:
- composer install --dev --prefer-dist -d apps/basic - composer install --dev --prefer-dist -d apps/basic
- cd apps/basic && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:* - cd apps/basic && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:*
- php vendor/bin/codecept build && cd ../.. - php vendor/bin/codecept build && cd ../..
- cd apps && php -S localhost:8080 & # advanced application:
- composer install --dev --prefer-dist -d apps/advanced
- cd apps/advanced && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:*
- ./init --env=Development
- sed -i s/root/travis/ common/config/main-local.php
- cd backend && php ../vendor/bin/codecept build
- cd ../common && php ../vendor/bin/codecept build
- cd ../frontend && php ../vendor/bin/codecept build && cd ../../..
# boot server
- cd apps && php -S localhost:8080 > /dev/null 2>&1 &
before_script: before_script:
- echo 'elasticsearch version ' && curl http://localhost:9200/ - echo 'elasticsearch version ' && curl http://localhost:9200/
...@@ -39,10 +48,19 @@ before_script: ...@@ -39,10 +48,19 @@ before_script:
- psql -U postgres -c 'CREATE DATABASE yiitest;'; - psql -U postgres -c 'CREATE DATABASE yiitest;';
- tests/unit/data/travis/sphinx-setup.sh - tests/unit/data/travis/sphinx-setup.sh
- mongo yii2test --eval 'db.addUser("travis", "test");' - mongo yii2test --eval 'db.addUser("travis", "test");'
- mysql -e 'CREATE DATABASE yii2_advanced_acceptance;';
- mysql -e 'CREATE DATABASE yii2_advanced_functional;';
- mysql -e 'CREATE DATABASE yii2_advanced_unit;';
- cd apps/advanced/frontend/tests/acceptance && php yii migrate --interactive=0
- cd ../functional && php yii migrate --interactive=0
- cd ../unit && php yii migrate --interactive=0 && cd ../../../../..
script: script:
- vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata
- cd apps/basic && php vendor/bin/codecept run - cd apps/basic && php vendor/bin/codecept run
- cd ../advanced/backend && ../vendor/bin/codecept run
- cd ../common && ../vendor/bin/codecept run
- cd ../frontend && ../vendor/bin/codecept run
after_script: after_script:
- wget https://scrutinizer-ci.com/ocular.phar - wget https://scrutinizer-ci.com/ocular.phar
......
...@@ -111,8 +111,10 @@ To make your database up to date, you can run in needed test folder `yii migrate ...@@ -111,8 +111,10 @@ To make your database up to date, you can run in needed test folder `yii migrate
if you are starting from `frontend` tests then you should run `yii migrate` in each suite folder `acceptance`, `functional`, `unit` if you are starting from `frontend` tests then you should run `yii migrate` in each suite folder `acceptance`, `functional`, `unit`
it will upgrade your database to the last state according migrations. it will upgrade your database to the last state according migrations.
To be able to run acceptance tests you should configure your server to point doc_root to your new created application. For example if we To be able to run acceptance tests you should configure your server to point the doc_root to the root of your application.
use php builtin server, then all that is needed to do is run `php -S 127.0.0.1:8080` in main project directory - directory that contains `frontend`, `backend`, `common`, `console` directories. You also need to adjust the `TEST_ENTRY_URL` in `frontend/tests/_bootstrap.php` and `backend/tests/_bootstrap.php` (remove "/advanced" sub-folder from url).
If we use php builtin server, then all that is needed to do is to run `php -S 127.0.0.1:8080` in main project directory - directory that
contains `frontend`, `backend`, `common`, `console` directories.
After that is done you should be able to run your tests, for example to run `frontend` tests do: After that is done you should be able to run your tests, for example to run `frontend` tests do:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// the entry script URL (without host info) for functional and acceptance tests // the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL // PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined('TEST_ENTRY_URL') or define('TEST_ENTRY_URL', '/backend/web/index-test.php'); defined('TEST_ENTRY_URL') or define('TEST_ENTRY_URL', '/advanced/backend/web/index-test.php');
// the entry script file path for functional and acceptance tests // the entry script file path for functional and acceptance tests
defined('TEST_ENTRY_FILE') or define('TEST_ENTRY_FILE', dirname(__DIR__) . '/web/index-test.php'); defined('TEST_ENTRY_FILE') or define('TEST_ENTRY_FILE', dirname(__DIR__) . '/web/index-test.php');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// the entry script URL (without host info) for functional and acceptance tests // the entry script URL (without host info) for functional and acceptance tests
// PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL // PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL
defined('TEST_ENTRY_URL') or define('TEST_ENTRY_URL', '/frontend/web/index-test.php'); defined('TEST_ENTRY_URL') or define('TEST_ENTRY_URL', '/advanced/frontend/web/index-test.php');
// the entry script file path for functional and acceptance tests // the entry script file path for functional and acceptance tests
defined('TEST_ENTRY_FILE') or define('TEST_ENTRY_FILE', dirname(__DIR__) . '/web/index-test.php'); defined('TEST_ENTRY_FILE') or define('TEST_ENTRY_FILE', dirname(__DIR__) . '/web/index-test.php');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment