Browse Source

Merge pull request #62 from tripal/add-code-climate

Add code climate test coverage
Lacey-Anne Sanderson 6 years ago
parent
commit
56c4145ba7
2 changed files with 19 additions and 1 deletions
  1. 9 1
      .travis.yml
  2. 10 0
      phpunit.xml

+ 9 - 1
.travis.yml

@@ -14,10 +14,18 @@ before_script:
   - docker pull statonlab/tripal3
   - wget ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.2.30/ncbi-blast-2.2.30+-x64-linux.tar.gz
   - tar xzf ncbi-blast-2.2.30+-x64-linux.tar.gz
+  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
+  - chmod +x ./cc-test-reporter
+  - ./cc-test-reporter before-build
+  - GIT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
+  - GIT_COMMIT_SHA=$TRAVIS_PULL_REQUEST_SHA
+after_script:
+  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
 script:
   - docker run -it -d --rm --name tripal -v "$(pwd)":/modules/tripal_blast statonlab/tripal3
   - sleep 30 # We pause here so postgres and apache complete booting up
  #install blast
   - docker exec -it tripal bash -c "cp /modules/tripal_blast/ncbi-blast-2.2.30+/bin/* /usr/local/bin"
   - docker exec -it tripal drush pm-enable -y blast_ui
-  - docker exec -it tripal bash -c "cd /modules/tripal_blast && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit"
+  - docker exec -it tripal yum install -y php-pecl-xdebug.x86_64
+  - docker exec -it tripal bash -c "cd /modules/tripal_blast && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit --coverage-clover ./clover.xml"

+ 10 - 0
phpunit.xml

@@ -12,4 +12,14 @@
       <directory suffix="Test.php">tests</directory>
     </testsuite>
   </testsuites>
+  <filter>
+    <whitelist addUncoveredFilesFromWhitelist="true">
+      <directory suffix=".inc">./includes</directory>
+      <directory suffix=".php">./includes</directory>
+     <directory suffix=".inc">./api</directory>
+     <directory suffix=".php">./api</directory>
+     <directory suffix=".inc">./theme</directory>
+     <directory suffix=".php">./theme</directory>
+    </whitelist>
+  </filter>
 </phpunit>