You are here

script.sh in Commerce Ajax Add to Cart 8

#!/bin/bash
# @file
# Script to run the functional JavaScript tests via travis-ci.
# Borrowed from https://github.com/drupalcommerce/commerce/blob/8.x-2.x/.travis-simpletest-js.sh
# Thanks to Matt Glaman and others.

# Add an optional statement to see that this is running in Travis CI.
echo "running drupal_ti/script/script.sh"

export ARGS=( $DRUPAL_TI_SIMPLETEST_JS_ARGS )

if [ -n "$DRUPAL_TI_SIMPLETEST_GROUP" ]
then
        ARGS=( "${ARGS[@]}" "$DRUPAL_TI_SIMPLETEST_GROUP" )
fi


cd "$DRUPAL_TI_DRUPAL_DIR"
{ php "$DRUPAL_TI_SIMPLETEST_FILE" --php $(which php) "${ARGS[@]}" || echo "1 fails"; } | tee /tmp/simpletest-result.txt

egrep -i "([1-9]+ fail[s]?)|(Fatal error)|([1-9]+ exception[s]?)" /tmp/simpletest-result.txt && exit 1
exit 0

File

drupal_ti/script/script.sh
View source
  1. #!/bin/bash
  2. # @file
  3. # Script to run the functional JavaScript tests via travis-ci.
  4. # Borrowed from https://github.com/drupalcommerce/commerce/blob/8.x-2.x/.travis-simpletest-js.sh
  5. # Thanks to Matt Glaman and others.
  6. # Add an optional statement to see that this is running in Travis CI.
  7. echo "running drupal_ti/script/script.sh"
  8. export ARGS=( $DRUPAL_TI_SIMPLETEST_JS_ARGS )
  9. if [ -n "$DRUPAL_TI_SIMPLETEST_GROUP" ]
  10. then
  11. ARGS=( "${ARGS[@]}" "$DRUPAL_TI_SIMPLETEST_GROUP" )
  12. fi
  13. cd "$DRUPAL_TI_DRUPAL_DIR"
  14. { php "$DRUPAL_TI_SIMPLETEST_FILE" --php $(which php) "${ARGS[@]}" || echo "1 fails"; } | tee /tmp/simpletest-result.txt
  15. egrep -i "([1-9]+ fail[s]?)|(Fatal error)|([1-9]+ exception[s]?)" /tmp/simpletest-result.txt && exit 1
  16. exit 0