Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the isolation tests on Travis, and the functional tests on Circle, and style checks on Shippable #3339

Merged
merged 37 commits into from
Feb 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2376a4c
Run the isolation tests on Travis, and the functional tests on Shippa…
greg-1-anderson Jan 31, 2018
568ebe8
Shippable-compatible xdebug disabling
greg-1-anderson Jan 31, 2018
3430b62
Run isolation tests on travis; don't build the SUT.
greg-1-anderson Jan 31, 2018
e46fd59
Correct path to our scripts.
greg-1-anderson Jan 31, 2018
c5c66ad
Run composer self-update before starting tests.
greg-1-anderson Jan 31, 2018
12e8762
Set up mysql on shippable.
greg-1-anderson Jan 31, 2018
a9b83ec
Use php 7.1 for composer-highest.json tests. (7.0.8 or greater needed.)
greg-1-anderson Jan 31, 2018
cc23dae
Shippable does not like php '7.1'; let's try 7.0.8.
greg-1-anderson Jan 31, 2018
122b8d1
Revert "Shippable does not like php '7.1'; let's try 7.0.8."
greg-1-anderson Feb 1, 2018
02fad44
Run fewer build variants on Shippable.
greg-1-anderson Feb 1, 2018
76303ba
Remove the matrix entirely.
greg-1-anderson Feb 1, 2018
601ae58
Reconfigure shippable to run the linter and code style checks. Try ru…
greg-1-anderson Feb 2, 2018
593d63b
Remove unused script
greg-1-anderson Feb 2, 2018
51efbf8
Touch BASH_ENV before modifying it.
greg-1-anderson Feb 2, 2018
fdd1a04
Try some other things
greg-1-anderson Feb 2, 2018
d1b322a
Do not create a mysql user; the Circle mysql image already does this.
greg-1-anderson Feb 2, 2018
eb069d0
Our work directory must be named 'drush' due to a unish sut limitation.
greg-1-anderson Feb 2, 2018
0275657
Fix paths
greg-1-anderson Feb 2, 2018
df37b82
Fix empty environment variable
greg-1-anderson Feb 2, 2018
0cfb597
Run in debug mode.
greg-1-anderson Feb 2, 2018
19a1683
Run site-install in debug mode.
greg-1-anderson Feb 2, 2018
076020d
Fiddle with mysql settings.
greg-1-anderson Feb 2, 2018
c2aae8d
Revert "Fiddle with mysql settings."
greg-1-anderson Feb 2, 2018
93d5f11
Get rid of unneeded (?) mysql env variables
greg-1-anderson Feb 2, 2018
d3b7a8a
Revert "Get rid of unneeded (?) mysql env variables"
greg-1-anderson Feb 2, 2018
dd489d9
Try using the Circle mysql database.
greg-1-anderson Feb 2, 2018
18fd60c
Merge branch 'master' into shippable
greg-1-anderson Feb 2, 2018
05a8919
Run three test processes.
greg-1-anderson Feb 2, 2018
9212abf
Merge branch 'parallel' into shippable
greg-1-anderson Feb 2, 2018
f4cef37
Set the timezone to UTC in php.ini.
greg-1-anderson Feb 2, 2018
a62e495
Fix php.ini path calculation.
greg-1-anderson Feb 2, 2018
ce1d722
Define HOME environment variables in the sandbox for tests.
greg-1-anderson Feb 2, 2018
598258c
Do not separate phpunit runs into groups.
greg-1-anderson Feb 2, 2018
4e4e591
Drop some badges into the README.
greg-1-anderson Feb 3, 2018
1b04ce7
Fix up badges on README page, add them to docs/install page.
greg-1-anderson Feb 3, 2018
3a21c80
Convert Drupal compatible versions table in install.md to html so tha…
greg-1-anderson Feb 3, 2018
39c88e6
Turn off debug mode when installing Drupal in the tests.
greg-1-anderson Feb 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
defaults: &defaults
docker:
- image: php:7.1.3-cli
working_directory: ~/drush
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
TERM: dumb
UNISH_NO_TIMEOUTS: y
UNISH_DB_URL: mysql://root:@127.0.0.1
UNISH_TMP: /tmp
PHPUNIT_ARGS: ""

version: 2
jobs:
build:
<<: *defaults
docker:
# We can probably use a standard php container here. Maybe we should make our own w/ everything pre-installed
- image: circleci/php:7.1-apache-node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this override *defaults?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I could remove the image in *defaults, since it is never used.

environment:
- MYSQL_HOST=127.0.0.1
- image: circleci/mysql:5.7.18
steps:
- checkout
- run: $HOME/drush/.circleci/setup.sh
- run: unish.sut.php
- run: unish.phpunit.php $PHPUNIT_ARGS

build_highest:
<<: *defaults
docker:
# We can probably use a standard php container here. Maybe we should make our own w/ everything pre-installed
- image: circleci/php:7.1-apache-node
environment:
- MYSQL_HOST=127.0.0.1
- COMPOSER=composer-highest.json
- image: circleci/mysql:5.7.18
steps:
- checkout
- run: $HOME/drush/.circleci/setup.sh
- run: unish.sut.php
- run: unish.phpunit.php $PHPUNIT_ARGS

build_56:
<<: *defaults
docker:
# We can probably use a standard php container here. Maybe we should make our own w/ everything pre-installed
- image: circleci/php:5.6-apache-node
environment:
- MYSQL_HOST=127.0.0.1
- image: circleci/mysql:5.7.18
steps:
- checkout
- run: $HOME/drush/.circleci/setup.sh
- run: unish.sut.php
- run: unish.phpunit.php $PHPUNIT_ARGS

workflows:
version: 2
build_test:
jobs:
- build
- build_highest
- build_56

37 changes: 37 additions & 0 deletions .circleci/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Install PHP extensions
sudo docker-php-ext-install pdo_mysql

# Install extension
sudo apt-get install -y libpng-dev

# Install PHP Extensions
sudo docker-php-ext-install gd

# Install Composer
'curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer'

# Display versions
php -v
composer --version

# Install mysql-client
sudo apt-get install mysql-client

# Configure bash environment variables
echo 'export PATH=~/.composer/vendor/bin:~/drush:$PATH' >> $BASH_ENV
echo 'export HOME=/tmp/drush-sandbox/home' >> $BASH_ENV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. My understanding is that all we need to do is assure that TEMP env variable is available. Unish does the rest.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I should have commented on this. The problem is that on Circle CI 2.0 with composer-highest.json, when Unish launches drush in a subprocess, somehow the HOME environment variable is whatever it was set to by the process that called Unish, regardless of what Unish tries to set it to. It is very odd that a) this does not seem to happen with the composer.json test (implying that the cause is in symfony/process), although b) this does not seem to happen with any test in the old Travis CI scripts. Setting HOME to what the drush subprocess expects it to be is a workaround, but this would break again if the Unish path calculation for HOME changed again in the future. 😞

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is related to the comment in CommandUnishTestCase::execute()

mkdir -p /tmp/drush-sandbox/home

# Configure php.ini
echo 'mbstring.http_input = pass' > $HOME/php.ini
echo 'mbstring.http_output = pass' >> $HOME/php.ini
echo 'memory_limit = -1' >> $HOME/php.ini
echo 'sendmail_path = /bin/true' >> $HOME/php.ini
echo 'date.timezone = "UTC"' >> $HOME/php.ini

