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

Convert cleanly prefork, response, subprocess_ev, and tls to use subtests #1520 #1595

Closed
wants to merge 6 commits into from

Conversation

spazm
Copy link

@spazm spazm commented Nov 1, 2020

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:
    • in most tests$res
    • in one test$compressed &$uncompressed
    • in two tests:$full, $count, $offset
    • in one test$file and also new $dir created from tempdir
  • subprocess_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 url

Please feel free to edit or make any stylistic changes as you see fit. Just looking to toss in a helping hand.

@spazm spazm force-pushed the fix/1520-use-subtests branch 2 times, most recently from da575ba to 6ebdd9a Compare November 1, 2020 05:39
@spazm spazm changed the title Fix/1520 use subtests Convert 6 tests to use subtests #1520 (prefork, promise_async_await, response, roles, subprocess_ev, tls) Nov 1, 2020

# Silence
app->log->level('fatal');
subtest "Silence" => sub {
Copy link
Member

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!'};
Copy link
Member

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?

@kraih
Copy link
Member

kraih commented Nov 1, 2020

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.

@kraih kraih requested a review from a team November 1, 2020 12:22
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'works too!', 'right content';

subtest "Manage and clean up PID file" => sub {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double quotes are inconsistent.

Copy link
Member

@kraih kraih left a 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.

@kraih
Copy link
Member

kraih commented Nov 1, 2020

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.

@kraih kraih closed this Nov 1, 2020
@spazm spazm changed the title Convert 6 tests to use subtests #1520 (prefork, promise_async_await, response, roles, subprocess_ev, tls) Convert tests to use subtests prefork, response, subprocess_ev, tls) #1520 Nov 1, 2020
@spazm spazm changed the title Convert tests to use subtests prefork, response, subprocess_ev, tls) #1520 Convert four tests to use subtests: prefork, response, subprocess_ev, and tls #1520 Nov 1, 2020
@spazm
Copy link
Author

spazm commented Nov 1, 2020

updated and rebased to remove the tests that didn't convert cleanly. These four required minimal changes, as detailed in the updated PR summary.

@spazm spazm changed the title Convert four tests to use subtests: prefork, response, subprocess_ev, and tls #1520 Convert cleanly prefork, response, subprocess_ev, and tls to use subtests #1520 Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants