Skip to content

Commit

Permalink
kola: really make requiredTag required
Browse files Browse the repository at this point in the history
Before, even though a test had a required tag, explicitly passing a
pattern which matched that test name would still include it. I thought
that would be convenient, but it makes the logic less predictable. Since
we don't use many required tags today, let's instead opt for being more
explicit and always actually require the tag.

Motivated by coreos/rpm-ostree#4806 (comment).
  • Loading branch information
jlebon committed Jan 31, 2024
1 parent 03dc753 commit bc4f3ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,10 @@ func filterTests(tests map[string]*register.Test, patterns []string, pltfrm stri
}

if t.RequiredTag != "" && // if the test has a required tag...
!HasString(t.RequiredTag, positiveTags) && // and that tag was not provided by the user...
(!userTypedPattern || !nameMatch) { // and the user didn't request it by name...
!HasString(t.RequiredTag, positiveTags) { // and that tag was not provided by the user
if userTypedPattern && nameMatch {
fmt.Printf("⏭️ Skipping kola test \"%s\" with required tag \"%s\"\n", t.Name, t.RequiredTag)
}
continue // then skip it
}

Expand Down

0 comments on commit bc4f3ac

Please sign in to comment.