# Copy our php.ini configuration to the active php.ini file
# We can't use `php -r 'print php_ini_loaded_file();` when there is no php.ini
PHPINI_PATH="$(php -i | grep 'Configuration File (php.ini) Path' | sed -e 's#.*=> *##')/php.ini"
cat $HOME/php.ini | sudo tee "$PHPINI_PATH" > /dev/null
30 changes: 2 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,13 @@ env:
- TEST_DIR=isolation ISOLATION_INSTALL='install --prefer-dist'
- TEST_DIR=isolation ISOLATION_INSTALL='update --prefer-dist --prefer-lowest'
- TEST_DIR=isolation ISOLATION_INSTALL='update --prefer-dist'
- PHPUNIT_ARGS=--group=base
- PHPUNIT_ARGS=--group=commands
- PHPUNIT_ARGS=--exclude-group=base,commands
- COMPOSER=composer-highest.json PHPUNIT_ARGS=--group=base
- COMPOSER=composer-highest.json PHPUNIT_ARGS=--group=commands
- COMPOSER=composer-highest.json PHPUNIT_ARGS=--exclude-group=base,commands
global:
# Github deploy
- secure: VfYokT2CchfuBRJp9/gSwfVGPfsVfkZdDVEuNWEqxww3z4vq+5aLKqoCtPL54E5EIMjhyCE3GVo+biG35Gab1KOVgUs8zD1hAUWA1FPKfMFhoPDfI3ZJC2rX2T1iWK4ZR90pBtcPzS+2OObzTYz8go0PfeSTT6eq69Na1KcNLaE=
- UNISH_NO_TIMEOUTS=y
- UNISH_DB_URL=mysql://root:@127.0.0.1
- UNISH_TMP=/tmp

matrix:
allow_failures:
- php: 7.0
env: COMPOSER=composer-highest.json
exclude:
# To save time, we will skip the functional tests on php 7.2
- php: 7.2
env: PHPUNIT_ARGS=--group=base
- php: 7.2
env: PHPUNIT_ARGS=--group=commands
- php: 7.2
env: PHPUNIT_ARGS=--exclude-group=base,commands
- php: 7.2
env: COMPOSER=composer-highest.json PHPUNIT_ARGS=--group=base
- php: 7.2
env: COMPOSER=composer-highest.json PHPUNIT_ARGS=--group=commands
- php: 7.2
env: COMPOSER=composer-highest.json PHPUNIT_ARGS=--exclude-group=base,commands


before_install:
Expand All @@ -67,17 +43,15 @@ before_install:

# Build a System-Under-Test.
install:
- if [ -n "$TEST_DIR" ] ; then composer -n --working-dir=${PWD}/$TEST_DIR $ISOLATION_INSTALL ; fi
- if [ -z "$TEST_DIR" ] ; then ${PWD}/unish.sut.php ; fi
- composer -n --working-dir=${PWD}/$TEST_DIR $ISOLATION_INSTALL

