-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'enable_travis' of github.com:mccrodp/message_private in…
…to feature/access-control-handler
- Loading branch information
Showing
19 changed files
with
375 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/composer.lock | ||
/vendor/ | ||
|
||
.DS_Store | ||
.idea | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,71 @@ | ||
language: php | ||
sudo: true | ||
|
||
php: | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
|
||
matrix: | ||
allow_failures: | ||
- php: 7.0 | ||
- 5.6 | ||
- 7.0 | ||
#- 7.1 | ||
#- 7.2 | ||
|
||
env: | ||
global: | ||
- MESSAGE_MODULE='message' | ||
- MESSAGE_REPO='https://github.com/Gizra/message.git' | ||
- MESSAGE_VERSION='8.x-1.x' | ||
- MESSAGE_NOTIFY_MODULE='message_notify' | ||
- MESSAGE_NOTIFY_REPO='https://github.com/Gizra/message_notify.git' | ||
- MESSAGE_NOTIFY_VERSION='8.x-1.x' | ||
- MODULE_NAME='message_private' | ||
- MODULE_TEST_GROUP='Message Private' | ||
- DRUPAL_REPO='git://drupalcode.org/project/drupal.git' | ||
- DRUPAL_VERSION='8.0.5' | ||
- PHPCS_VERSION='2.0.*@dev' | ||
- CODER_VERSION='8.2.0-beta1' | ||
|
||
before_install: | ||
# Ensure we have the latest sources. | ||
- sudo apt-get -y update | ||
|
||
# Composer. | ||
- sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc | ||
- source $HOME/.bashrc | ||
# - composer self-update | ||
|
||
# Drush. | ||
- composer global require "youngj/httpserver:dev-master#41dd2b7" | ||
- composer global require drush/drush:~8 | ||
|
||
# Codesniffer. | ||
- composer global require squizlabs/php_codesniffer:$PHPCS_VERSION | ||
|
||
# Coder. | ||
- composer global require drupal/coder:$CODER_VERSION | ||
- ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/ | ||
- COMPOSER_MEMORY_LIMIT=2G | ||
- DRUPAL_DIR=${TRAVIS_BUILD_DIR}/../build | ||
- MODULES_DIR=${DRUPAL_DIR}/modules/contrib | ||
- MODULE_DIR=${MODULES_DIR}/message_private | ||
matrix: | ||
- TEST_SUITE=PHP_CodeSniffer | ||
- TEST_SUITE=8.5.x | ||
# - TEST_SUITE=8.6.x | ||
# - TEST_SUITE=8.7.x | ||
|
||
# Only run the coding standards check once. | ||
matrix: | ||
exclude: | ||
- php: 5.6 | ||
env: TEST_SUITE=PHP_CodeSniffer | ||
# - php: 7.0 | ||
# env: TEST_SUITE=PHP_CodeSniffer | ||
# - php: 7.1 | ||
# env: TEST_SUITE=PHP_CodeSniffer | ||
|
||
mysql: | ||
database: message_private | ||
username: root | ||
encoding: utf8 | ||
|
||
# Ensure the PHP environment is ready. | ||
- phpenv rehash | ||
before_script: | ||
# Remove Xdebug as we don't need it and it causes "PHP Fatal error: Maximum | ||
# function nesting level of '256' reached." | ||
# We also don't care if that file exists or not on PHP 7. | ||
- phpenv config-rm xdebug.ini || true | ||
|
||
install: | ||
# Basic PHP packages. | ||
- sudo apt-get install -y --force-yes php5-cgi php5-mysql | ||
# Require the version of Drupal 8 core under test. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer require --no-update drupal/core:$TEST_SUITE webflo/drupal-core-require-dev:$TEST_SUITE | ||
|
||
# Move the checked out module into the correct structure. | ||
- mkdir /tmp/$MODULE_NAME | ||
- mv * /tmp/$MODULE_NAME/ | ||
- git clone --branch $DRUPAL_VERSION $DRUPAL_REPO drupal --depth 1 | ||
- mv /tmp/$MODULE_NAME drupal/modules/ | ||
- cd drupal/modules | ||
- git clone --branch $MESSAGE_VERSION $MESSAGE_REPO | ||
- git clone --branch $MESSAGE_NOTIFY_VERSION $MESSAGE_NOTIFY_REPO | ||
- cd ../ | ||
# PHPUnit 6 is required when running tests on PHP 7.x. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || test ${TRAVIS_PHP_VERSION:0:3} == "5.6" || composer require --no-update --update-with-dependencies --dev phpunit/phpunit:~6 | ||
|
||
before_script: | ||
# Install dependencies. | ||
- composer install | ||
|
||
# Install Composer dependencies. | ||
- composer self-update && composer install | ||
# Create database. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || mysql -e 'CREATE DATABASE message_private' | ||
|
||
# This fixes a fail when install Drupal. | ||
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
# Symlink the module into the Drupal site. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || mkdir -p $MODULES_DIR | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || ln -s $TRAVIS_BUILD_DIR $MODULE_DIR | ||
|
||
# Mysql might time out for long tests, increase the wait timeout. | ||
- mysql -e 'SET @@GLOBAL.wait_timeout=1200' | ||
# Start a web server on port 8888 in the background. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || nohup php -S localhost:8888 --docroot $DRUPAL_DIR > /dev/null 2>&1 & | ||
|
||
# Install Drupal and enable the required modules (including this one). | ||
- mysql -e 'create database drupal;' | ||
- cd $TRAVIS_BUILD_DIR/drupal && drush --yes site-install testing --db-url="mysql://[email protected]/drupal" | ||
- cd $TRAVIS_BUILD_DIR/drupal && drush --yes en $MODULE_NAME | ||
- cd $TRAVIS_BUILD_DIR/drupal && drush --yes en simpletest | ||
# Wait until the web server is responding. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || until curl -s localhost:8888; do true; done > /dev/null | ||
|
||
# Start a web server. | ||
- drush runserver 127.0.0.1:8080 & | ||
- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done | ||
# Export web server URL for browser tests. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || export SIMPLETEST_BASE_URL=http://localhost:8888 | ||
|
||
script: | ||
# Run code sniffer. | ||
- phpcs --report=full --standard=Drupal $TRAVIS_BUILD_DIR/drupal/modules/$MODULE_NAME | ||
# Export database variable for kernel tests. | ||
- test ${TEST_SUITE} == "PHP_CodeSniffer" || export SIMPLETEST_DB=mysql://root:@127.0.0.1/message_private | ||
|
||
# Run the tests | ||
- php $TRAVIS_BUILD_DIR/drupal/core/scripts/run-tests.sh --verbose --color --php `which php` --url http://127.0.0.1:8080 "$MODULE_TEST_GROUP" | tee /tmp/test.txt; TEST_EXIT=${PIPESTATUS[0]}; echo $TEST_EXIT | ||
# Check if we had fails in the run-tests.sh script | ||
# Exit with the inverted value, because if there are no fails found, it will | ||
# exit with 1 and for us that is a good thing so invert it to 0. Travis has | ||
# some issues with the exclamation mark in front so we have to fiddle a bit. | ||
# Also make the grep case insensitive and fail on run-tests.sh regular fails | ||
# as well on fatal errors. | ||
- TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(PHP Fatal error)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$?; echo $TEST_OUTPUT | ||
# Exit the build | ||
- if [ $TEST_EXIT -eq 0 ] && [ $TEST_OUTPUT -eq 0 ]; then exit 0; else exit 1; fi | ||
script: ${TRAVIS_BUILD_DIR}/scripts/travis-ci/run-tests.sh ${TEST_SUITE} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,35 @@ | ||
{ | ||
"name": "drupal/message_private", | ||
"description": "Message Private", | ||
"description": "Private messaging module based on Message stack.", | ||
"type": "drupal-module", | ||
"license": "GPL-2.0+", | ||
"minimum-stability": "dev", | ||
"require": {} | ||
"prefer-stable": true, | ||
"homepage": "https://www.drupal.org/project/message_private", | ||
"require": { | ||
"php": "^5.6|^7.0", | ||
"drupal/core": "^8.6", | ||
"drupal/message": "^1.0", | ||
"drupal/message_notify": "^1.0", | ||
"drupal/message_ui": "^1.0" | ||
}, | ||
"require-dev": { | ||
"composer/installers": "^1.2", | ||
"drupal-composer/drupal-scaffold": "^2.5", | ||
"drupal/coder": "^8.3.1", | ||
"webflo/drupal-core-require-dev": "~8.5" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://packages.drupal.org/8" | ||
} | ||
], | ||
"extra": { | ||
"installer-paths": { | ||
"../build/core": ["type:drupal-core"], | ||
"../build/modules/contrib/{$name}": ["type:drupal-module"], | ||
"../build/themes/contrib/{$name}": ["type:drupal-theme"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.