Bläddra i källkod

Attempt to install JBrowse on Travis.

Lacey Sanderson 5 år sedan
förälder
incheckning
de6d1730a1
2 ändrade filer med 20 tillägg och 0 borttagningar
  1. 8 0
      .travis.yml
  2. 12 0
      tests/tripal_jbrowse_mgmt/ApiTest.php

+ 8 - 0
.travis.yml

@@ -16,5 +16,13 @@ before_script:
 script:
   - docker run -it -d --rm --name tripal -v "$(pwd)":/modules/tripal_jbrowse statonlab/tripal3
   - sleep 30 # We pause here so postgres and apache complete booting up
+  ## Install JBrowse
+  - docker exec -it tripal bash -c 'sudo yum groupinstall "Development Tools"'
+  - docker exec -it tripal bash -c 'sudo yum install zlib-devel perl-ExtUtils-MakeMaker'
+  - docker exec -it tripal bash -c 'curl -L -O https://github.com/GMOD/jbrowse/releases/download/1.16.6-release/JBrowse-1.16.6.zip'
+  - docker exec -it tripal bash -c 'unzip JBrowse-1.16.6.zip && sudo mv JBrowse-1.16.6 /var/www/html/jbrowse && cd /var/www/html && sudo chown `whoami` jbrowse'
+  - docker exec -it tripal bash -c 'cd /var/www/html/jbrowse && ./setup.sh'
+  ## Install tripal_jbrowse package.
   - docker exec -it tripal drush pm-enable -y tripal_jbrowse tripal_jbrowse_mgmt
+  ## Run Tests.
   - docker exec -it tripal bash -c "cd /modules/tripal_jbrowse && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit"

+ 12 - 0
tests/tripal_jbrowse_mgmt/ApiTest.php

@@ -102,6 +102,18 @@ class ApiTest extends TripalTestCase {
     $one_more_time = tripal_jbrowse_mgmt_get_instance($id);
     $this->assertFalse($one_more_time);
 
+    // and delete with numeric id.
+    $success = tripal_jbrowse_mgmt_delete_instance($id);
+    $this->assertNotFalse($success, 'Unable to delete this instance.');
+    // and catch an exception during delete.
+    try {
+      $success = tripal_jbrowse_mgmt_delete_instance('FAKESTRING');
+      // If we get here without an exception then this test should fail.
+      $this->assertTrue(FALSE, "Shouldn't be able to extract instance to delete.");
+    } catch (\Exception $e) {
+        // Not worried since this is expected!
+    }
+
     putenv("TRIPAL_SUPPRESS_ERRORS");
   }
   // Associated Data Provider for testing instances.