Skip to content

Commit 4032c88

Browse files
[ci] Enable collecting and replaying skipped tests
1 parent 5206086 commit 4032c88

File tree

78 files changed

+167
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+167
-73
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ install:
4545
- if [ "$deps" != "skip" ] && [ "$deps" != "no" ]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi;
4646

4747
script:
48-
- if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu 'echo -e "\\nRunning {} tests"; $PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
48+
- if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
4949
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
50-
- if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
51-
- if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
50+
- if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
51+
- if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
5252
- if [ "$deps" = "skip" ]; then echo 'This matrix line is skipped for pull requests.'; fi;

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ init:
1414
- SET PHP=1
1515
- SET ANSICON=121x90 (121x90)
1616
- SET PHP_INI_MATRIX=php.ini-min php.ini-max
17+
- SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped
1718

1819
install:
1920
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
@@ -32,6 +33,7 @@ install:
3233
- IF %PHP%==1 cd ..
3334
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
3435
- IF %PHP%==1 copy /Y php.ini-development php.ini-min
36+
- IF %PHP%==1 echo max_execution_time=1200 >> php.ini-min
3537
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini-min
3638
- IF %PHP%==1 echo extension_dir=ext >> php.ini-min
3739
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"symfony/yaml": "self.version"
6262
},
6363
"require-dev": {
64-
"symfony/phpunit-bridge": "~2.7",
6564
"doctrine/data-fixtures": "1.0.*",
6665
"doctrine/dbal": "~2.4",
6766
"doctrine/orm": "~2.4,>=2.4.5",

phpunit

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
2828
// Build a standalone phpunit without symfony/yaml
2929

3030
$oldPwd = getcwd();
31-
mkdir($PHPUNIT_DIR);
31+
@mkdir($PHPUNIT_DIR);
3232
chdir($PHPUNIT_DIR);
3333
if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
3434
stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
@@ -41,6 +41,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
4141
$zip->close();
4242
chdir("phpunit-$PHPUNIT_VERSION");
4343
passthru("$COMPOSER remove --no-update symfony/yaml");
44+
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
4445
passthru("$COMPOSER install --prefer-source --no-progress --ansi");
4546
chdir($oldPwd);
4647
}
@@ -76,10 +77,13 @@ if ($phpIniMatrix) {
7677
if (isset($argv[1]) && 'symfony' === $argv[1]) {
7778
// Find Symfony components in plain php for Windows portability
7879

79-
$finder = new RecursiveDirectoryIterator(__DIR__.'/src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
80+
$oldPwd = getcwd();
81+
chdir(__DIR__);
82+
$finder = new RecursiveDirectoryIterator('src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
8083
$finder = new RecursiveIteratorIterator($finder);
8184
$finder->setMaxDepth(3);
8285

86+
$skippedTests = isset($_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS']) ? $_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS'] : false;
8387
$runningProcs = array();
8488

8589
foreach ($finder as $file => $fileInfo) {
@@ -88,6 +92,10 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
8892

8993
// Run phpunit tests in parallel
9094

95+
if ($skippedTests) {
96+
putenv("SYMFONY_PHPUNIT_SKIPPED_TESTS=$component/$skippedTests");
97+
}
98+
9199
$c = ProcessUtils::escapeArgument($component);
92100

93101
if ($proc = proc_open(sprintf($cmd, $c, " > $c/phpunit.stdout 2> $c/phpunit.stderr"), array(), $pipes)) {
@@ -98,6 +106,7 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
98106
}
99107
}
100108
}
109+
chdir($oldPwd);
101110

102111
// Fixes for colors support on appveyor
103112
// See https://github.com/appveyor/ci/issues/373
@@ -139,6 +148,9 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
139148
}
140149
unlink($file);
141150
}
151+
if ($skippedTests) {
152+
@unlink("$component/$skippedTests");
153+
}
142154

143155
if ($procStatus) {
144156
$exit = 1;

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@
4141
</exclude>
4242
</whitelist>
4343
</filter>
44+
45+
<listeners>
46+
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
47+
</listeners>
4448
</phpunit>

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"doctrine/common": "~2.4"
2121
},
2222
"require-dev": {
23-
"symfony/phpunit-bridge": "~2.7",
2423
"symfony/stopwatch": "~2.2",
2524
"symfony/dependency-injection": "~2.0,>=2.0.5",
2625
"symfony/form": "~2.3,>=2.3.8",

src/Symfony/Bridge/Doctrine/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@
2424
</exclude>
2525
</whitelist>
2626
</filter>
27+
28+
<listeners>
29+
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
30+
</listeners>
2731
</phpunit>

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
"symfony/http-kernel": "~2.2",
2121
"monolog/monolog": "~1.3"
2222
},
23-
"require-dev": {
24-
"symfony/phpunit-bridge": "~2.7"
25-
},
2623
"autoload": {
2724
"psr-0": { "Symfony\\Bridge\\Monolog\\": "" }
2825
},

src/Symfony/Bridge/Monolog/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@
2424
</exclude>
2525
</whitelist>
2626
</filter>
27+
28+
<listeners>
29+
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
30+
</listeners>
2731
</phpunit>

src/Symfony/Bridge/Propel1/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"propel/propel1": "~1.6,>=1.6.5"
2525
},
2626
"require-dev": {
27-
"symfony/phpunit-bridge": "~2.7",
2827
"symfony/stopwatch": "~2.2"
2928
},
3029
"autoload": {

0 commit comments

Comments
 (0)