Support different server ports - defined by EXECUTOR_NUMBER

This commit is contained in:
Thomas Müller 2015-09-29 13:56:56 +02:00
Родитель 2d1f509acf
Коммит e3a98e4959
3 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -12,6 +12,6 @@ default:
ci:
formatter:
name: junit
name: pretty,junit
parameters:
output_path: ./output
output_path: null,./output

Просмотреть файл

@ -34,6 +34,12 @@ class FeatureContext extends BehatContext {
// Initialize your context here
$this->baseUrl = $parameters['baseUrl'];
$this->adminUser = $parameters['admin'];
// in case of ci deployment we take the server url from the environment
$testServerUrl = getenv('TEST_SERVER_URL');
if ($testServerUrl !== false) {
$this->baseUrl = $testServerUrl;
}
}
/**

Просмотреть файл

@ -3,17 +3,17 @@
composer install
# TODO: avoid port collision on jenkins - use $EXECUTOR_NUMBER
#if [ -z "$EXECUTOR_NUMBER" ]; then
# EXECUTOR_NUMBER=0
#fi
#PORT=$((8080 + $EXECUTOR_NUMBER))
PORT=8080
if [ -z "$EXECUTOR_NUMBER" ]; then
EXECUTOR_NUMBER=0
fi
PORT=$((8080 + $EXECUTOR_NUMBER))
#PORT=8080
echo $PORT
php -S localhost:$PORT -t ../.. &
PHPPID=$!
echo $PHPPID
#export BEHAT_PARAMS="context[parameters][base_url]=http://localhost:$PORT/ocs"
export TEST_SERVER_URL="http://localhost:$PORT/ocs/"
vendor/bin/behat --profile ci
kill $PHPPID