Skip to content

Commit

Permalink
Check for YAML_SCHEDULE file
Browse files Browse the repository at this point in the history
Improve the error output in case the test points to a non-existing
YAML_SCHEDULE file.
  • Loading branch information
grisu48 committed Apr 5, 2023
1 parent f7e3dc0 commit b08b081
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/scheduler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,14 @@ Parse variables and test modules from a yaml file representing a test suite to b

sub load_yaml_schedule {
if (my $yamlfile = get_var('YAML_SCHEDULE')) {
my $schedule_file = $ypp->load_file($root_project_dir . $yamlfile);
my $filename = $root_project_dir . $yamlfile;
if (!-e $filename) {
# Write error to log to give the user the chance to understand, what went wrong
diag("YAML_SCHEDULE file not found: '$filename'");
# Note that openQA will terminate with "unable to load main.pm, check the log for the cause" on error at this stage.
die "Provided YAML_SCHEDULE does not exist";
}
my $schedule_file = $ypp->load_file($filename);
my %schedule_vars = parse_vars($schedule_file);
my $test_context_instance = undef;
while (my ($var, $value) = each %schedule_vars) { set_var($var, $value) }
Expand Down

0 comments on commit b08b081

Please sign in to comment.