From 954e0026f26f23152aa7e1b2fc3a2bb871f59103 Mon Sep 17 00:00:00 2001 From: Michael Armijo Date: Thu, 20 Jun 2024 13:49:16 -0600 Subject: [PATCH] vars/kola: Add support for skipping a list of kola tags Introduce a kola parameter to allow skipping a list of kola tags. This is particularly useful when adding new streams to the pipeline. xref: https://github.com/coreos/fedora-coreos-pipeline/pull/1008 Reference: https://github.com/coreos/fedora-coreos-pipeline/issues/1002 --- vars/kola.groovy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vars/kola.groovy b/vars/kola.groovy index f6d3e11..38da78b 100644 --- a/vars/kola.groovy +++ b/vars/kola.groovy @@ -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.*`) @@ -102,6 +103,12 @@ def call(params = [:]) { args += " --exttest=${env.WORKSPACE}/${path}" } + def skipKolaTags = params.get('skipKolaTags', []) + + for (tag in skipKolaTags) { + args += " --tag=!${tag}" + } + if (platformArgs != "" || extraArgs != "") { // There are two cases where we land here: // 1. The user passed `platformArgs`, which implies we're @@ -114,7 +121,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', "${args} ${extraArgs} --parallel=${parallel}") } else { // Check if the basic tests are registered kola tests or not. def availableTests = shwrapCapture("kola list --json | jq -r '.[].Name'").split() @@ -140,7 +147,7 @@ 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' ${args} --parallel=${parallel}") // re-provision tests (not run with --parallel argument to kola) id = marker == "" ? "kola-reprovision" : "kola-reprovision-${marker}"