forked from lix-project/hydra
RunCommand: print a warning if the hook isn't run because the project / jobset doens't have it enabled
This commit is contained in:
parent
3aa2393091
commit
d8b56f022d
|
@ -72,6 +72,7 @@ sub isBuildEligibleForDynamicRunCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $build->jobset->supportsDynamicRunCommand()) {
|
if (! $build->jobset->supportsDynamicRunCommand()) {
|
||||||
|
warn "DynamicRunCommand hook on " . $build->job . " (" . $build->id . ") rejected: The project or jobset don't have dynamic runcommand enabled.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,33 +191,40 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
|
||||||
$build->project->update({enable_dynamic_run_command => 0});
|
$build->project->update({enable_dynamic_run_command => 0});
|
||||||
$build->jobset->update({enable_dynamic_run_command => 1});
|
$build->jobset->update({enable_dynamic_run_command => 1});
|
||||||
|
|
||||||
is(
|
|
||||||
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
like(warning {
|
||||||
0,
|
is(
|
||||||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
||||||
);
|
0,
|
||||||
|
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||||
|
);
|
||||||
|
}, qr/project or jobset don't have dynamic runcommand enabled./, "A relevant warning is provided for a disabled runcommand support")
|
||||||
};
|
};
|
||||||
|
|
||||||
subtest "enabled on the project, disabled on the jobset" => sub {
|
subtest "enabled on the project, disabled on the jobset" => sub {
|
||||||
$build->project->update({enable_dynamic_run_command => 1});
|
$build->project->update({enable_dynamic_run_command => 1});
|
||||||
$build->jobset->update({enable_dynamic_run_command => 0});
|
$build->jobset->update({enable_dynamic_run_command => 0});
|
||||||
|
|
||||||
is(
|
like(warning {
|
||||||
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
is(
|
||||||
0,
|
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
||||||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
0,
|
||||||
);
|
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||||
|
);
|
||||||
|
}, qr/project or jobset don't have dynamic runcommand enabled./, "A relevant warning is provided for a disabled runcommand support")
|
||||||
};
|
};
|
||||||
|
|
||||||
subtest "disabled on the project, disabled on the jobset" => sub {
|
subtest "disabled on the project, disabled on the jobset" => sub {
|
||||||
$build->project->update({enable_dynamic_run_command => 0});
|
$build->project->update({enable_dynamic_run_command => 0});
|
||||||
$build->jobset->update({enable_dynamic_run_command => 0});
|
$build->jobset->update({enable_dynamic_run_command => 0});
|
||||||
|
|
||||||
is(
|
like(warning {
|
||||||
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
is(
|
||||||
0,
|
Hydra::Plugin::RunCommand::isBuildEligibleForDynamicRunCommand($builds->{"runCommandHook.example"}),
|
||||||
"Builds don't run from a jobset with disabled dynamic runcommand"
|
0,
|
||||||
);
|
"Builds don't run from a jobset with disabled dynamic runcommand"
|
||||||
|
);
|
||||||
|
}, qr/project or jobset don't have dynamic runcommand enabled./, "A relevant warning is provided for a disabled runcommand support")
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue