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

test requires HTTP::Daemon 6.05+ and use 127.0.0.1 or [::1] according to server's sockdomain #280

Merged
merged 4 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion META.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"File::Spec" : "0",
"File::Temp" : "0",
"FindBin" : "0",
"HTTP::Daemon" : "0",
"HTTP::Daemon" : "6.05",
"HTTP::Response" : "0",
"HTTP::Server::Simple::CGI" : "0",
"LWP" : "0",
Expand Down
4 changes: 2 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ my %WriteMakefileArgs = (
"File::Spec" => 0,
"File::Temp" => 0,
"FindBin" => 0,
"HTTP::Daemon" => 0,
"HTTP::Daemon" => "6.05",
"HTTP::Response" => 0,
"HTTP::Server::Simple::CGI" => 0,
"LWP" => 0,
Expand Down Expand Up @@ -83,7 +83,7 @@ my %FallbackPrereqs = (
"HTML::TokeParser" => 0,
"HTML::TreeBuilder" => 5,
"HTTP::Cookies" => 0,
"HTTP::Daemon" => 0,
"HTTP::Daemon" => "6.05",
"HTTP::Request" => "1.30",
"HTTP::Request::Common" => 0,
"HTTP::Response" => 0,
Expand Down
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on 'test' => sub {
requires "File::Spec" => "0";
requires "File::Temp" => "0";
requires "FindBin" => "0";
requires "HTTP::Daemon" => "0";
requires "HTTP::Daemon" => "6.05";
requires "HTTP::Response" => "0";
requires "HTTP::Server::Simple::CGI" => "0";
requires "LWP" => "0";
Expand Down
2 changes: 1 addition & 1 deletion t/local/LocalServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ sub spawn {

# What is this code supposed to fix?
my $lhurl = URI::URL->new( $url );
$lhurl->host( '127.0.0.1' );
$lhurl->host( 'localhost' );
$self->{_server_url} = $lhurl;

$self->{_fh} = $server;
Expand Down
2 changes: 1 addition & 1 deletion t/local/back.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use strict;
use Test::More tests => 47;
use lib qw( t t/local );
use LocalServer;
use HTTP::Daemon;
use HTTP::Daemon 6.05;
Copy link
Member

Choose a reason for hiding this comment

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

Or, we could also add this to TestRequires in dist.ini: https://github.com/libwww-perl/WWW-Mechanize/blob/master/dist.ini#L26-L27

Copy link

Choose a reason for hiding this comment

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

Currently the prereq version for HTTP::Daemon is 0, but has be set to 6.05, otherwise tests will fail if older HTTP::Daemon is installed. Or alternatively skip tests if HTTP::Daemon version is < 6.05.

Copy link
Member Author

Choose a reason for hiding this comment

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

As I mentioned in the first comment, dzil build will bump HTTP::Daemon prereq.
I intentionally did not do it because it would also give us unrelated diff.

Copy link
Member Author

Choose a reason for hiding this comment

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

I manually bumped HTTP::Daemon in 68af39e

use HTTP::Response;


Expand Down
2 changes: 1 addition & 1 deletion t/local/log-server
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Thanks to merlyn for nudging me and giving me this snippet!
use strict;
use HTTP::Daemon;
use HTTP::Daemon 6.05;
use CGI 4.08;
use Getopt::Long;

Expand Down
4 changes: 2 additions & 2 deletions t/local/referer-server
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Thanks to merlyn for nudging me and giving me this snippet!

use HTTP::Daemon;
use HTTP::Daemon 6.05;
use URI::URL;

$|++;

my $d = HTTP::Daemon->new or die;
my $lhurl = URI::URL->new( $d->url );
$lhurl->host( "127.0.0.1" );
$lhurl->host( 'localhost' );
print $lhurl->as_string, "\n";

$counter = 5;
Expand Down
2 changes: 1 addition & 1 deletion t/local/referer.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ my $agent = WWW::Mechanize->new();
isa_ok( $agent, 'WWW::Mechanize' );

SKIP: {
eval { require HTTP::Daemon; };
eval { require HTTP::Daemon; HTTP::Daemon->VERSION(6.05); };
skip 'HTTP::Daemon required to test the referrer header',10 if $@;

# We want to be safe from non-resolving local host names
Expand Down