From 5cb2283d894262ff0b9dc5e4d946c2340f567ba6 Mon Sep 17 00:00:00 2001 From: Panagiotis Moustafellos Date: Wed, 27 Nov 2013 21:52:10 +0200 Subject: [PATCH] Travis: Adding sphinx support --- .travis.yml | 1 + tests/unit/data/config.php | 2 +- tests/unit/data/sphinx/sphinx.conf | 4 ++-- tests/unit/data/travis/sphinx-setup.sh | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 tests/unit/data/travis/sphinx-setup.sh diff --git a/.travis.yml b/.travis.yml index cfea251..aadd537 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_script: - tests/unit/data/travis/apc-setup.sh - tests/unit/data/travis/memcache-setup.sh - tests/unit/data/travis/cubrid-setup.sh + - tests/unit/data/travis/sphinx-setup.sh #script: # - phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata,vendor,sphinx diff --git a/tests/unit/data/config.php b/tests/unit/data/config.php index 5a068ae..0bd5e47 100644 --- a/tests/unit/data/config.php +++ b/tests/unit/data/config.php @@ -42,7 +42,7 @@ return [ 'sphinx' => [ 'sphinx' => [ 'dsn' => 'mysql:host=127.0.0.1;port=9306;', - 'username' => '', + 'username' => 'travis', 'password' => '', ], 'db' => [ diff --git a/tests/unit/data/sphinx/sphinx.conf b/tests/unit/data/sphinx/sphinx.conf index 30cf083..e38beda 100644 --- a/tests/unit/data/sphinx/sphinx.conf +++ b/tests/unit/data/sphinx/sphinx.conf @@ -14,7 +14,7 @@ source yii2_test_article_src type = mysql sql_host = localhost - sql_user = + sql_user = travis sql_pass = sql_db = yii2test sql_port = 3306 # optional, default is 3306 @@ -37,7 +37,7 @@ source yii2_test_item_src type = mysql sql_host = localhost - sql_user = + sql_user = travis sql_pass = sql_db = yii2test sql_port = 3306 # optional, default is 3306 diff --git a/tests/unit/data/travis/sphinx-setup.sh b/tests/unit/data/travis/sphinx-setup.sh new file mode 100755 index 0000000..1dbaae5 --- /dev/null +++ b/tests/unit/data/travis/sphinx-setup.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +SCRIPT=$(readlink -f "$0") +CWD=$(dirname "$SCRIPT") + +# install sphinxsearch: +echo 'yes' | sudo add-apt-repository ppa:builds/sphinxsearch-daily +sudo apt-get update +sudo apt-get install sphinxsearch + +# setup test Sphinx indexes: +indexer --config $CWD/../sphinx/sphinx.conf --all + +# run searchd: +searchd --config $CWD/../sphinx/sphinx.conf