Browse Source

Merge pull request #19 from statonlab/improve-travis

Install drupal and tripal on travis directly
Abdullah Almsaeed 6 years ago
parent
commit
385352e90e
5 changed files with 311 additions and 32 deletions
  1. 2 1
      .gitignore
  2. 66 22
      .travis.yml
  3. 2 2
      composer.json
  4. 239 7
      composer.lock
  5. 2 0
      tripal_chado/api/modules/tripal_chado.cv.api.inc

+ 2 - 1
.gitignore

@@ -1,3 +1,4 @@
 .DS_Store
-vendor/*
+.idea/
+vendor/
 tests/.env

+ 66 - 22
.travis.yml

@@ -2,37 +2,81 @@ language: php
 
 services:
   - docker
+  - postgres
 
 sudo: required
 
+php:
+  - 5.6
+  - 7.0
+  - 7.1
+
+env:
+  - BASE_URL="http://localhost:8080"
+
+install:
+  - composer global require drush/drush:8
+
 before_script:
-  - docker pull statonlab/drupal7
   - docker pull statonlab/tripal2
-  - docker pull statonlab/tripal3
+  - psql -c "create database test_db encoding 'utf-8';" -U postgres
+  - psql -c "alter role postgres with password 'dbpass';" -U postgres
+  - cd ..
+
+  # Set additional environment variables
+  - export PATH="$HOME/.config/composer/vendor/bin:$PATH"
+  - export DRUPAL_ROOT="$(pwd)/drupal"
+
+  # Download and install Drupal
+  - drush dl drupal-7 -y
+  - mv drupal-7* drupal
+  - cd drupal
+  - drush si -y --db-url='pgsql://postgres:dbpass@localhost:5432/test_db'
+                --account-name='admin'
+                --account-pass='admin_pass'
+                --site-mail='admin@example.com'
+                --site-name='Tripal 3'
+
+  # Download Dependencies
+  - drush dl -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
+                ds, link, entity, libraries, redirect, token, uuid, jquery_update, views, webform
+
+  # Enable dependencies
+  - drush en -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
+              ds, link, entity, libraries, redirect, token uuid, jquery_update, views, webform
+
+  # Run the drush server
+  - drush runserver localhost:8080 &
 
 script:
-  # Set branch name
-  - export REPO=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_REPO_SLUG; else echo $TRAVIS_PULL_REQUEST_SLUG; fi)
-  - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
-  #  Travis does a shallow clone and we need a full clone to test Tripal v2 to v3 upgrade
-  - cd .. && rm -rf tripal && git clone https://github.com/$REPO.git tripal && cd tripal
-  - git checkout $BRANCH
-  # Test tripal 3 installation
-  - docker run -it -d --rm --name tripal3 -v "$(pwd)":/modules/tripal statonlab/drupal7
-  - sleep 15
-  - docker exec -it tripal3 drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
+  # Link our repo to the modules directory
+  - cd sites/all/modules
+  - mv ../../../../tripal tripal
+  - cd ../../../
+
+  # Run a docker container with tripal 2 pre-installed
+  - docker run -it -d --rm --name tripal2 -v "$(pwd)/tripal":/modules/tripal statonlab/tripal2
+
+  # Apply patches
+  - wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch
+  - patch -p1 < drupal.pgsql-bytea.27.patch
+  - cd sites/all/modules/views
+  - patch -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch
+  - cd ../tripal
+
+  # Install Tripal
+  - drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
+  - drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
+  - drush trp-run-jobs --username=admin
+
   # Prepare Chado
-  - docker exec -it tripal3 drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
-  - docker exec -it tripal3 drush trp-run-jobs --username=admin
-  # Prepare Drupal
-  - docker exec -it tripal3 drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
-  - docker exec -it tripal3 drush trp-run-jobs --username=admin
+  - drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
+  - drush trp-run-jobs --username=admin
+
   # Run PHPUnit tests
-  - docker exec -it tripal3 bash -c "cd /modules/tripal && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit"
+  - composer update
+  - ./vendor/bin/phpunit
+
   # Test Tripal v2 to v3 upgrade steps
-  - docker run -it -d --rm --name tripal2 -v "$(pwd)":/modules/tripal statonlab/tripal2
-  - sleep 15
-  - docker exec -it tripal2 drush en -y tripal_core
   - docker exec -it tripal2 drush pm-disable tripal_core -y
-  - git checkout $BRANCH
   - docker exec -it tripal2 drush en -y tripal

+ 2 - 2
composer.json

@@ -1,6 +1,6 @@
 {
   "require-dev": {
-    "phpunit/phpunit": "^7",
-    "statonlab/tripal-test-suite": "^0.3.0"
+    "doctrine/instantiator": "1.0.*",
+    "statonlab/tripal-test-suite": "~1.0.0"
   }
 }

+ 239 - 7
composer.lock

@@ -1,10 +1,10 @@
 {
     "_readme": [
         "This file locks the dependencies of your project to a known state",
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "9a8fda4f357b1982844a9b7df2d3b1ba",
+    "content-hash": "686eb1e397fb7cea824cd9c910a6ab5c",
     "packages": [],
     "packages-dev": [
         {
@@ -111,6 +111,187 @@
             ],
             "time": "2017-08-15T16:48:10+00:00"
         },
+        {
+            "name": "guzzlehttp/guzzle",
+            "version": "6.3.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/guzzle.git",
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/promises": "^1.0",
+                "guzzlehttp/psr7": "^1.4",
+                "php": ">=5.5"
+            },
+            "require-dev": {
+                "ext-curl": "*",
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
+                "psr/log": "^1.0"
+            },
+            "suggest": {
+                "psr/log": "Required for using the Log middleware"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "6.3-dev"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/functions_include.php"
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Guzzle is a PHP HTTP client library",
+            "homepage": "http://guzzlephp.org/",
+            "keywords": [
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "rest",
+                "web service"
+            ],
+            "time": "2018-04-22T15:46:56+00:00"
+        },
+        {
+            "name": "guzzlehttp/promises",
+            "version": "v1.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/promises.git",
+                "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+                "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.5.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Promise\\": "src/"
+                },
+                "files": [
+                    "src/functions_include.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                }
+            ],
+            "description": "Guzzle promises library",
+            "keywords": [
+                "promise"
+            ],
+            "time": "2016-12-20T10:07:11+00:00"
+        },
+        {
+            "name": "guzzlehttp/psr7",
+            "version": "1.4.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/psr7.git",
+                "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
+                "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0",
+                "psr/http-message": "~1.0"
+            },
+            "provide": {
+                "psr/http-message-implementation": "1.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.4-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Psr7\\": "src/"
+                },
+                "files": [
+                    "src/functions_include.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Tobias Schultze",
+                    "homepage": "https://github.com/Tobion"
+                }
+            ],
+            "description": "PSR-7 message implementation that also provides common utility methods",
+            "keywords": [
+                "http",
+                "message",
+                "request",
+                "response",
+                "stream",
+                "uri",
+                "url"
+            ],
+            "time": "2017-03-20T17:10:46+00:00"
+        },
         {
             "name": "myclabs/deep-copy",
             "version": "1.7.0",
@@ -858,6 +1039,56 @@
             ],
             "time": "2018-04-11T04:50:36+00:00"
         },
+        {
+            "name": "psr/http-message",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-message.git",
+                "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
+                "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Message\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for HTTP messages",
+            "homepage": "https://github.com/php-fig/http-message",
+            "keywords": [
+                "http",
+                "http-message",
+                "psr",
+                "psr-7",
+                "request",
+                "response"
+            ],
+            "time": "2016-08-06T14:39:51+00:00"
+        },
         {
             "name": "sebastian/code-unit-reverse-lookup",
             "version": "1.0.1",
@@ -1423,20 +1654,21 @@
         },
         {
             "name": "statonlab/tripal-test-suite",
-            "version": "0.3.0",
+            "version": "1.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/statonlab/TripalTestSuite.git",
-                "reference": "260d5bf0fc68adff44354ce1dd66598daf6d61db"
+                "reference": "f70eb463c90d63fc1fbef8c568638bc460ceeda4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/statonlab/TripalTestSuite/zipball/260d5bf0fc68adff44354ce1dd66598daf6d61db",
-                "reference": "260d5bf0fc68adff44354ce1dd66598daf6d61db",
+                "url": "https://api.github.com/repos/statonlab/TripalTestSuite/zipball/f70eb463c90d63fc1fbef8c568638bc460ceeda4",
+                "reference": "f70eb463c90d63fc1fbef8c568638bc460ceeda4",
                 "shasum": ""
             },
             "require": {
                 "fzaninotto/faker": "^1.7",
+                "guzzlehttp/guzzle": "^6.3",
                 "phpunit/phpunit": "^5 || ^6 || ^7.0",
                 "symfony/console": "^3 || ^4.0"
             },
@@ -1466,7 +1698,7 @@
                     "email": "bcondon@utk.edu"
                 }
             ],
-            "time": "2018-04-18T15:56:58+00:00"
+            "time": "2018-05-01T14:41:06+00:00"
         },
         {
             "name": "symfony/console",

+ 2 - 0
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -803,6 +803,8 @@ function tripal_update_cvtermpath_loop_increment(
         $matched_rows, $possible_start_of_loop, $no_loop_skip_test);
     }
   }
+
+
 }
 
 /**