Skip to content

Commit

Permalink
qam: Add helper function for counting PUBLISH_* variables
Browse files Browse the repository at this point in the history
Add a helper function which will return if (and how many) PUBLISH_*
veriables are set on the job. This can be used for deciding whether
minor issues should cause a test to fail, or softfail in order to
allow dependent jobs to run.
  • Loading branch information
mdoucha committed Aug 20, 2024
1 parent a24141d commit ed0f0a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/qam.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use version_utils qw(is_sle is_transactional);

our @EXPORT
= qw(capture_state check_automounter is_patch_needed add_test_repositories disable_test_repositories enable_test_repositories
add_extra_customer_repositories ssh_add_test_repositories remove_test_repositories advance_installer_window get_patches check_patch_variables add_repo_if_not_present);
add_extra_customer_repositories ssh_add_test_repositories remove_test_repositories advance_installer_window get_patches check_patch_variables add_repo_if_not_present
has_published_assets);
use constant ZYPPER_PACKAGE_COL => 1;
use constant OLD_ZYPPER_STATUS_COL => 4;
use constant ZYPPER_STATUS_COL => 5;
Expand Down Expand Up @@ -243,4 +244,9 @@ sub check_patch_variables {
}
}

# Return count of PUBLISH_* job variables
sub has_published_assets {
return scalar grep { m/^PUBLISH_/ } keys %bmwqemu::vars;
}

1;

0 comments on commit ed0f0a7

Please sign in to comment.