diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..e5ced01d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: php +php: + - 5.3.3 + - 5.4 +branches: + only: + - 7.x +env: + - FEDORA_VERSION="3.5" +before_install: + - $TRAVIS_BUILD_DIR/tests/travis_setup.sh + - cd $HOME/drupal-* +script: + - drush test-run --uri=http://localhost:8081 Islandora diff --git a/README.txt b/README.md similarity index 100% rename from README.txt rename to README.md diff --git a/tests/hooks.test b/tests/hooks.test index 0a667fee..bc3020f3 100644 --- a/tests/hooks.test +++ b/tests/hooks.test @@ -32,7 +32,7 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase { * @see IslandoraWebTestCase::setUp() */ public function setUp() { - parent::setUp('islandora_hooks_test', 'devel'); + parent::setUp('islandora_hooks_test'); $this->repository = $this->admin->repository; $this->purgeTestObjects(); } diff --git a/tests/travis.test_config.ini b/tests/travis.test_config.ini new file mode 100644 index 00000000..61d63713 --- /dev/null +++ b/tests/travis.test_config.ini @@ -0,0 +1,6 @@ +[fedora] +fedora_url = "http://localhost:8080/fedora" +use_drupal_filter = TRUE +drupal_filter_file = "/home/travis/islandora_tomcat/fedora/server/config/filter-drupal.xml" +admin_user = "fedoraAdmin" +admin_pass = "fedoraAdmin" diff --git a/tests/travis_setup.sh b/tests/travis_setup.sh new file mode 100755 index 00000000..936aea0d --- /dev/null +++ b/tests/travis_setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +mysql -u root -e 'create database drupal;' +mysql -u root -e "create database fedora;" +mysql -u root -e "GRANT ALL PRIVILEGES ON fedora.* To 'fedora'@'localhost' IDENTIFIED BY 'fedora';" +mysql -u root -e "GRANT ALL PRIVILEGES ON drupal.* To 'drupal'@'localhost' IDENTIFIED BY 'drupal';" +cd $HOME +git clone git://github.com/Islandora/tuque.git +git clone -b $FEDORA_VERSION git://github.com/Islandora/islandora_tomcat.git +cd islandora_tomcat +export CATALINA_HOME='.' +./bin/startup.sh +cd $HOME +pyrus channel-discover pear.drush.org +pyrus install drush/drush +phpenv rehash +drush dl --yes drupal +cd drupal-* +drush si standard --db-url=mysql://drupal:drupal@localhost/drupal --yes +drush runserver --php-cgi=$HOME/.phpenv/shims/php-cgi localhost:8081 &>/dev/null & +ln -s $TRAVIS_BUILD_DIR sites/all/modules/islandora +mv sites/all/modules/islandora/tests/travis.test_config.ini sites/all/modules/islandora/tests/test_config.ini +mkdir sites/all/libraries +ln -s $HOME/tuque sites/all/libraries/tuque +drush en --yes simpletest +drush en --user=1 --yes islandora +drush cc all +sleep 4 diff --git a/tests/web_test_case.inc b/tests/web_test_case.inc index a513de43..3651e3db 100644 --- a/tests/web_test_case.inc +++ b/tests/web_test_case.inc @@ -18,6 +18,10 @@ class IslandoraWebTestCase extends DrupalWebTestCase { // Always enable islandora. $args[] = 'islandora'; parent::setUp($args); + // Its possible test are running before class autoloading + module_load_include('inc', 'islandora', 'includes/tuque'); + module_load_include('inc', 'islandora', 'includes/tuque_wrapper'); + $this->configuration = $this->getTestConfiguration(); if ($this->configuration['use_drupal_filter']) { $this->backUpDrupalFilter();