Skip to content

Commit 68c7871

Browse files
committed
Stop using ES_TEST
1 parent 3eea5e5 commit 68c7871

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

t/lib/MetaCPAN/Server/Test.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ use MetaCPAN::Model ();
4343
sub model {
4444
MetaCPAN::Model->new(
4545
es => (
46-
$ENV{ES_TEST}
47-
||= MetaCPAN::Config::config()->{elasticsearch_servers}
46+
nodes => [ MetaCPAN::Config::config()->{elasticsearch_servers} ]
4847
)
4948
);
5049
}

t/lib/MetaCPAN/TestServer.pm

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ use MetaCPAN::Script::Mirrors ();
1515
use MetaCPAN::Script::Package ();
1616
use MetaCPAN::Script::Permission ();
1717
use MetaCPAN::Script::Release ();
18+
use MetaCPAN::Server ();
1819
use MetaCPAN::Server ();
19-
use MetaCPAN::TestHelpers qw( fakecpan_dir );
20+
use MetaCPAN::TestHelpers qw( catch fakecpan_dir try );
2021
use MetaCPAN::Types::TypeTiny qw( HashRef Path Str );
2122
use Search::Elasticsearch ();
2223
use Search::Elasticsearch::TestServer ();
2324
use Test::More;
24-
use Try::Tiny qw( catch try );
25+
use Test::More import => [qw( BAIL_OUT diag is note ok subtest )];
2526

2627
has es_client => (
2728
is => 'ro',
@@ -82,14 +83,12 @@ sub _build_config {
8283
sub _build_es_home {
8384
my $self = shift;
8485

85-
my $es_home = $ENV{ES_TEST}
86-
|| MetaCPAN::Config::config()->{elasticsearch_servers};
86+
my $es_home = MetaCPAN::Config::config()->{elasticsearch_servers};
8787

8888
if ( !$es_home ) {
89-
my $es_home = $ENV{ES_HOME} or die <<'USAGE';
90-
Please set ${ES_TEST} to a running instance of Elasticsearch, eg
91-
'localhost:9200' or set $ENV{ES_HOME} to the directory containing
92-
Elasticsearch
89+
die <<'USAGE';
90+
Please set elasticsearch_servers to a running instance of Elasticsearch, eg
91+
'localhost:9200'
9392
USAGE
9493
}
9594

@@ -118,7 +117,7 @@ sub _build_es_server {
118117
diag 'Connecting to Elasticsearch on ' . $self->_es_home;
119118

120119
try {
121-
$ENV{ES_TEST} = $server->start->[0];
120+
$server->start->[0];
122121
}
123122
catch {
124123
diag(<<"EOF");

0 commit comments

Comments
 (0)