Lines 1-3
Link Here
|
|
|
1 |
#!/usr/bin/perl |
2 |
|
1 |
# Copyright 2015 Catalyst IT |
3 |
# Copyright 2015 Catalyst IT |
2 |
# |
4 |
# |
3 |
# This file is part of Koha. |
5 |
# This file is part of Koha. |
Lines 19-24
use Modern::Perl;
Link Here
|
19 |
|
21 |
|
20 |
use Test::More tests => 6; |
22 |
use Test::More tests => 6; |
21 |
use Test::MockModule; |
23 |
use Test::MockModule; |
|
|
24 |
use English qw( -no_match_vars ); |
22 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
23 |
|
26 |
|
24 |
use MARC::Record; |
27 |
use MARC::Record; |
Lines 50-59
is( $converted->count, 1, 'One converted record' );
Link Here
|
50 |
|
53 |
|
51 |
SKIP: { |
54 |
SKIP: { |
52 |
|
55 |
|
53 |
eval { $indexer->get_elasticsearch_params; }; |
56 |
my $check; |
54 |
|
57 |
my $msg; |
55 |
skip 'ElasticSeatch configuration not available', 1 |
58 |
if ( !defined C4::Context->config('elasticsearch') ) { |
56 |
if $@; |
59 |
$msg = 'ElasticSearch configuration not available'; |
|
|
60 |
} |
61 |
if ( !$msg ) { |
62 |
my $ses = |
63 |
Search::Elasticsearch->new( { $indexer->get_elasticsearch_params } ); |
64 |
$check = eval { my $node_check = $ses->nodes->info; }; |
65 |
$msg = $EVAL_ERROR; |
66 |
} |
67 |
|
68 |
if ( !$check && !$msg ) { |
69 |
$msg = 'Unable to check ElasticSearch node info'; |
70 |
} |
71 |
elsif ( $msg =~ /NoNode/xsm ) { |
72 |
$msg = 'ElasticSearch lacks nodes'; |
73 |
} |
74 |
|
75 |
if ($msg) { |
76 |
skip $msg, 1; |
77 |
} |
57 |
|
78 |
|
58 |
ok( $indexer->update_index(undef,$records), 'Update Index' ); |
79 |
ok( $indexer->update_index(undef,$records), 'Update Index' ); |
59 |
} |
80 |
} |
60 |
- |
|
|