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

Skip to content

Commit 37f1060

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 8335c2e commit 37f1060

File tree

3 files changed

+42
-46
lines changed

3 files changed

+42
-46
lines changed

.travis.yml

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,19 @@ services:
4242
before_install:
4343
- |
4444
# General configuration
45+
set -e
4546
stty cols 120
4647
mkdir /tmp/slapd
4748
slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 &
48-
PHP=$TRAVIS_PHP_VERSION
4949
[ -d ~/.composer ] || mkdir ~/.composer
5050
cp .composer/* ~/.composer/
5151
export PHPUNIT=$(readlink -f ./phpunit)
5252
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
5353
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
54+
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
55+
find ~/.phpenv -name xdebug.ini -delete
5456
55-
nanoseconds() {
57+
nanoseconds () {
5658
local cmd="date"
5759
local format="+%s%N"
5860
local os=$(uname)
@@ -67,7 +69,7 @@ before_install:
6769
6870
# tfold is a helper to create folded reports
6971
tfold () {
70-
local title=$1
72+
local title="🐘 $PHP $1"
7173
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
7274
shift
7375
local id=$(printf %08x $(( RANDOM * RANDOM )))
@@ -87,17 +89,6 @@ before_install:
8789
}
8890
export -f tfold
8991
90-
# php.ini configuration
91-
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
92-
phpenv config-rm xdebug.ini || echo "xdebug not available"
93-
echo date.timezone = Europe/Paris >> $INI
94-
echo memory_limit = -1 >> $INI
95-
echo session.gc_probability = 0 >> $INI
96-
echo opcache.enable_cli = 1 >> $INI
97-
echo apc.enable_cli = 1 >> $INI
98-
echo extension = redis.so >> $INI
99-
echo extension = memcached.so >> $INI
100-
10192
# tpecl is a helper to compile and cache php extensions
10293
tpecl () {
10394
local ext_name=$1
@@ -109,31 +100,42 @@ before_install:
109100
if [[ -e $ext_cache/$ext_so ]]; then
110101
echo extension = $ext_cache/$ext_so >> $INI
111102
else
103+
rm ~/.pearrc /tmp/pear 2>/dev/null || true
112104
mkdir -p $ext_cache
113105
echo yes | pecl install -f $ext_name &&
114106
cp $ext_dir/$ext_so $ext_cache
115107
fi
116108
}
117109
export -f tpecl
118110
119-
# Matrix lines for intermediate PHP versions are skipped for pull requests
120-
if [[ ! $deps && ! $PHP = $MIN_PHP && $TRAVIS_PULL_REQUEST != false ]]; then
121-
deps=skip
122-
skip=1
123-
else
124-
COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
125-
fi
126-
127111
- |
128112
# Install sigchild-enabled PHP to test the Process component on the lowest PHP matrix line
129-
if [[ ! $deps && $PHP = $MIN_PHP && ! -d php-$MIN_PHP/sapi ]]; then
113+
if [[ ! $deps && $TRAVIS_PHP_VERSION = $MIN_PHP && ! -d php-$MIN_PHP/sapi ]]; then
130114
wget http://php.net/get/php-$MIN_PHP.tar.bz2/from/this/mirror -O - | tar -xj &&
131115
(cd php-$MIN_PHP && ./configure --enable-sigchild --enable-pcntl && make -j2)
132116
fi
133117
118+
- |
119+
# php.ini configuration
120+
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
121+
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)
122+
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
123+
echo date.timezone = Europe/Paris >> $INI
124+
echo memory_limit = -1 >> $INI
125+
echo session.gc_probability = 0 >> $INI
126+
echo opcache.enable_cli = 1 >> $INI
127+
echo apc.enable_cli = 1 >> $INI
128+
echo extension = redis.so >> $INI
129+
echo extension = memcached.so >> $INI
130+
done
131+
134132
- |
135133
# Install extra PHP extensions
136-
if [[ ! $skip ]]; then
134+
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
135+
export PHP=$PHP
136+
phpenv global $PHP
137+
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
138+
137139
# install libsodium
138140
sudo add-apt-repository ppa:ondrej/php -y
139141
sudo apt-get update -q
@@ -142,7 +144,7 @@ before_install:
142144
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
143145
tfold ext.libsodium tpecl libsodium sodium.so $INI
144146
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI
145-
fi
147+
done
146148
147149
- |
148150
# Load fixtures
@@ -156,7 +158,7 @@ install:
156158
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
157159
if [[ ! $deps ]]; then
158160
php .github/build-packages.php HEAD^ src/Symfony/Bridge/PhpUnit
159-
elif [[ ! $skip ]]; then
161+
else
160162
export SYMFONY_DEPRECATIONS_HELPER=weak &&
161163
cp composer.json composer.json.orig &&
162164
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json &&
@@ -172,7 +174,7 @@ install:
172174
git fetch origin $SYMFONY_VERSION &&
173175
git checkout -m FETCH_HEAD &&
174176
COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n')
175-
elif [[ ! $skip ]]; then
177+
else
176178
SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
177179
fi
178180
@@ -181,33 +183,34 @@ install:
181183
[[ $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
182184
183185
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
184-
if [[ ! $skip && $deps ]]; then mv composer.json.phpunit composer.json; fi
185-
186-
if [[ ! $skip ]]; then
187-
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
188-
fi
186+
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
189187
190-
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
191-
- if [[ ! $skip ]]; then ./phpunit install; fi
192188
- php -i
193189

194190
- |
195191
run_tests () {
196192
set -e
197-
if [[ $skip ]]; then
193+
export PHP=$1
194+
if [[ $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
198195
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
199-
elif [[ $deps = high ]]; then
196+
break
197+
fi
198+
phpenv global $PHP
199+
tfold 'composer update' $COMPOSER_UP
200+
tfold 'phpunit install' ./phpunit install
201+
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
202+
if [[ $deps = high ]]; then
200203
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
201204
elif [[ $deps = low ]]; then
202205
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
203206
else
204207
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
205-
tfold tty-group $PHPUNIT --group tty
208+
tfold src/Symfony/Component/Console.tty $PHPUNIT src/Symfony/Component/Console --group tty
206209
if [[ $PHP = $MIN_PHP ]]; then
207210
tfold src/Symfony/Component/Process.sigchild SYMFONY_DEPRECATIONS_HELPER=weak php-$MIN_PHP/sapi/cli/php ./phpunit --colors=always src/Symfony/Component/Process/
208211
fi
209212
fi
210213
}
211214
212215
script:
213-
- (run_tests)
216+
- 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
@@ -450,9 +450,6 @@ public function testExitCodeCommandFailed()
450450
$this->assertGreaterThan(0, $process->getExitCode());
451451
}
452452

453-
/**
454-
* @group tty
455-
*/
456453
public function testTTYCommand()
457454
{
458455
if ('\\' === \DIRECTORY_SEPARATOR) {
@@ -468,9 +465,6 @@ public function testTTYCommand()
468465
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus());
469466
}
470467

471-
/**
472-
* @group tty
473-
*/
474468
public function testTTYCommandExitCode()
475469
{
476470
if ('\\' === \DIRECTORY_SEPARATOR) {

0 commit comments

Comments
 (0)