@@ -33,16 +33,16 @@ my $t = Test::Mojo->new('OpenQA::WebAPI');
3333$t -> app-> config-> {global }-> {base_url } = ' http://example.com' ;
3434
3535
36- $t -> get_ok(' /admin/influxdb/jobs' )-> status_is(200)-> content_is(
37- ' openqa_jobs,url=http://example.com blocked=0i,running=2i,scheduled=3i
38- openqa_jobs_by_group,url=http://example.com,group=No\ \ Group scheduled=2i
39- openqa_jobs_by_group,url=http://example.com,group=opensuse running=1i,scheduled=1i
40- openqa_jobs_by_group,url=http://example.com,group=opensuse\ \ test running=1i
41- openqa_jobs_by_worker,url=http://example.com,worker=localhost running=1i
42- openqa_jobs_by_arch,url=http://example.com,arch=i586 scheduled=2i
43- openqa_jobs_by_arch,url=http://example.com,arch=x86_64 running=2i
44- '
45- ) -> content_unlike(qr / ,arch= / );
36+ $t -> get_ok(' /admin/influxdb/jobs' )-> status_is(200)-> content_is(<<~'EOM' )
37+ openqa_jobs,url=http://example.com blocked=0i,running=2i,scheduled=3i
38+ openqa_jobs_by_group,url=http://example.com,group=No\ Group scheduled=2i
39+ openqa_jobs_by_group,url=http://example.com,group=opensuse running=1i,scheduled=1i
40+ openqa_jobs_by_group,url=http://example.com,group=opensuse\ test running=1i
41+ openqa_jobs_by_worker,url=http://example.com,worker=localhost running=1i
42+ openqa_jobs_by_arch,url=http://example.com,arch=i586 scheduled=2i
43+ openqa_jobs_by_arch,url=http://example.com,arch=x86_64 running=2i
44+ EOM
45+ -> content_unlike(qr / ,arch= / );
4646
4747$t -> get_ok(' /admin/influxdb/minion' )-> status_is(200)
4848 -> content_like(qr ! openqa_minion_jobs,url=http://example.com active=0i,delayed=0i,failed=0i,inactive=0i! )
@@ -74,10 +74,10 @@ subtest 'openqa_minion_jobs_hook_rc_failed counter' => sub {
7474 my $dbh = $schema -> storage-> dbh;
7575 my $static_now = DateTime-> from_epoch(epoch => 3947); # 1970-01-01T01:05:47
7676 my $rc_fail_finished = DateTime-> from_epoch(epoch => 3521); # 1970-01-01T00:46:57
77- my $sth = $dbh -> prepare(
78- q! INSERT INTO minion_jobs (id, args, created, delayed, finished, priority, result, retried, retries, started, state, task, worker, queue, attempts, parents, notes)
79- VALUES (7291599, '["/bin/true", 11201356, {"delay": 60, "retries": 1440, "skip_rc": 142, "timeout": "10m", "kill_timeout": "10s"}]', '2023-05-26 17:00:50.542916+02', '2023-05-26 17:00:50.542916+02', ?, 0, null, null, 0, '2023-05-26 17:00:50.565839+02', 'finished', 'hook_script', 1388, 'default', 1, '{}', '{"hook_rc": -1, "hook_cmd": "foobar", "hook_result": "Job is '':investigate:'' already, skipping investigation\n"}')!
80- );
77+ my $sth = $dbh -> prepare(<<~'EOM' );
78+ INSERT INTO minion_jobs (id, args, created, delayed, finished, priority, result, retried, retries, started, state, task, worker, queue, attempts, parents, notes)
79+ VALUES (7291599, '["/bin/true", 11201356, {"delay": 60, "retries": 1440, "skip_rc": 142, "timeout": "10m", "kill_timeout": "10s"}]', '2023-05-26 17:00:50.542916+02', '2023-05-26 17:00:50.542916+02', ?, 0, null, null, 0, '2023-05-26 17:00:50.565839+02', 'finished', 'hook_script', 1388, 'default', 1, '{}', '{"hook_rc": -1, "hook_cmd": "foobar", "hook_result": "Job is '':investigate:'' already, skipping investigation\n"}')
80+ EOM
8181 $sth -> execute(" $rc_fail_finished +0" );
8282 my $mock_dt = Test::MockModule-> new(' DateTime' );
8383 $mock_dt -> mock(now => sub { $static_now -> clone });
0 commit comments