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

Fix travis .... #738

Merged
merged 11 commits into from
Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 24 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ addons:
packages:
- graphviz
- gdb
firefox: latest

env:
global:
- CORE_BRANCH=master
- CORE_BRANCH=stable10
- APP_NAME=gallery
- GH_REF: github.com/owncloud/gallery.git
- secure: "cLmMqrbVZrvn2GAoVs6JWa5h70tzrAISjPZUfENjl0KYT6B84z3B94W/dGU+I2mxwvyBqEP+x83Bih2CxEflqc7tJmdqC+MM/ZZiigPX7RCjq5XHbzUpPpMbC8MFxT2K3jcFXUitfwZvNaZXJIiK3ZQJU4ayKaegLvI91x1SqH0="
- COVERAGE: ''
matrix:
- DB=sqlite;CLOUD=owncloud
- DB=mysql;CLOUD=owncloud
# - DB=sqlite COVERAGE="--coverage --coverage-xml --coverage-html"
- DB=mysql
- DB=sqlite

branches:
only:
Expand All @@ -38,14 +42,16 @@ before_cache:
- cp -r ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME/vendor ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`

before_install:
# Disable opcache on PHP 7.0 as it crashes too easily
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ]; then sed -i '/opcache.so/d' ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;"
- php --modules

# Setup Selenium
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- wget https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz
- mkdir geckodriver
- tar -xzf geckodriver-v0.19.1-linux64.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
- sh -c "if [ ! -e ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar ]; then wget -O ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar https://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.0.jar; fi;"
- java -jar ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar -port 4444 >/dev/null 2>&1 & # WARNING - Takes a long time to start up. Keep here

Expand All @@ -68,7 +74,7 @@ before_install:
#- cat /proc/sys/kernel/core_pattern

# Installing the server
- sh -c "if [ '$CLOUD' = 'owncloud' ]; then wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh; fi;"
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../core
- php occ app:enable $APP_NAME
Expand All @@ -81,12 +87,6 @@ before_script:
# Install the Imagick PHP extension
- sh -c "pecl config-set preferred_state beta; echo yes | printf "\n" | pecl install imagick;"

# Disable xdebug when we don't need coverage to speed up testing
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-rm xdebug.ini; fi;"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' != 'mysql' ]; then phpenv config-rm xdebug.ini; fi;"
# Always install the latest version of the xdebug PHP extension
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then cd build; bash xdebug_install.sh; cd ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME; fi"

# Sets up the PHP composer cache
- sh -c "if [ ! -d ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum` ]; then mkdir -p ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`; fi;"
- rm -rf ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME/vendor
Expand All @@ -105,18 +105,16 @@ script:
# Acceptance tests, using Firefox, without code coverage
- php vendor/bin/codecept run acceptance --env firefox
# Unit, integration and api tests, without code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then php vendor/bin/codecept run unit,integration,api; fi;"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' != 'mysql' ]; then php vendor/bin/codecept run unit,integration,api; fi;"

# PHP 5.6 ONLY: Unit, integration and api tests with code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php vendor/bin/codecept run unit,integration,api --coverage --coverage-xml --coverage-html; fi;"
# We can't use phpdbg only as it doesn't work with the webdriver and we can't use it for some tests only as we can't merge html reports
# - sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then phpenv config-rm xdebug.ini; phpdbg -qrr vendor/bin/codecept run unit,integration,api --coverage --coverage-xml --coverage-html; fi;"
- php vendor/bin/codecept run unit $COVERAGE
- php vendor/bin/codecept run integration $COVERAGE
# - php vendor/bin/codecept run api $COVERAGE

after_success:
# Send coverage report to Scrutinizer
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml; fi"
# coverage goees to codecov
- bash <(curl -s https://codecov.io/bash) -f tests/_output/coverage.xml

# Generate API documentation
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php vendor/bin/phpdoc run; fi"
Expand All @@ -132,9 +130,13 @@ after_failure:
matrix:
include:
- php: 5.6
env: DB=pgsql;CLOUD=owncloud
env: DB=pgsql
- php: 7.0
env: DB=sqlite;CLOUD=owncloud
env: DB=sqlite
- php: 7.0
env: DB=mysql;CLOUD=owncloud
env: DB=mysql
- php: 7.1
env: DB=sqlite CORE_BRANCH=master
allow_failures:
- php: nightly
fast_finish: true
2 changes: 1 addition & 1 deletion appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

ini_set("gd.jpeg_ignore_warning", true);

require_once __DIR__ . '/../vendor/autoload.php';
//require_once __DIR__ . '/../vendor/autoload.php';

// A production environment will not have xdebug enabled and
// a development environment should have the dev packages installed
Expand Down
3 changes: 1 addition & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
<bugs>https://github.com/owncloud/gallery/issues</bugs>
<repository type="git">https://github.com/owncloud/gallery.git</repository>
<dependencies>
<php min-version="5.4" max-version="7"/>
<owncloud min-version="10.0" max-version="10.0"/>
<owncloud min-version="10.0" max-version="10.1"/>
</dependencies>
<default_enable />
</info>
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
"homepage": "https://github.com/icewind1991"
}
],
"config" : {
"platform": {
"php": "5.6"
}
},
"support": {
"issues": "https://github.com/owncloud/gallery/issues",
"wiki": "https://github.com/owncloud/gallery/wiki",
"source": "https://github.com/owncloud/gallery"
},
"require": {
"symfony/yaml": "~2.6"
},
"require-dev": {
"guzzlehttp/guzzle": "^5.0|^6.2",
"phpunit/phpunit": "^5.5",
Expand Down
Loading