forked from lix-project/hydra
RunCommand: only run dynamic runcommand hooks if the project AND jobset agree they should be enabled
This commit is contained in:
parent
85a53694c8
commit
0c96172c28
|
@ -13,7 +13,8 @@ my $builds = $ctx->makeAndEvaluateJobset(
|
|||
|
||||
my $build = $builds->{"runCommandHook.example"};
|
||||
|
||||
# Enable dynamic runcommand on the jobset
|
||||
# Enable dynamic runcommand on the project and jobset
|
||||
$build->project->update({enable_dynamic_run_command => 1});
|
||||
$build->jobset->update({enable_dynamic_run_command => 1});
|
||||
|
||||
is($build->job, "runCommandHook.example", "The only job should be runCommandHook.example");
|
||||
|
@ -172,6 +173,19 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
|
|||
};
|
||||
|
||||
subtest "With dynamic runcommand disabled ..." => sub {
|
||||
subtest "disabled on the project, enabled on the jobset" => {
|
||||
$build->project->update({enable_dynamic_run_command => 0});
|
||||
$build->jobset->update({enable_dynamic_run_command => 1});
|
||||
|
||||
is(
|
||||
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
||||
0,
|
||||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||
);
|
||||
};
|
||||
|
||||
subtest "enabled on the project, disabled on the jobset" => {
|
||||
$build->project->update({enable_dynamic_run_command => 1});
|
||||
$build->jobset->update({enable_dynamic_run_command => 0});
|
||||
|
||||
is(
|
||||
|
@ -180,6 +194,18 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
|
|||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||
);
|
||||
};
|
||||
|
||||
subtest "disabled on the project, disabled on the jobset" => {
|
||||
$build->project->update({enable_dynamic_run_command => 0});
|
||||
$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"
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue