Only run dynamic runcommand hooks if the jobset enables them
This commit is contained in:
@ -13,6 +13,9 @@ my $builds = $ctx->makeAndEvaluateJobset(
|
||||
|
||||
my $build = $builds->{"runCommandHook.example"};
|
||||
|
||||
# Enable dynamic runcommand on the jobset
|
||||
$build->jobset->update({enable_dynamic_run_command => 1});
|
||||
|
||||
is($build->job, "runCommandHook.example", "The only job should be runCommandHook.example");
|
||||
is($build->finished, 1, "Build should be finished.");
|
||||
is($build->buildstatus, 0, "Build should have buildstatus 0.");
|
||||
@ -167,6 +170,16 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
|
||||
"Failed builds don't get run"
|
||||
);
|
||||
};
|
||||
|
||||
subtest "With dynamic runcommand disabled ..." => sub {
|
||||
$build->jobset->update({enable_dynamic_run_command => 0});
|
||||
|
||||
is(
|
||||
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
||||
0,
|
||||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user