From 75cc595630e1c81f46b1edba9582df5259211a83 Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Wed, 27 Nov 2013 22:26:57 +0200 Subject: [PATCH 1/4] proper db name (comply with yiitest) #2 --- tests/unit/data/sphinx/sphinx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/data/sphinx/sphinx.conf b/tests/unit/data/sphinx/sphinx.conf index 91f5ee3..5672e06 100644 --- a/tests/unit/data/sphinx/sphinx.conf +++ b/tests/unit/data/sphinx/sphinx.conf @@ -2,7 +2,7 @@ # # Setup test environment: # - initialize test database source: -# mysql -D yii2test -u test < /path/to/yii/tests/unit/data/sphinx/source.sql +# mysql -D yiitest -u test < /path/to/yii/tests/unit/data/sphinx/source.sql # - setup test Sphinx indexes: # indexer --config /path/to/yii/tests/unit/data/sphinx/sphinx.conf --all [--rotate] # - run the "searchd" daemon: @@ -39,7 +39,7 @@ source yii2_test_item_src sql_host = localhost sql_user = travis sql_pass = - sql_db = yii2test + sql_db = yiitest sql_port = 3306 # optional, default is 3306 sql_query = \ From 0387666c8bc08e3590f9b43e198b662075d02ce3 Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Wed, 27 Nov 2013 22:30:31 +0200 Subject: [PATCH 2/4] added sphinx runtime pid dir --- tests/unit/data/travis/sphinx-setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/data/travis/sphinx-setup.sh b/tests/unit/data/travis/sphinx-setup.sh index 47bf28c..f0ec75e 100755 --- a/tests/unit/data/travis/sphinx-setup.sh +++ b/tests/unit/data/travis/sphinx-setup.sh @@ -18,6 +18,10 @@ sudo chmod -R 777 /var/log/sphinx # ugly (for travis) sudo mkdir /var/lib/sphinx sudo chmod 777 /var/lib/sphinx # ugly (for travis) +# run dir pid +sudo mkdir /var/run/sphinx +sudo chmod 777 /var/run/sphinx # ugly (for travis) + # setup test Sphinx indexes: indexer --config $CWD/../sphinx/sphinx.conf --all From feef1256bd813e04ede646507bb94c83a0dba9ca Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Wed, 27 Nov 2013 22:54:58 +0200 Subject: [PATCH 3/4] updated travis tests README --- tests/unit/data/travis/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/data/travis/README.md b/tests/unit/data/travis/README.md index c86497e..ad9538d 100644 --- a/tests/unit/data/travis/README.md +++ b/tests/unit/data/travis/README.md @@ -10,3 +10,5 @@ The scripts are: Compiles and installs the [memcache pecl extension](http://pecl.php.net/package/memcache) - [`cubrid-setup.sh`](cubrid-setup.sh) Prepares the [CUBRID](http://www.cubrid.org/) server instance by installing the server and PHP PDO driver + - [`sphinx-setup.sh`](sphinx-setup.sh) + Prepares the [Sphinx](http://sphinxsearch.com/) server instances by installing the server and attaching it to MySQL \ No newline at end of file From 332fdf98ba8e4ac3afa1a4ff6bc2d8a9a82490a5 Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Wed, 27 Nov 2013 23:04:41 +0200 Subject: [PATCH 4/4] Added fixture in the before script part The db fixture in the sphinx configuration for unit test takes place after starting the sphinxserver on travis, by importing the fixture in the before scripts we allow sphinxsearch on travis to run create the indexes properly --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index aadd537..6eeec4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_script: - composer self-update && composer --version - composer require satooshi/php-coveralls 0.6.* --dev --prefer-dist - mysql -e 'CREATE DATABASE yiitest;'; + - mysql -D yiitest -u travis < /home/travis/build/yiisoft/yii2/tests/unit/data/sphinx/source.sql - psql -U postgres -c 'CREATE DATABASE yiitest;'; - echo 'elasticsearch version ' && curl http://localhost:9200/ - tests/unit/data/travis/apc-setup.sh