Skip to content
Snippets Groups Projects
Commit 8d90460b authored by Jaesin Mulenex's avatar Jaesin Mulenex
Browse files

Merge pull request #1 from Jaesin/travis

[Testing] Issue #2692535: Add travis testing.
parents 4d1318a3 685412e3
Branches
Tags
No related merge requests found
language: php
sudo: false
php:
- 5.5.9
- 5.6
- 7
- hhvm
env:
global:
# The name of the moduel to run tests on (this module).
- DRUPAL_MODULE=json_field
# Additional modules to download (using drush).
- ADDITIONAL_MODULES=''
# Database variable for kernel tests.
- SIMPLETEST_DB="mysql://root:@127.0.0.1/drupal"
# Web server URL for browser tests.
- SIMPLETEST_BASE_URL="http://localhost:8888"
matrix:
allow_failures:
# We cannot use hhvm-nightly since that does not work in Travis CI's old
# Ubuntu 12.04.
- php: hhvm
# Don't wait for the allowed failures to build.
fast_finish: true
services:
- mysql
install:
# Add composer's global bin directory to the path
# See: https://github.com/drush-ops/drush#install---composer
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# Install drush globally
- composer global require drush/drush
before_script:
# Remove Xdebug as we don't need it and it causes
- phpenv config-rm xdebug.ini || true
# Create database.
- mysql -e 'CREATE DATABASE IF NOT EXISTS drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' -uroot
# Set the drupal root folder location.
- export DRUPAL_ROOT=$TRAVIS_BUILD_DIR/../drupal
# Download Drupal 8 core.
- drush -y dl drupal --destination=$DRUPAL_ROOT/../ --drupal-project-rename=drupal
# Reference the module in build site.
- ln -s $TRAVIS_BUILD_DIR $DRUPAL_ROOT/modules/$DRUPAL_MODULE
# We need to run simpletest so install drupal and enable simpletest.
- drush -y --root=$DRUPAL_ROOT site-install --db-url=$SIMPLETEST_DB
- drush -y --root=$DRUPAL_ROOT en simpletest
# Download and enable any additional module.
- if [ ! -z "$ADDITIONAL_MODULES" ]; then drush -y --root=$DRUPAL_ROOT dl $ADDITIONAL_MODULES; fi
# Start a web server on port 8888, run in the background and wait.
- nohup php -S localhost:8888 > /dev/null 2>&1 &
script:
# Run the PHPUnit tests which also include the kernel tests.
- $DRUPAL_ROOT/vendor/phpunit/phpunit/phpunit -c $DRUPAL_ROOT/core/phpunit.xml.dist --verbose $DRUPAL_ROOT/modules/$DRUPAL_MODULE
# Run web tests.
- cd $DRUPAL_ROOT && php ./core/scripts/run-tests.sh --php $(which php) --verbose --url $SIMPLETEST_BASE_URL --module $DRUPAL_MODULE
[![Build Status](https://travis-ci.org/Jaesin/json_field.svg?branch=8.x-1.x)](https://travis-ci.org/Jaesin/json_field)
# Installation
You need ideally the jsonview client library from
https://github.com/yesmeck/jquery-jsonview/releases. Put the latest release into
our sites/all/libraries folder so the folder structure looks like the following:
```
- libraries
--- jsonview
----- dist
------- jquery.jsonview.css
------- jquery.jsonview.js
\- jsonview
\- dist
\- jquery.jsonview.css
\- jquery.jsonview.js
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment