-
Notifications
You must be signed in to change notification settings - Fork 582
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 io_loop_v6.t, subprocess.t, and websocket_proxy.t to use subtests. #1520 #1598
Conversation
|
||
}; | ||
|
||
my $reactor = Mojo::IOLoop->singleton->reactor; |
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 seems like completely new code that changes what the test does.
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.
These tests had far too much shared code, which is why so much of it had to be moved out of the subtests. I was hoping to discuss how to better compartmentalize the tests.
But then I got into a fugue state at the end of hacktoberfest, converting more and more -- only to find I was breaking the tests when run on integration, as I was missing local ENV vars to run all the tests. so it goes.
|
||
}; | ||
|
||
my $server; |
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.
Variable outside of subtest.
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.
variable shared between tests and moved out of subtest. How best to isolate?
|
||
}; | ||
|
||
my $reactor2; |
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.
Variable outside of subtest.
local $ENV{MOJO_CERT_FILE} = 't/mojo/certs/client.crt'; | ||
local $ENV{MOJO_KEY_FILE} = 't/mojo/certs/client.key'; | ||
local $ENV{MOJO_INSECURE} = 0; | ||
my $ua; |
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.
Variable outside of subtest.
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.
variable shared between tests and moved out of subtest. How best to isolate?
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 PR to remove the tests that did not convert cleanly. Hoping some of the effort can be salvaged to get some small part of this conversion off of your plate. Please consider re-opening and reviewing. Sorry for producing a headache rather than the happy joy of found work. |
Thanks for your effort. But from now on please just one test per PR. This is just too much to review. |
I've also updated #1520 with a few additions (one test per PR and skip tests with lots of shared state). |
If you want to salvage these PRs, limit them to one test file and move everything else in new PRs. |
Summary
Convert 3 tests to use subtests that converted cleanly.
ioloop_ipv6.t
: single commented section converted to a single subtest with no other changes.subprocess.t
: commented sections converted cleanly to subtests. Three variable names were reused between tests, but they values were not reused or shared. Fix required only redeclaring and reinitializing as needed for$fail
,$result
, and$subprocess
.websocket_proxy_lts.t
: commented sections converted cleanly to subtests. Three variable names were reused between tests, but they values were not reused or shared. Fix required only redeclaring and reinitializing as needed for$tx
,$keepalive
and$result
.Motivation
Requested in #1520
References
See #1520