From f30f0ed13961a1377f09e1bfffe4ab9b6bfb6ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 2 Dec 2019 19:56:42 +0100 Subject: [PATCH] add optional TR_CASE_IDS argument to e2e PR tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ci/tests/Jenkinsfile.e2e-prs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ci/tests/Jenkinsfile.e2e-prs b/ci/tests/Jenkinsfile.e2e-prs index d20dc7c9fc..563c768ab3 100644 --- a/ci/tests/Jenkinsfile.e2e-prs +++ b/ci/tests/Jenkinsfile.e2e-prs @@ -26,6 +26,10 @@ pipeline { name: 'PR_ID', description: 'ID of the Pull Request triggering this build.', ) + string( + name: 'TR_CASE_IDS', + description: 'IDs of the TestRail case, separated by a comma. (Optional)', + ) } options { @@ -33,6 +37,12 @@ pipeline { } stages { + stage('Checks') { + steps { script { + if (params.APK_NAME == null) { error("APK_NAME parameter not set!") } + if (params.PR_ID == null) { error("PR_ID parameter not set!") } + } } + } stage('Setup') { steps { script { dir('test/appium') { @@ -43,6 +53,11 @@ pipeline { stage('Test') { steps { script { currentBuild.displayName = "PR-${params.PR_ID}" + /* for managing optional arguments */ + def extraPytestOpts = "" + if (params.TR_CASE_IDS != "") { + extraPytestOpts = "--run_testrail_ids='${params.TR_CASE_IDS}'" + } withCredentials([ string( @@ -69,7 +84,8 @@ pipeline { --network=${params.NETWORK} \ --apk=${params.APK_NAME} \ --build=PR-${params.PR_ID} \ - --pr_number=${params.PR_ID} + --pr_number=${params.PR_ID} \ + ${extraPytestOpts} """ } }