Skip to content

Commit

Permalink
Merge pull request #29423 from owncloud/stable10-drone-enabling-phpun…
Browse files Browse the repository at this point in the history
…it-sqlite

[Stable10] Moved phpunit 7.1 sqlite job from jenkins to drone
  • Loading branch information
DeepDiver1975 authored Nov 3, 2017
2 parents 093b13b + 84c8391 commit 0d2c70a
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 82 deletions.
151 changes: 80 additions & 71 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ pipeline:
matrix:
TEST_SUITE: phpunit

phpunit:
image: owncloudci/php:${PHP_VERSION}
pull: true
group: test
environment:
- PHP_VERSION=${PHP_VERSION}
- DB_TYPE=${DB_TYPE}
commands:
- ./tests/drone/test-phpunit.sh
when:
matrix:
TEST_SUITE: phpunit

services:
mariadb:
image: mariadb:10.3
Expand Down Expand Up @@ -146,73 +159,73 @@ services:

matrix:
include:
# # PHP 5.6
# - PHP_VERSION: 5.6
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
# - PHP_VERSION: 5.6
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
# - PHP_VERSION: 5.6
# DB_TYPE: mysql
# TEST_SUITE: phpunit
# - PHP_VERSION: 5.6
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# # - PHP_VERSION: 5.6
# # DB_TYPE: oracle
# # TEST_SUITE: phpunit
#
# # PHP 7.0
# - PHP_VERSION: 7.0
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.0
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.0
# DB_TYPE: mysql
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.0
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# # - PHP_VERSION: 7.0
# # DB_TYPE: oracle
# # TEST_SUITE: phpunit
#
# # PHP 7.1
# - PHP_VERSION: 7.1
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.1
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.1
# DB_TYPE: mysql
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.1
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# # - PHP_VERSION: 7.1
# # DB_TYPE: oracle
# # TEST_SUITE: phpunit
#
# # PHP 7.2
# - PHP_VERSION: 7.2
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.2
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.2
# DB_TYPE: mysql
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.2
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# # - PHP_VERSION: 7.2
# # DB_TYPE: oracle
# # TEST_SUITE: phpunit
# PHP 5.6
#- PHP_VERSION: 5.6
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
#- PHP_VERSION: 5.6
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
#- PHP_VERSION: 5.6
# DB_TYPE: mysql
# TEST_SUITE: phpunit
#- PHP_VERSION: 5.6
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# - PHP_VERSION: 5.6
# DB_TYPE: oracle
# TEST_SUITE: phpunit

# PHP 7.0
#- PHP_VERSION: 7.0
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.0
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.0
# DB_TYPE: mysql
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.0
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.0
# DB_TYPE: oracle
# TEST_SUITE: phpunit

# PHP 7.1
- PHP_VERSION: 7.1
DB_TYPE: sqlite
TEST_SUITE: phpunit
#- PHP_VERSION: 7.1
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.1
# DB_TYPE: mysql
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.1
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.1
# DB_TYPE: oracle
# TEST_SUITE: phpunit

# PHP 7.2
#- PHP_VERSION: 7.2
# DB_TYPE: sqlite
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.2
# DB_TYPE: mariadb
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.2
# DB_TYPE: mysql
# TEST_SUITE: phpunit
#- PHP_VERSION: 7.2
# DB_TYPE: postgres
# TEST_SUITE: phpunit
# - PHP_VERSION: 7.2
# DB_TYPE: oracle
# TEST_SUITE: phpunit
#
# # Integration
# - PHP_VERSION: 7.1
Expand All @@ -223,7 +236,3 @@ matrix:
- PHP_VERSION: 7.1
DB_TYPE: sqlite
TEST_SUITE: coverage

- PHP_VERSION: 7.1
DB_TYPE: sqlite
TEST_SUITE: phpunit
12 changes: 1 addition & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,14 @@ timestampedNode('SLAVE') {
checkout scm
sh '''composer install'''

stage 'PHPUnit 7.1/sqlite'
executeAndReport('tests/autotest-results-sqlite.xml') {
sh '''
export NOCOVERAGE=1
unset USEDOCKER
phpenv local 7.1
make test-php TEST_DATABASE=sqlite
'''
}

stage 'make dist'
sh '''
phpenv local 5.6
make dist
'''

stage 'phpunit/7.0/mysqlmb4'
executeAndReport('tests/autotest-results-sqlite.xml') {
executeAndReport('tests/autotest-results-mysqlmb4.xml') {
sh '''
export NOCOVERAGE=1
unset USEDOCKER
Expand Down
54 changes: 54 additions & 0 deletions tests/drone/test-phpunit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -xeo pipefail

if [[ "$(pwd)" == "$(cd "$(dirname "$0")"; pwd -P)" ]]; then
echo "Can only be executed from project root!"
exit 1
fi

if [[ -f config/config.php ]]; then
cp config/config.php config/config.backup.php
fi

rm -rf data config/config.php

if [[ "${DB_TYPE}" == "none" || "${DB_TYPE}" == "sqlite" ]]; then
./occ maintenance:install -vvv --database=sqlite --database-name=owncloud --database-table-prefix=oc_ --admin-user=admin --admin-pass=admin --data-dir=$(pwd)/data
else
case "${DB_TYPE}" in
mariadb)
wait-for-it mariadb:3306
DB=mysql
;;
mysql)
wait-for-it mysql:3306
DB=mysql
;;
postgres)
wait-for-it postgres:5432
DB=pgsql
;;
*)
echo "Unsupported database type!"
exit 1
;;
esac

./occ maintenance:install -vvv --database=${DB} --database-host=${DB_TYPE} --database-user=owncloud --database-pass=owncloud --database-name=owncloud --database-table-prefix=oc_ --admin-user=admin --admin-pass=admin --data-dir=$(pwd)/data
fi

./occ app:enable files_sharing
./occ app:enable files_trashbin
./occ app:enable files_versions
./occ app:enable provisioning_api
./occ app:enable federation
./occ app:enable federatedfilesharing

if [[ "${DB_TYPE}" == "none" ]]; then
GROUP="--exclude-group DB"
else
GROUP="--group DB"
fi

exec ./lib/composer/bin/phpunit --configuration tests/phpunit-autotest.xml ${GROUP} --coverage-clover tests/autotest-clover-${DB_TYPE}.xml --coverage-html tests/coverage-html-${DB_TYPE} --log-junit tests/autotest-results-${DB_TYPE}.xml

0 comments on commit 0d2c70a

Please sign in to comment.