2021-06-10 21:45:45 +00:00
|
|
|
use feature 'unicode_strings';
|
|
|
|
use strict;
|
2021-08-19 20:36:43 +00:00
|
|
|
use warnings;
|
2021-06-10 21:45:45 +00:00
|
|
|
use Setup;
|
2021-10-20 02:53:39 +00:00
|
|
|
use JSON::MaybeXS qw(decode_json encode_json);
|
2021-06-10 21:45:45 +00:00
|
|
|
|
|
|
|
my %ctx = test_init();
|
|
|
|
|
|
|
|
require Hydra::Schema;
|
|
|
|
require Hydra::Model::DB;
|
|
|
|
require Hydra::Helper::Nix;
|
|
|
|
use HTTP::Request::Common;
|
|
|
|
|
|
|
|
use Test2::V0;
|
|
|
|
require Catalyst::Test;
|
|
|
|
Catalyst::Test->import('Hydra');
|
|
|
|
|
|
|
|
my $db = Hydra::Model::DB->new;
|
|
|
|
hydra_setup($db);
|
|
|
|
|
|
|
|
request(GET '/');
|
|
|
|
my $metrics = request(GET '/metrics');
|
|
|
|
ok($metrics->is_success);
|
|
|
|
|
|
|
|
like(
|
|
|
|
$metrics->content,
|
|
|
|
qr/http_requests_total\{action="index",code="200",controller="Hydra::Controller::Root",method="GET"\} 1/,
|
|
|
|
"Metrics are collected"
|
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|