Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always print seed used for --order-by=random #3524

Merged
merged 2 commits into from Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/TextUI/TestRunner.php
Expand Up @@ -338,13 +338,6 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te

$this->writeMessage('Runtime', $runtime);

if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) {
$this->writeMessage(
'Random seed',
$arguments['randomOrderSeed']
);
}

if (isset($arguments['configuration'])) {
$this->writeMessage(
'Configuration',
Expand All @@ -367,6 +360,13 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te
}
}

if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) {
$this->writeMessage(
'Random seed',
$arguments['randomOrderSeed']
);
}

if (isset($tooFewColumnsRequested)) {
$this->writeMessage('Error', 'Less than 16 columns requested, number of columns set to 16');
}
Expand Down
Expand Up @@ -4,20 +4,18 @@ phpunit --random-order --random-order-seed=54321 --resolve-dependencies ../_file
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--debug';
$_SERVER['argv'][3] = '--verbose';
$_SERVER['argv'][4] = '--random-order';
$_SERVER['argv'][5] = '--random-order-seed=54321';
$_SERVER['argv'][6] = '--resolve-dependencies';
$_SERVER['argv'][7] = 'MultiDependencyTest';
$_SERVER['argv'][8] = __DIR__ . '/../_files/MultiDependencyTest.php';
$_SERVER['argv'][3] = '--random-order';
$_SERVER['argv'][4] = '--random-order-seed=54321';
$_SERVER['argv'][5] = '--resolve-dependencies';
$_SERVER['argv'][6] = 'MultiDependencyTest';
$_SERVER['argv'][7] = __DIR__ . '/../_files/MultiDependencyTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
?>
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s
Random seed: 54321

Test 'MultiDependencyTest::testTwo' started
Expand Down