From 174cd0f0c9801d44be925692424f6868defce605 Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Thu, 22 Oct 2020 09:27:24 -0500 Subject: [PATCH] Switch to using PHPUnit directly and splitting into testsuites. (#805) --- .travis.yml | 20 +++-- phpunit.xml | 86 +++++++++++++++++++ .../IslandoraFunctionalTestBase.php | 7 +- 3 files changed, 103 insertions(+), 10 deletions(-) create mode 100644 phpunit.xml diff --git a/.travis.yml b/.travis.yml index b0dcc8ce..fc5a9fcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ php: - 7.2 - 7.3 +env: + - TESTSUITE=kernel + - TESTSUITE=functional + - TESTSUITE=functional-javascript + matrix: fast_finish: true allow_failures: @@ -20,7 +25,9 @@ branches: before_install: - export SCRIPT_DIR=$HOME/islandora/.scripts - export DRUPAL_DIR=/opt/drupal + - 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 install: - git clone https://github.com/Islandora/documentation.git $HOME/islandora @@ -33,18 +40,13 @@ install: - cd web - drush --uri=127.0.0.1:8282 en -y islandora_audio islandora_breadcrumbs islandora_iiif islandora_image islandora_video islandora_text_extraction_defaults - drush --uri=127.0.0.1:8282 fim -y islandora_core_feature,islandora_text_extraction_defaults + - mkdir -p $DRUPAL_DIR/web/sites/simpletest/browser_output + - cp $PHPUNIT_FILE $DRUPAL_DIR/web/core/phpunit.xml script: - $SCRIPT_DIR/travis_scripts.sh - - $SCRIPT_DIR/run-tests.sh "islandora" - - $SCRIPT_DIR/run-tests.sh "islandora_breadcrumbs" - - $SCRIPT_DIR/run-tests.sh "islandora_image" - - $SCRIPT_DIR/run-tests.sh "islandora_audio" - - $SCRIPT_DIR/run-tests.sh "islandora_video" - - $SCRIPT_DIR/run-tests.sh "islandora_text_extraction" - -after_success: - - bash <(curl -s https://codecov.io/bash) + - cd $DRUPAL_DIR/web/core + - $DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "$TESTSUITE" notifications: slack: diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..c9f04458 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../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 + + + diff --git a/tests/src/Functional/IslandoraFunctionalTestBase.php b/tests/src/Functional/IslandoraFunctionalTestBase.php index 8cee2ba7..0b942eb8 100644 --- a/tests/src/Functional/IslandoraFunctionalTestBase.php +++ b/tests/src/Functional/IslandoraFunctionalTestBase.php @@ -23,7 +23,12 @@ class IslandoraFunctionalTestBase extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['context_ui', 'field_ui', 'islandora']; + protected static $modules = [ + 'context_ui', + 'field_ui', + 'islandora', + 'menu_link_content', + ]; /** * {@inheritdoc}