RunCommandLogs: add a did_succeed helper

This commit is contained in:
Graham Christensen
2021-11-18 14:27:00 -05:00
parent 5bb3e2be78
commit d003fec8a5
4 changed files with 29 additions and 0 deletions

View File

@ -52,6 +52,7 @@ subtest "Validate the file parsed and at least one field matches" => sub {
subtest "Validate a run log was created" => sub {
my $runlog = $build->runcommandlogs->find({});
ok($runlog->did_succeed(), "The process did succeed.");
is($runlog->job_matcher, "*:*:*", "An unspecified job matcher is defaulted to *:*:*");
is($runlog->command, 'cp "$HYDRA_JSON" "$HYDRA_DATA/joboutput.json"', "The executed command is saved.");
is($runlog->start_time, within(time() - 1, 2), "The start time is recent.");

View File

@ -39,6 +39,7 @@ ok(sendNotifications(), "Notifications execute successfully.");
subtest "Validate a run log was created" => sub {
my $runlog = $build->runcommandlogs->find({});
ok(!$runlog->did_succeed(), "The process did not succeed.");
is($runlog->job_matcher, "*:*:*", "An unspecified job matcher is defaulted to *:*:*");
is($runlog->command, 'invalid-command-this-does-not-exist', "The executed command is saved.");
is($runlog->start_time, within(time() - 1, 2), "The start time is recent.");