TT#42565 api-journals.t: use test start time

* when fetching data from the journals tables
      the start test time is used to filter out possible
      existing records with the same resource ids
      to address the mysql auto increment reset behaviour

Change-Id: Id048b97809628bbbcef9724ae0cf4eae39f7f0fa
changes/23/22823/1
Kirill Solomko 7 years ago
parent 7d045b9ffc
commit abbd681754

@ -4,6 +4,7 @@ use Net::Domain qw(hostfqdn);
use JSON -support_by_pp, -no_export;
use Test::More;
use Storable qw();
use URI::Encode qw(uri_encode);
use LWP::Debug;
@ -20,6 +21,8 @@ my $is_local_env = 0;
my $mysql_sqlstrict = 1; #https://bugtracker.sipwise.com/view.php?id=12565
my $enable_journal_tests = 1;
my $test_start_datetime = DateTime->now;
use Config::General;
my $catalyst_config;
if ($is_local_env) {
@ -2397,7 +2400,7 @@ sub _test_journal_collection {
my ($resource,$item_id,$journals) = @_;
if (_is_journal_resource_enabled($resource)) {
my $total_count = (defined $journals ? (scalar keys %$journals) : undef);
my $nexturi = $uri.'/api/'.$resource . '/' . $item_id . '/journal/?page=1&rows=' . ((not defined $total_count or $total_count <= 2) ? 2 : $total_count - 1);
my $nexturi = $uri.'/api/'.$resource . '/' . $item_id . '/journal/?page=1&rows=' . ((not defined $total_count or $total_count <= 2) ? 2 : $total_count - 1) . "&from=".uri_encode($test_start_datetime);
do {
$res = $ua->get($nexturi);
is($res->code, 200, _get_request_test_message("fetch journal collection page"));

Loading…
Cancel
Save