-
Notifications
You must be signed in to change notification settings - Fork 580
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
Convert cleanly prefork, response, subprocess_ev, and tls to use subtests #1520 #1595
Conversation
da575ba
to
6ebdd9a
Compare
6ebdd9a
to
d6cff6b
Compare
d6cff6b
to
9f70a6d
Compare
|
||
# Silence | ||
app->log->level('fatal'); | ||
subtest "Silence" => sub { |
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.
What does this even mean?
return $promise; | ||
}; | ||
|
||
get '/one' => {text => 'works!'}; |
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.
Why are these in a subtest?
These tests were super broken yesterday with syntax errors everywhere, like a bad script converted them. So please make sure to pay extra attention when reviewing. |
is $tx->res->code, 200, 'right status'; | ||
is $tx->res->body, 'works too!', 'right content'; | ||
|
||
subtest "Manage and clean up PID file" => sub { |
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.
Double quotes are inconsistent.
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.
Some tests are fine and could be merged, but others have scoping issues and require more attention.
I'm sorry, but i've decided to close these PRs, because they contain too many converted tests at once. And we don't have the review capacity to re-review the whole thing after every scoping issue fix. |
updated and rebased to remove the tests that didn't convert cleanly. These four required minimal changes, as detailed in the updated PR summary. |
Summary
Convert tests to use subtests. These tests converted cleanly with no data shared between tests.
prefork.t
: converted cleanly. Redeclare re-used names for new scopes:$prefork
,$log
,$cb
,$port
,@spawn
,@reap
,$tx
,$graceful
.response.t
: converted cleanly. Redeclare re-used names for new scopes:$res
$compressed
&$uncompressed
$full
,$count
,$offset
$file
and also new$dir
created from tempdirsubprocess_ev.t
: one test converted with no additional changes.tls.t
: both tests converted cleanly. Required redeclaring of new scopes in second test:$delay
,$server
,$client
,$client_result
,$server_result
.Motivation
Requested in #1520
References
Requested in #1520
Viewing the diff ignoring whitespace makes the changes a lot clearer.
git diff -w
or add&w=1
to the diffs urlPlease feel free to edit or make any stylistic changes as you see fit. Just looking to toss in a helping hand.