Skip to content

Commit

Permalink
Cirrus: Fix skipping all/most tests
Browse files Browse the repository at this point in the history
The originally intent for skipping tests based on change-content was to
optimize the PR workflow.  However, a mistake in a conditional is
causing almost all tasks running for Cron and branches to be skipped.
Fix this by checking for an empty '$CIRRUS_PR' variable.  This value is
always empty when operating outside of PRs.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Apr 26, 2022
1 parent e7edf30 commit 1a9f110
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contrib/cirrus/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ dotest() {
function _bail_if_test_can_be_skipped() {
local head base diffs

# Cirrus sets these for PRs but not cron. In cron, we never want to skip.
for v in CIRRUS_CHANGE_IN_REPO DEST_BRANCH; do
# Cirrus sets these for PRs but not branches or cron. In cron and branches,
#we never want to skip.
for v in CIRRUS_CHANGE_IN_REPO CIRRUS_PR; do
if [[ -z "${!v}" ]]; then
msg "[ _cannot do selective skip: \$$v is undefined ]"
return 0
Expand Down

0 comments on commit 1a9f110

Please sign in to comment.