forked from lix-project/hydra
t/Helper: test constructRunCommandLogPath
This commit is contained in:
parent
8bf3cdbc67
commit
2c6487b8d7
|
@ -4,6 +4,7 @@ use Setup;
|
|||
use File::Temp;
|
||||
|
||||
my $ctx = test_context();
|
||||
my $db = $ctx->db();
|
||||
|
||||
require Hydra::Helper::Nix;
|
||||
|
||||
|
@ -65,4 +66,22 @@ is(Hydra::Helper::Nix::getMachines(), {
|
|||
|
||||
}, ":)");
|
||||
|
||||
subtest "constructRunCommandLogPath" => sub {
|
||||
my $builds = $ctx->makeAndEvaluateJobset(
|
||||
expression => "basic.nix",
|
||||
);
|
||||
my $build = $builds->{"empty_dir"};
|
||||
my $runlog = $db->resultset('RunCommandLogs')->create({
|
||||
job_matcher => "*:*:*",
|
||||
build_id => $build->get_column('id'),
|
||||
command => "bogus",
|
||||
});
|
||||
|
||||
like(
|
||||
Hydra::Helper::Nix::constructRunCommandLogPath($runlog),
|
||||
qr@/runcommand-logs/[0-9a-f]{2}/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}@,
|
||||
"The constructed RunCommandLog path is sufficiently bucketed and UUID-like."
|
||||
);
|
||||
};
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in a new issue