Skip to content

Commit

Permalink
vars/kola: Add support for skipping a list of kola tags
Browse files Browse the repository at this point in the history
Introduce a kola parameter to allow skipping a list of kola tags.
This is particularly useful when adding new streams to the pipeline.

xref: coreos/fedora-coreos-pipeline#1008

Reference: coreos/fedora-coreos-pipeline#1002
  • Loading branch information
marmijo committed Jun 21, 2024
1 parent cf8e6a1 commit 6e02c18
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions vars/kola.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// skipBasicScenarios boolean -- skip basic qemu scenarios (ignored if cosa has https://github.com/coreos/coreos-assembler/pull/3652)
// skipSecureBoot boolean -- skip secureboot tests
// skipUpgrade: boolean -- skip running `cosa kola --upgrades`
// skipKolaTags: []string -- list of kola tags to skip
// build: string -- cosa build ID to target
// platformArgs: string -- platform-specific kola args (e.g. '-p aws --aws-ami ...`)
// extraArgs: string -- additional kola args for `kola run` (e.g. `ext.*`)
Expand Down Expand Up @@ -102,6 +103,13 @@ def call(params = [:]) {
args += " --exttest=${env.WORKSPACE}/${path}"
}

def skipKolaTags = params.get('skipKolaTags', "")
def skipKolaTagsArgs = ""

for (tag in skipKolaTags) {
skipKolaTagsArgs += "--tag=!${tag} "
}

if (platformArgs != "" || extraArgs != "") {
// There are two cases where we land here:
// 1. The user passed `platformArgs`, which implies we're
Expand All @@ -114,7 +122,7 @@ def call(params = [:]) {
// do a single run in that case.
id = marker == "" ? "kola" : "kola-${marker}"
ids += id
runKola(id, 'run', "--parallel=${parallel} ${args} ${extraArgs}")
runKola(id, 'run', "--parallel=${parallel} ${args} ${extraArgs} ${skipKolaTagsArgs}")
} else {
// Check if the basic tests are registered kola tests or not.
def availableTests = shwrapCapture("kola list --json | jq -r '.[].Name'").split()
Expand All @@ -140,12 +148,12 @@ def call(params = [:]) {
// normal run (without reprovision tests because those require a lot of memory)
id = marker == "" ? "kola" : "kola-${marker}"
ids += id
runKola(id, 'run', "--tag='!reprovision' --parallel=${parallel} ${args}")
runKola(id, 'run', "--tag='!reprovision' ${skipKolaTagsArgs} --parallel=${parallel} ${args}")

// re-provision tests (not run with --parallel argument to kola)
id = marker == "" ? "kola-reprovision" : "kola-reprovision-${marker}"
ids += id
runKola(id, 'run', "--tag='reprovision' ${args}")
runKola(id, 'run', "--tag='reprovision' ${skipKolaTagsArgs} ${args}")
}
}

Expand All @@ -157,7 +165,7 @@ def call(params = [:]) {
def id = marker == "" ? "kola-upgrade" : "kola-upgrade-${marker}"
ids += id
try {
runKola(id, 'run-upgrade', "--upgrades")
runKola(id, 'run-upgrade', "--upgrades ${skipKolaTagsArgs}")
} catch(e) {
// If we didn't even get logs then let's remove them from the list
if (shwrapRc("cd ${cosaDir} && cosa shell -- test -d ${outputDir}/${id}") != 0) {
Expand Down

0 comments on commit 6e02c18

Please sign in to comment.