mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
testing: Move vendor installation to script
And all downloaded data to `vendor/`
This commit is contained in:
parent
727cc22bc4
commit
bd5f9d7dea
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,6 +2,5 @@
|
|||||||
/.idea/
|
/.idea/
|
||||||
.*.sw[op]
|
.*.sw[op]
|
||||||
|
|
||||||
## PHP / composer
|
## PHP vendor artifacts
|
||||||
/vendor/
|
/vendor/
|
||||||
composer.lock
|
|
||||||
|
12
.travis.yml
12
.travis.yml
@ -26,15 +26,9 @@ env:
|
|||||||
DIRECTOR_TESTDB_USER="director_test"
|
DIRECTOR_TESTDB_USER="director_test"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# TODO: Re-enable after dropping 5.3 support:
|
- ./test/setup_vendor.sh
|
||||||
# - curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
|
|
||||||
- curl -OL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.1/phpcs.phar
|
|
||||||
- wget https://github.com/Icinga/icingaweb2/archive/v2.4.0.tar.gz
|
|
||||||
- tar xfz v2.4.0.tar.gz
|
|
||||||
- ln -s icingaweb2-2.4.0/library/Icinga
|
|
||||||
- ln -s icingaweb2-2.4.0/library/vendor/Zend
|
|
||||||
- ./test/travis-prepare.sh
|
- ./test/travis-prepare.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- php phpcs.phar --report-width=auto --report-full --report-gitblame --report-summary -p --standard=PSR2 --extensions=php --encoding=utf-8 -w -s library/Director/ library/vendor/ipl/ application/ *.php test
|
- php vendor/phpcs.phar --report-width=auto --report-full --report-gitblame --report-summary -p --standard=PSR2 --extensions=php --encoding=utf-8 -w -s library/Director/ library/vendor/ipl/ application/ *.php test
|
||||||
- phpunit --testdox || phpunit --verbose
|
- php vendor/phpunit.phar --testdox || phpunit --verbose
|
||||||
|
@ -7,6 +7,10 @@ call_user_func(function () {
|
|||||||
if (! class_exists('PHPUnit_Framework_TestCase')) {
|
if (! class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
require_once __DIR__ . '/phpunit-compat.php';
|
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/Director/Test/Bootstrap.php';
|
require_once $basedir . '/library/Director/Test/Bootstrap.php';
|
||||||
Bootstrap::cli($basedir);
|
Bootstrap::cli($basedir);
|
||||||
});
|
});
|
||||||
|
66
test/setup_vendor.sh
Executable file
66
test/setup_vendor.sh
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
MODULE_HOME=${MODULE_HOME:="$(dirname "$(readlink -f $(dirname "$0"))")"}
|
||||||
|
PHP_VERSION="$(php -r 'echo phpversion();')"
|
||||||
|
|
||||||
|
ICINGAWEB_VERSION=${ICINGAWEB_VERSION:=2.4.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
|
||||||
|
|
||||||
|
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…
x
Reference in New Issue
Block a user