From 14d0c309909ed707fbcb9d8bf0469b0d95e9aef1 Mon Sep 17 00:00:00 2001 From: mprahl Date: Wed, 15 May 2019 13:27:50 -0400 Subject: [PATCH] Add a try/catch around the grant-cg-access code in the integration tests Since there's no way of knowing if the user has already been granted access, this wraps this code and just ignores the failure. --- .../pipelines/tests/module-build-cgimport.groovy | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openshift/integration/koji/pipelines/tests/module-build-cgimport.groovy b/openshift/integration/koji/pipelines/tests/module-build-cgimport.groovy index 123da46c..90cd3bf3 100644 --- a/openshift/integration/koji/pipelines/tests/module-build-cgimport.groovy +++ b/openshift/integration/koji/pipelines/tests/module-build-cgimport.groovy @@ -11,12 +11,18 @@ def runTests() { if (!tags.any { it.name == "module-f28-build" }) { koji.addTag("module-f28-build", "--parent=module-f28", "--arches=x86_64") } - // There's currently no way to query whether a given user has CG access, so just add it - // and hope no one else has already done it. - koji.runCmd("grant-cg-access", "mbs-${TEST_ID}-koji-admin", "module-build-service", "--new") + try { + // There's currently no way to query whether a given user has CG access, so just add it + // and hope no one else has already done it. + koji.runCmd("grant-cg-access", "mbs-${TEST_ID}-koji-admin", "module-build-service", "--new") + } catch (ex) { + echo "Granting cg-access to mbs-${TEST_ID}-koji-admin failed, assuming it was already provided in a previous test" + } + if (!koji.callMethod("listBTypes").any { it.name == "module" }) { koji.callMethodLogin("addBType", "module") } + def buildparams = """ {"scmurl": "https://src.fedoraproject.org/forks/mikeb/modules/testmodule.git?#8b3fb16160f899ce10905faf570f110d52b91154", "branch": "empty-f28",