Skip to content

Commit

Permalink
Ensure that ENV{ES} is passed down through all tests called by fakecp…
Browse files Browse the repository at this point in the history
…an.t
  • Loading branch information
clintongormley committed Apr 16, 2015
1 parent 770a199 commit 9222640
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion etc/metacpan_testing.pl
@@ -1,5 +1,5 @@
{
es => ':' . ($ENV{METACPAN_ES_TEST_PORT} ||= 9900),
es => ($ENV{ES} || 'localhost:9900'),
port => '5900',
level => ($ENV{TEST_VERBOSE} ? 'info' : 'warn'),
cpan => 't/var/tmp/fakecpan',
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Test.pm
Expand Up @@ -74,7 +74,7 @@ require MetaCPAN::Model;

sub model {
MetaCPAN::Model->new(
es => q[:] . ( $ENV{METACPAN_ES_TEST_PORT} ||= 9900 ) );
es => ( $ENV{ES} ||= 'localhost:9900' ) );
}

1;
Expand Down
6 changes: 3 additions & 3 deletions metacpan_server_testing.conf
Expand Up @@ -2,15 +2,15 @@ cpan t/var/tmp/fakecpan
source_base t/var/tmp/source

<model CPAN>
servers :9900
servers __ENV(ES)__
</model CPAN>

<model User>
servers :9900
servers __ENV(ES)__
</model User>

<plugin Session>
servers :9900
servers __ENV(ES)__
</plugin>

<controller User::Turing>
Expand Down
2 changes: 1 addition & 1 deletion t/fakecpan.t
Expand Up @@ -29,7 +29,7 @@ USAGE
"cluster.name" => 'metacpan-test',
);

$ES_HOST = $server->start->[0];
$ENV{ES} = $ES_HOST = $server->start->[0];
}

diag "Connecting to Elasticsearch on $ES_HOST";
Expand Down

0 comments on commit 9222640

Please sign in to comment.