mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-18 15:06:17 -05:00
Update testing similar to director
This commit is contained in:
parent
00e2f1886a
commit
3665445898
4 changed files with 88 additions and 13 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -1,4 +1,11 @@
|
|||
## editors
|
||||
.idea/
|
||||
.*.sw[op]
|
||||
|
||||
## packaging
|
||||
/debian
|
||||
|
||||
## test
|
||||
/vendor
|
||||
/build
|
||||
/coverage
|
||||
|
|
|
|||
22
.travis.yml
22
.travis.yml
|
|
@ -9,27 +9,23 @@ php:
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- php: '5.3'
|
||||
dist: precise
|
||||
sudo: required
|
||||
- php: '5.3'
|
||||
dist: precise
|
||||
sudo: required
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- vendor
|
||||
|
||||
env:
|
||||
- ICINGAWEB_VERSION=2.4.1 PHPCS_VERSION=2.9.1
|
||||
- ICINGAWEB_VERSION=2.5.1
|
||||
|
||||
before_script:
|
||||
- test -d vendor || mkdir vendor
|
||||
# TODO: Re-enable after dropping 5.3 support:
|
||||
# - curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
|
||||
- test -e vendor/phpcs-${PHPCS_VERSION}.phar || wget -O vendor/phpcs-${PHPCS_VERSION}.phar https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${PHPCS_VERSION}/phpcs.phar
|
||||
- test -e vendor/v${ICINGAWEB_VERSION}.tar.gz || (cd vendor/ && wget https://github.com/Icinga/icingaweb2/archive/v${ICINGAWEB_VERSION}.tar.gz)
|
||||
- test -d vendor/icingaweb2-${ICINGAWEB_VERSION} || (cd vendor && tar xfz v${ICINGAWEB_VERSION}.tar.gz)
|
||||
- ln -s vendor/icingaweb2-${ICINGAWEB_VERSION}/library/Icinga
|
||||
- ln -s vendor/icingaweb2-${ICINGAWEB_VERSION}/library/vendor/Zend
|
||||
- ./test/setup_vendor.sh
|
||||
|
||||
script:
|
||||
- php vendor/phpcs-${PHPCS_VERSION}.phar
|
||||
- php vendor/phpcs.phar
|
||||
- phpunit --testdox || phpunit --verbose
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ call_user_func(function () {
|
|||
if (! class_exists('PHPUnit_Framework_TestCase')) {
|
||||
require_once __DIR__ . '/phpunit-compat.php';
|
||||
}
|
||||
|
||||
$include_path = $basedir . '/vendor' . PATH_SEPARATOR . ini_get('include_path');
|
||||
ini_set('include_path', $include_path);
|
||||
|
||||
require_once $basedir . '/library/Businessprocess/Test/Bootstrap.php';
|
||||
Bootstrap::cli($basedir);
|
||||
});
|
||||
|
|
|
|||
68
test/setup_vendor.sh
Executable file
68
test/setup_vendor.sh
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
MODULE_HOME=${MODULE_HOME:="$(dirname "$(readlink -f $(dirname "$0"))")"}
|
||||
PHP_VERSION="$(php -r 'echo phpversion();')"
|
||||
|
||||
# see also .travis.yml
|
||||
ICINGAWEB_VERSION=${ICINGAWEB_VERSION:=2.5.1}
|
||||
ICINGAWEB_GITREF=${ICINGAWEB_GITREF:=}
|
||||
|
||||
PHPCS_VERSION=${PHPCS_VERSION:=2.9.1}
|
||||
|
||||
if [ "$PHP_VERSION" '<' 5.6.0 ]; then
|
||||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=4.8}
|
||||
else
|
||||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7}
|
||||
fi
|
||||
|
||||
cd ${MODULE_HOME}
|
||||
|
||||
test -d vendor || mkdir vendor
|
||||
cd vendor/
|
||||
|
||||
# icingaweb2
|
||||
if [ -n "$ICINGAWEB_GITREF" ]; then
|
||||
icingaweb_path="icingaweb2"
|
||||
test ! -L "$icingaweb_path" || rm "$icingaweb_path"
|
||||
|
||||
if [ ! -d "$icingaweb_path" ]; then
|
||||
git clone https://github.com/Icinga/icingaweb2.git "$icingaweb_path"
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
cd "$icingaweb_path"
|
||||
git fetch -p
|
||||
git checkout -f "$ICINGAWEB_GITREF"
|
||||
)
|
||||
else
|
||||
icingaweb_path="icingaweb2-${ICINGAWEB_VERSION}"
|
||||
if [ ! -e "${icingaweb_path}".tar.gz ]; then
|
||||
wget -O "${icingaweb_path}".tar.gz https://github.com/Icinga/icingaweb2/archive/v"${ICINGAWEB_VERSION}".tar.gz
|
||||
fi
|
||||
if [ ! -d "${icingaweb_path}" ]; then
|
||||
tar xf "${icingaweb_path}".tar.gz
|
||||
fi
|
||||
|
||||
rm -f icingaweb2
|
||||
ln -svf "${icingaweb_path}" icingaweb2
|
||||
fi
|
||||
ln -svf "${icingaweb_path}"/library/Icinga
|
||||
ln -svf "${icingaweb_path}"/library/vendor/Zend
|
||||
|
||||
# phpunit
|
||||
phpunit_path="phpunit-${PHPUNIT_VERSION}"
|
||||
if [ ! -e "${phpunit_path}".phar ]; then
|
||||
wget -O "${phpunit_path}".phar https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar
|
||||
fi
|
||||
ln -svf "${phpunit_path}".phar phpunit.phar
|
||||
|
||||
# phpcs
|
||||
phpcs_path="phpcs-${PHPCS_VERSION}"
|
||||
if [ ! -e "${phpcs_path}".phar ]; then
|
||||
wget -O "${phpcs_path}".phar \
|
||||
https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${PHPCS_VERSION}/phpcs.phar
|
||||
fi
|
||||
ln -svf "${phpcs_path}".phar phpcs.phar
|
||||
Loading…
Reference in a new issue