-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Run-Tests Cleanup / Modernization #5707
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
base: master
Are you sure you want to change the base?
Conversation
2038a98
to
8fe7690
Compare
@KalleZ I've resolved our conversation as I've moved things to snake_case. |
Please rebase this PR, so that the first (now committed) commit will be dropped. |
@nikic i will. Thanks. |
8fe7690
to
eafcd0a
Compare
eafcd0a
to
be6e80c
Compare
@nikic rebased and ready for merge. |
@@ -31,7 +31,7 @@ | |||
* Minimum required PHP version: 7.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you are using void, update this comment to say 7.1.0.
$workerID = intval(getenv("TEST_PHP_WORKER")); | ||
run_worker(); | ||
$workerID = get_worker_id(); | ||
if($workerID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if($workerID) { | |
if ($workerID) { |
break; | ||
case 'r': | ||
case 'l': | ||
// @Dragoonis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
return 0; | ||
} | ||
|
||
return intval(getenv("TEST_PHP_WORKER")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be simplified to (int) getenv("TEST_PHP_WORKER")
.
|
||
function get_max_workers_from_test_files($workers, $test_files): int | ||
{ | ||
return max(1, min($workers, count($test_files))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code seems easier to understand if left inlined.
|
||
|
||
|
||
function get_number_of_workers($workers): int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function get_number_of_workers($workers): int | |
function parse_number_of_workers(string $workers): int |
maybe
$cleanWorkers = intval($cleanWorkers, 10); | ||
// Don't use parallel testing infrastructure if there is only one worker. | ||
if ($cleanWorkers === 1) { | ||
$cleanWorkers = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be either 0, or the return type should be ?int
.
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN', | ||
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE', | ||
))) { | ||
if (is_section_unknown($section)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would prefer if this was !is_section_known($section)
or !is_known_section($section)
.
No description provided.