From b489f5013b266a8a7b21134b4fa29a53da422946 Mon Sep 17 00:00:00 2001 From: Sascha Grossenbacher Date: Thu, 10 Mar 2016 20:59:38 +0100 Subject: [PATCH 1/4] Fix phpunit call --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed20432..48a185f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,15 +92,15 @@ script: - ls -la $TRAVIS_BUILD_DIR/../drupal/sites/default # Run the tests - - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "search_api_solr" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT + - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT # Check if we had fails in the run-tests.sh script # Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\ # is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a # bit. # Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors. - TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(PHP Fatal error)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$? - - cd $TRAVIS_BUILD_DIR/../drupal/core - - ./vendor/bin/phpunit --group search_api_solr -c "../modules/search_api_solr/phpunit.xml.travis" --verbose --debug | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT + - cd $TRAVIS_BUILD_DIR/../drupal + - ./vendor/bin/phpunit --group search_api_solr -c "modules/search_api_solr/phpunit.xml.travis" --verbose --debug | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT #- ./vendor/bin/phpunit --group search_api_solr -c "../modules/search_api_solr/phpunit.xml.travis" --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT # if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we # failed. From 5e62388ca065d2c1553bfcac5bf967751dcb43b6 Mon Sep 17 00:00:00 2001 From: Sascha Grossenbacher Date: Thu, 10 Mar 2016 21:15:02 +0100 Subject: [PATCH 2/4] Added SIMPLETEST_DB --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 48a185f..0aec57b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,6 +92,7 @@ script: - ls -la $TRAVIS_BUILD_DIR/../drupal/sites/default # Run the tests + - export SIMPLETEST_DB=mysql://root:@localhost/drupal - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT # Check if we had fails in the run-tests.sh script # Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\ From b077c8d456f00f291e19bd66e71372ff3995f1a2 Mon Sep 17 00:00:00 2001 From: Sascha Grossenbacher Date: Thu, 10 Mar 2016 21:39:02 +0100 Subject: [PATCH 3/4] Simplify, make it fail --- .travis.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0aec57b..f6be763 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,15 +93,9 @@ script: # Run the tests - export SIMPLETEST_DB=mysql://root:@localhost/drupal - - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT - # Check if we had fails in the run-tests.sh script - # Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\ - # is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a - # bit. - # Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors. - - TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(PHP Fatal error)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$? + - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" - cd $TRAVIS_BUILD_DIR/../drupal - - ./vendor/bin/phpunit --group search_api_solr -c "modules/search_api_solr/phpunit.xml.travis" --verbose --debug | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT + - ./vendor/bin/phpunit --group search_api_solr -c "modules/search_api_solr/phpunit.xml.travis" --verbose --debug #- ./vendor/bin/phpunit --group search_api_solr -c "../modules/search_api_solr/phpunit.xml.travis" --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT # if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we # failed. @@ -109,8 +103,3 @@ script: #- /home/travis/.composer/vendor/bin/phpcs --standard=/home/travis/.composer/vendor/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,module,install --ignore=css/ $TRAVIS_BUILD_DIR/../drupal/modules/search_api - php -i | grep 'php.ini' - sudo cat /var/log/apache2/error.log - # Exit the build - - echo $TEST_EXIT - - echo $TEST_OUTPUT - - echo $TEST_PHPUNIT - - if [ $TEST_EXIT -eq 0 ] && [ $TEST_OUTPUT -eq 0 ] && [ $TEST_PHPUNIT -eq 0 ]; then exit 0; else exit 1; fi From 92e93079ab96b43e95e3c1b9ae66a7dded996962 Mon Sep 17 00:00:00 2001 From: Sascha Grossenbacher Date: Thu, 10 Mar 2016 21:53:20 +0100 Subject: [PATCH 4/4] Another attempt at parsing failing tests --- .travis.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6be763..87ee7ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,9 +93,15 @@ script: # Run the tests - export SIMPLETEST_DB=mysql://root:@localhost/drupal - - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" + - php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost --class "\Drupal\search_api_solr\Tests\IntegrationTest" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXI + # Check if we had fails in the run-tests.sh script + # Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\ + # is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a + # bit. + # Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors. + - TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(Fatal erro)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$? - cd $TRAVIS_BUILD_DIR/../drupal - - ./vendor/bin/phpunit --group search_api_solr -c "modules/search_api_solr/phpunit.xml.travis" --verbose --debug + - ./vendor/bin/phpunit --group search_api_solr -c "modules/search_api_solr/phpunit.xml.travis" --verbose --debug | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT #- ./vendor/bin/phpunit --group search_api_solr -c "../modules/search_api_solr/phpunit.xml.travis" --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT # if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we # failed. @@ -103,3 +109,8 @@ script: #- /home/travis/.composer/vendor/bin/phpcs --standard=/home/travis/.composer/vendor/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,module,install --ignore=css/ $TRAVIS_BUILD_DIR/../drupal/modules/search_api - php -i | grep 'php.ini' - sudo cat /var/log/apache2/error.log + # Exit the build + - echo $TEST_EXIT + - echo $TEST_OUTPUT + - echo $TEST_PHPUNIT + - if [ $TEST_EXIT -eq 0 ] && [ $TEST_OUTPUT -eq 0 ] && [ $TEST_PHPUNIT -eq 0 ]; then exit 0; else exit 1; fi