From 988e79c6e57f0e7ab746d3180eadf15aa65775ee Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 25 Jan 2022 10:55:40 -0800 Subject: [PATCH] t/RunCommand: test that the log file exists on the filesystem --- t/Hydra/Plugin/RunCommand/basic.t | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/Hydra/Plugin/RunCommand/basic.t b/t/Hydra/Plugin/RunCommand/basic.t index e0cbd1bb..9410d348 100644 --- a/t/Hydra/Plugin/RunCommand/basic.t +++ b/t/Hydra/Plugin/RunCommand/basic.t @@ -58,6 +58,13 @@ subtest "Validate a run log was created" => sub { is($runlog->start_time, within(time() - 1, 2), "The start time is recent."); is($runlog->end_time, within(time() - 1, 2), "The end time is also recent."); is($runlog->exit_code, 0, "This command should have succeeded."); + + subtest "Validate the run log file exists" => sub { + my $filename = Hydra::Helper::Nix::constructRunCommandLogFilename(sha1_hex($runlog->command), $build->get_column('id')); + my $logPath = Hydra::Helper::Nix::constructRunCommandLogPath($filename); + ok(-f $logPath, "The run log was saved to a file."); + ok(-z $logPath, "The run log was empty."); + }; }; done_testing;