Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 548e9f7

Browse files
minor #28114 [travis] merge "same Symfony version" jobs in one (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [travis] merge "same Symfony version" jobs in one | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Allowing to consume fewer jobs and save the 1 to 2 minutes bootstrap time of workers. Commits ------- 9857ca0 [travis] merge "same Symfony version" jobs in one
1 parent 79e3904 commit 548e9f7

File tree

3 files changed

+77
-64
lines changed

3 files changed

+77
-64
lines changed

.travis.yml

Lines changed: 76 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ matrix:
2222
sudo: required
2323
group: edge
2424
- php: 5.4
25-
- php: 5.5
26-
- php: 5.6
27-
- php: 7.0
25+
env: php_extra="5.5 5.6 7.0"
2826
- php: 7.1
2927
env: deps=high
3028
- php: 7.2
@@ -42,15 +40,26 @@ services: mongodb
4240
before_install:
4341
- |
4442
# General configuration
43+
set -e
4544
stty cols 120
46-
PHP=$TRAVIS_PHP_VERSION
4745
[ -d ~/.composer ] || mkdir ~/.composer
4846
cp .composer/* ~/.composer/
4947
export PHPUNIT=$(readlink -f ./phpunit)
5048
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
5149
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
50+
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
51+
find ~/.phpenv -name xdebug.ini -delete
52+
53+
if [[ $TRAVIS_PHP_VERSION = 5.* || $TRAVIS_PHP_VERSION = hhvm* ]]; then
54+
composer () {
55+
$HOME/.phpenv/versions/7.1/bin/composer config platform.php $(echo ' <?php echo preg_replace("/-.*/", "", PHP_VERSION);' | php /dev/stdin)
56+
$HOME/.phpenv/versions/7.1/bin/php $HOME/.phpenv/versions/7.1/bin/composer $*
57+
}
58+
export -f composer
59+
~/.phpenv/versions/7.1/bin/composer self-update
60+
fi
5261
53-
nanoseconds() {
62+
nanoseconds () {
5463
local cmd="date"
5564
local format="+%s%N"
5665
local os=$(uname)
@@ -65,7 +74,7 @@ before_install:
6574
6675
# tfold is a helper to create folded reports
6776
tfold () {
68-
local title=$1
77+
local title="🐘 $PHP $1"
6978
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
7079
shift
7180
local id=$(printf %08x $(( RANDOM * RANDOM )))
@@ -85,24 +94,6 @@ before_install:
8594
}
8695
export -f tfold
8796
88-
# php.ini configuration
89-
if [[ $PHP = hhvm* ]]; then
90-
INI=/etc/hhvm/php.ini
91-
else
92-
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
93-
phpenv config-rm xdebug.ini || echo "xdebug not available"
94-
fi
95-
echo date.timezone = Europe/Paris >> $INI
96-
echo memory_limit = -1 >> $INI
97-
echo session.gc_probability = 0 >> $INI
98-
echo opcache.enable_cli = 1 >> $INI
99-
echo hhvm.jit = 0 >> $INI
100-
echo apc.enable_cli = 1 >> $INI
101-
[[ $PHP = 5.* ]] && echo extension = memcache.so >> $INI
102-
if [[ $PHP = 5.* ]]; then
103-
echo extension = mongo.so >> $INI
104-
fi
105-
10697
# tpecl is a helper to compile and cache php extensions
10798
tpecl () {
10899
local ext_name=$1
@@ -114,45 +105,70 @@ before_install:
114105
if [[ -e $ext_cache/$ext_so ]]; then
115106
echo extension = $ext_cache/$ext_so >> $INI
116107
else
108+
rm ~/.pearrc /tmp/pear 2>/dev/null || true
117109
mkdir -p $ext_cache
118110
echo yes | pecl install -f $ext_name &&
119111
cp $ext_dir/$ext_so $ext_cache
120112
fi
121113
}
122114
export -f tpecl
123115
124-
# Matrix lines for intermediate PHP versions are skipped for pull requests
125-
if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then
126-
deps=skip
127-
skip=1
128-
else
129-
COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
130-
fi
131-
132116
- |
133117
# Install sigchild-enabled PHP to test the Process component on the lowest PHP matrix line
134-
if [[ ! $deps && $PHP = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then
118+
if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then
135119
wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj &&
136120
(cd php-$MIN_PHP && ./configure --enable-sigchild --enable-pcntl && make -j2)
137121
fi
138122
123+
- |
124+
# php.ini configuration
125+
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
126+
if [[ $PHP = hhvm* ]]; then
127+
INI=/etc/hhvm/php.ini
128+
else
129+
phpenv global $PHP 2>/dev/null || (cd / && wget https://s3.amazonaws.com/travis-php-archives/binaries/ubuntu/14.04/x86_64/php-$PHP.tar.bz2 -O - | tar -xj)
130+
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
131+
fi
132+
echo date.timezone = Europe/Paris >> $INI
133+
echo memory_limit = -1 >> $INI
134+
echo session.gc_probability = 0 >> $INI
135+
echo opcache.enable_cli = 1 >> $INI
136+
echo hhvm.jit = 0 >> $INI
137+
echo apc.enable_cli = 1 >> $INI
138+
[[ $PHP = 5.* ]] && echo extension = memcache.so >> $INI
139+
if [[ $PHP = 5.* ]]; then
140+
echo extension = mongo.so >> $INI
141+
fi
142+
done
143+
139144
- |
140145
# Install extra PHP extensions
141-
if [[ ! $skip && $PHP = 5.* ]]; then
142-
([[ $deps ]] || tfold ext.symfony_debug 'cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> '"$INI")
143-
tfold ext.memcached tpecl memcached-2.1.0 memcached.so $INI
144-
tfold ext.apcu tpecl apcu-4.0.11 apcu.so $INI
145-
elif [[ ! $skip && $PHP = 7.* ]]; then
146-
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
147-
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI
148-
fi
146+
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
147+
if [[ $PHP = hhvm* ]]; then
148+
continue
149+
fi
150+
export PHP=$PHP
151+
phpenv global $PHP
152+
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
153+
if [[ $PHP = 5.* ]]; then
154+
tfold ext.memcached tpecl memcached-2.1.0 memcached.so $INI
155+
tfold ext.apcu tpecl apcu-4.0.11 apcu.so $INI
156+
[[ $deps ]] && continue
157+
ext_cache=~/php-ext/$(php -r "echo basename(ini_get('extension_dir'));")/symfony_debug.so
158+
[[ -e $ext_cache ]] || (tfold ext.symfony_debug "cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && mv modules/symfony_debug.so $ext_cache && phpize --clean")
159+
echo extension = $ext_cache >> $INI
160+
elif [[ $PHP = 7.* ]]; then
161+
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
162+
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI
163+
fi
164+
done
149165
150166
install:
151167
- |
152168
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
153169
if [[ ! $deps ]]; then
154170
php .github/build-packages.php HEAD^ src/Symfony/Bridge/PhpUnit
155-
elif [[ ! $skip ]]; then
171+
else
156172
export SYMFONY_DEPRECATIONS_HELPER=weak &&
157173
cp composer.json composer.json.orig &&
158174
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json &&
@@ -168,7 +184,7 @@ install:
168184
git fetch origin $SYMFONY_VERSION &&
169185
git checkout -m FETCH_HEAD &&
170186
COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
171-
elif [[ ! $skip ]]; then
187+
else
172188
SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
173189
fi
174190
@@ -177,37 +193,41 @@ install:
177193
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && LEGACY=,legacy
178194
179195
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
180-
if [[ ! $skip && $deps ]]; then mv composer.json.phpunit composer.json; fi
181-
182-
if [[ ! $skip && $PHP = 7.* ]]; then
183-
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
184-
fi
196+
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
185197
186-
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
187-
- if [[ ! $skip ]]; then ./phpunit install; fi
188198
- |
189199
# phpinfo
190-
if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
200+
if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
191201
192202
- |
193203
run_tests () {
194204
set -e
195-
if [[ $skip ]]; then
205+
export PHP=$1
206+
if [[ $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
196207
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
197-
elif [[ $deps = high ]]; then
208+
break
209+
fi
210+
phpenv global ${PHP/hhvm*/hhvm}
211+
tfold 'composer update' $COMPOSER_UP
212+
tfold 'phpunit install' ./phpunit install
213+
if [[ $PHP = 7.* ]]; then
214+
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
215+
fi
216+
if [[ $deps = high ]]; then
198217
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
199218
elif [[ $deps = low ]]; then
200219
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
201220
elif [[ $PHP = hhvm* ]]; then
202221
$PHPUNIT --exclude-group no-hhvm,benchmark,intl-data
203222
else
204223
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
205-
tfold tty-group $PHPUNIT --group tty
224+
tfold src/Symfony/Component/Console.tty $PHPUNIT src/Symfony/Component/Console --group tty
206225
if [[ $PHP = ${MIN_PHP%.*} ]]; then
207-
echo -e "1\\n0" | xargs -I{} bash -c "tfold src/Symfony/Component/Process.sigchild{} ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/"
226+
export PHP=$MIN_PHP
227+
echo -e "1\\n0" | xargs -I{} bash -c "tfold src/Symfony/Component/Process.sigchild{} SYMFONY_DEPRECATIONS_HELPER=weak ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/"
208228
fi
209229
fi
210230
}
211231
212232
script:
213-
- (run_tests)
233+
- for PHP in $TRAVIS_PHP_VERSION $php_extra; do (run_tests $PHP); done

src/Symfony/Component/Debug/Tests/phpt/decorate_exception_hander.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Did you forget a "use" statement for another namespace?"
3838
["line":protected]=>
3939
int(%d)
4040
["trace":"Exception":private]=>
41-
array(0) {
42-
}
41+
array(%d) {%A}
4342
["previous":"Exception":private]=>
4443
NULL
4544
["severity":protected]=>

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,6 @@ public function testExitCodeCommandFailed()
439439
$this->assertGreaterThan(0, $process->getExitCode());
440440
}
441441

442-
/**
443-
* @group tty
444-
*/
445442
public function testTTYCommand()
446443
{
447444
if ('\\' === DIRECTORY_SEPARATOR) {
@@ -457,9 +454,6 @@ public function testTTYCommand()
457454
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus());
458455
}
459456

460-
/**
461-
* @group tty
462-
*/
463457
public function testTTYCommandExitCode()
464458
{
465459
if ('\\' === DIRECTORY_SEPARATOR) {

0 commit comments

Comments
 (0)