RunCommand: Add a WIP execution of dynamic commands
This in-progress feature will run a dynamically generated set of buildFinished hooks, which must be nested under the `runCommandHook.*` attribute set. This implementation is not very good, with some to-dos: 1. Only run if the build succeeded 2. Verify the output is named $out and that it is an executable file (or a symlink to a file) 3. Require the jobset itself have a flag enabling the feature, since this feature can be a bit dangerous if various people of different trust levels can create the jobs.
This commit is contained in:
@ -249,44 +249,4 @@ subtest "eventMatches" => sub {
|
||||
);
|
||||
};
|
||||
|
||||
subtest "fanoutToCommands" => sub {
|
||||
my $config = {
|
||||
runcommand => [
|
||||
{
|
||||
job => "",
|
||||
command => "foo"
|
||||
},
|
||||
{
|
||||
job => "project:*:*",
|
||||
command => "bar"
|
||||
},
|
||||
{
|
||||
job => "project:jobset:nomatch",
|
||||
command => "baz"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
is(
|
||||
Hydra::Plugin::RunCommand::fanoutToCommands(
|
||||
$config,
|
||||
"buildFinished",
|
||||
"project",
|
||||
"jobset",
|
||||
"job"
|
||||
),
|
||||
[
|
||||
{
|
||||
matcher => "",
|
||||
command => "foo"
|
||||
},
|
||||
{
|
||||
matcher => "project:*:*",
|
||||
command => "bar"
|
||||
}
|
||||
],
|
||||
"fanoutToCommands returns a command per matching job"
|
||||
);
|
||||
};
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user