Skip to content

Commit fd5daca

Browse files
committed
Use ES_TEST in tests
Since moving to the docker env we need to make sure tests don't clobber data in the dev elasticsearch instance but use the elasticsearch_test one.
1 parent 2b7a8b2 commit fd5daca

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
# We use a non-standard port to avoid trashing production
1616
# but travis will have it running on the standard port.
1717
- ES=localhost:9200
18+
- ES_TEST=localhost:9200
1819

1920
# Instantiate Catalyst models using metacpan_server_testing.conf
2021
- METACPAN_SERVER_CONFIG_LOCAL_SUFFIX=testing

etc/metacpan_testing.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
es => ($ENV{ES} || 'localhost:9900'),
2+
es => ($ENV{ES_TEST} || 'localhost:9900'),
33
port => '5900',
44
die_on_error => 1,
55
level => ($ENV{TEST_VERBOSE} ? 'info' : 'warn'),

t/lib/MetaCPAN/Server/Test.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sub app {
4040
require MetaCPAN::Model;
4141

4242
sub model {
43-
MetaCPAN::Model->new( es => ( $ENV{ES} ||= 'localhost:9900' ) );
43+
MetaCPAN::Model->new( es => ( $ENV{ES_TEST} ||= 'localhost:9200' ) );
4444
}
4545

4646
1;

t/lib/MetaCPAN/TestServer.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ sub _build_config {
7979
sub _build_es_home {
8080
my $self = shift;
8181

82-
my $es_home = $ENV{ES};
82+
my $es_home = $ENV{ES_TEST};
8383

8484
if ( !$es_home ) {
8585
my $es_home = $ENV{ES_HOME} or die <<'USAGE';
86-
Please set $ENV{ES} to a running instance of Elasticsearch, eg
86+
Please set ${ES_TEST} to a running instance of Elasticsearch, eg
8787
'localhost:9200' or set $ENV{ES_HOME} to the directory containing
8888
Elasticsearch
8989
USAGE
@@ -114,7 +114,7 @@ sub _build_es_server {
114114
diag 'Connecting to Elasticsearch on ' . $self->_es_home;
115115

116116
try {
117-
$ENV{ES} = $server->start->[0];
117+
$ENV{ES_TEST} = $server->start->[0];
118118
}
119119
catch {
120120
diag(<<"EOF");

0 commit comments

Comments
 (0)