add optional TR_CASE_IDS argument to e2e PR tests

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-12-02 19:56:42 +01:00
parent 94c7953f30
commit f30f0ed139
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 17 additions and 1 deletions

View File

@ -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}
"""
}
}