From 704689cd1bc15e8f0ce88a30f2244dfdd57abe96 Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Fri, 16 Oct 2020 12:49:25 -0500 Subject: [PATCH] Try using phpunit --- .scripts/run-tests.sh | 7 +--- .travis.yml | 9 ++--- phpunit.xml | 88 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 phpunit.xml diff --git a/.scripts/run-tests.sh b/.scripts/run-tests.sh index be50beae..a8f81682 100755 --- a/.scripts/run-tests.sh +++ b/.scripts/run-tests.sh @@ -2,11 +2,6 @@ # Wrapper for the test executing function so we only have to change it in one place. # The module name gets passed in as a command line arg. -if [ "$1" == "unit" ]; then - TYPE="--types \"PHPUnit-Unit,PHPUnit-Kernel,Simpletest\"" -elif [ "$1" == "functional" ]; then - TYPE="--types \"PHPUnit-FunctionalJavascript,PHPUnit-Functional\"" -fi -COMMAND="php core/scripts/run-tests.sh --suppress-deprecations --concurrency 2 --url http://127.0.0.1:8282 --verbose --php `which php` $TYPE --module \"$2\"" +COMMAND="$DRUPAL_DIR/vendor/bin/phpunit -c $PHPUNIT_FILE --verbose --testsuite "$1" echo $COMMAND $COMMAND diff --git a/.travis.yml b/.travis.yml index 22309235..421fafc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ php: env: - TESTSUITE=unit - TESTSUITE=functional + - TESTSUITE=function-javascript matrix: fast_finish: true @@ -26,6 +27,7 @@ before_install: - export SCRIPT_DIR=$HOME/islandora/.scripts - export DRUPAL_DIR=/opt/drupal - export CUSTOM_SCRIPT_DIR=$TRAVIS_BUILD_DIR/.scripts + - export PHPUNIT_FILE=$TRAVIS_BUILD_DIR/phpunit.xml - export COMPOSER_PATH="/home/travis/.phpenv/versions/$TRAVIS_PHP_VERSION/bin/composer" - phpenv config-rm xdebug.ini @@ -43,12 +45,7 @@ install: script: - $SCRIPT_DIR/travis_scripts.sh - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora" - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora_breadcrumbs" - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora_image" - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora_audio" - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora_video" - - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" "islandora_text_extraction" + - $CUSTOM_SCRIPT_DIR/run-tests.sh "$TESTSUITE" notifications: slack: diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..26668fa4 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../modules/contrib/islandora/tests/src/Kernel + ../modules/contrib/islandora/modules/*/tests/src/Kernel + + + ../modules/contrib/islandora/tests/src/Functional + ../modules/contrib/isladnora/modules/*/tests/src/Functional + + + ../modules/contrib/islandora/tests/src/FunctionalJavascript + ../modules/contrib/islandora/modules/*/tests/src/FunctionalJavascript + + + + + + + + + + + + + + + ./includes + ./lib + + ./modules + + ./modules/*/src/Tests + ./modules/*/tests + + ../modules + + ../modules/*/src/Tests + ../modules/*/tests + ../modules/*/*/src/Tests + ../modules/*/*/tests + + ../sites + + +