finish making the dynamic hooks only run on project & jobset agreement

This commit is contained in:
Graham Christensen 2021-12-15 12:36:19 -05:00
parent aef11685a0
commit 0810f5debc
2 changed files with 11 additions and 5 deletions

View file

@ -71,9 +71,15 @@ sub isBuildEligibleForDynamicRunCommand {
return 0; return 0;
} }
if ($build->jobset->enable_dynamic_run_command) { if (! $build->jobset->enable_dynamic_run_command) {
return 1; return 0;
} }
if (! $build->project->enable_dynamic_run_command) {
return 0;
}
return 1;
} }
return 0; return 0;

View file

@ -173,7 +173,7 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
}; };
subtest "With dynamic runcommand disabled ..." => sub { subtest "With dynamic runcommand disabled ..." => sub {
subtest "disabled on the project, enabled on the jobset" => { subtest "disabled on the project, enabled 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 => 1}); $build->jobset->update({enable_dynamic_run_command => 1});
@ -184,7 +184,7 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
); );
}; };
subtest "enabled on the project, disabled on the jobset" => { 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});
@ -195,7 +195,7 @@ subtest "isBuildEligibleForDynamicRunCommand" => sub {
); );
}; };
subtest "disabled on the project, disabled on the jobset" => { 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});