before_script:
- phpenv config-rm xdebug.ini
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`

script:
- if [ -n "$TEST_DIR" ] ; then cd $TEST_DIR && phpunit ; fi
- if [ -z "$TEST_DIR" ] ; then ${PWD}/unish.phpunit.php $PHPUNIT_ARGS; fi
- cd $TEST_DIR && phpunit

after_success:
# Publish updated API documentation on every push to the master branch
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Drush is a command line shell and Unix scripting interface for Drupal. Drush cor

[![Latest Stable Version](https://poser.pugx.org/drush/drush/v/stable.png)](https://packagist.org/packages/drush/drush) [![Total Downloads](https://poser.pugx.org/drush/drush/downloads.png)](https://packagist.org/packages/drush/drush) [![Latest Unstable Version](https://poser.pugx.org/drush/drush/v/unstable.png)](https://packagist.org/packages/drush/drush) [![License](https://poser.pugx.org/drush/drush/license.png)](https://packagist.org/packages/drush/drush) [![Documentation Status](https://readthedocs.org/projects/drush/badge/?version=master)](https://readthedocs.org/projects/drush/?badge=master)

| Code style | Isolation Tests | Functional Tests |
| :--------: | :-------------: | :--------------: |
| <img src="https://api.shippable.com/projects/5507addd5ab6cc1352a213b5/badge?branch=master"> | <img src="https://travis-ci.org/drush-ops/drush.svg?branch=master"> | <img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield"> |

Resources
-----------
* [Installing (and Upgrading)](http://docs.drush.org/en/master/install/)
Expand Down
16 changes: 0 additions & 16 deletions circle.yml

This file was deleted.

70 changes: 62 additions & 8 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,65 @@ Install a site-local Drush and Drush Launcher.

Drupal Compatibility
-----------------
Drush Version | Drush Branch | PHP | Compatible Drupal versions | Code Status
------------- | --------- | --- | -------------------------- | -----------
Drush 9 | [master](https://travis-ci.org/drush-ops/drush) | 5.6+ | D8.4+ | <img src="https://travis-ci.org/drush-ops/drush.svg?branch=master">
Drush 8 | [8.x](https://travis-ci.org/drush-ops/drush) | 5.4.5+ | D6, D7, D8.3- | <img src="https://travis-ci.org/drush-ops/drush.svg?branch=8.x">
Drush 7 | [7.x](https://travis-ci.org/drush-ops/drush) | 5.3.0+ | D6, D7 | Unsupported
Drush 6 | [6.x](https://travis-ci.org/drush-ops/drush) | 5.3.0+ | D6, D7 | Unsupported
Drush 5 | [5.x](https://travis-ci.org/drush-ops/drush) | 5.2.0+ | D6, D7 | Unsupported

<table>
<tr>
<th> Drush Version </th>
<th> Drush Branch </th>
<th> PHP </th>
<th> Compatible Drupal versions </th>
<th> Code Style </th>
<th> Isolation Tests </th>
<th> Functional Tests </th>
</tr>
<tr>
<td> Drush 9 </td>
<td> <a href="https://travis-ci.org/drush-ops/drush">master</a> </td>
<td> 5.6+ </td>
<td> D8.4+ </td>
<td align="center">
<img src="https://api.shippable.com/projects/5507addd5ab6cc1352a213b5/badge?branch=master" />
</td>
<td align="center">
<img src="https://travis-ci.org/drush-ops/drush.svg?branch=master" />
</td>
<td align="center">
<img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield" />
</td>
</tr>
<tr>
<td> Drush 8 </td>
<td> <a href="https://travis-ci.org/drush-ops/drush">8.x</a> </td>
<td> 5.4.5+ </td>
<td> D6, D7, D8.3- </td>
<td align="center">
<img src="https://circleci.com/gh/drush-ops/drush.svg?style=shield" />
</td>
<td align="center">
-
</td>
<td align="center">
<img src="https://travis-ci.org/drush-ops/drush.svg?branch=8.x" />
</td>
</tr>
<tr>
<td> Drush 7 </td>
<td> <a href="https://travis-ci.org/drush-ops/drush">7.x</a> </td>
<td> 5.3.0+ </td>
<td> D6, D7 </td>
<td colspan="3" align="center"> Unsupported </td>
</tr>
<tr>
<td> Drush 6 </td>
<td> <a href="https://travis-ci.org/drush-ops/drush">6.x</a> </td>
<td> 5.3.0+ </td>
<td> D6, D7 </td>
<td colspan="3" align="center"> Unsupported </td>
</tr>
<tr>
<td> Drush 5 </td>
<td> <a href="https://travis-ci.org/drush-ops/drush">5.x</a> </td>
<td> 5.2.0+ </td>
<td> D6, D7 </td>
<td colspan="3" align="center"> Unsupported </td>
</tr>
</table>
20 changes: 20 additions & 0 deletions shippable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: php

php:
- "7.1"

build:
ci:
# Set up php configuration
- echo 'mbstring.http_input = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'mbstring.http_output = pass' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'memory_limit = -1' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo 'sendmail_path = /bin/true' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# Disable xdebug for faster Composer operations
- rm $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
# Install / update our tools
- composer self-update
- composer install --prefer-dist --no-interaction
# Run code style and linting tools
- composer cs
- composer lint