2023-09-28 12:44:13 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
library 'status-jenkins-lib@v1.7.13'
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
label 'linux && x86_64 && qt-5.15.2'
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2023-10-06 08:33:42 +00:00
|
|
|
QT_QPA_PLATFORMTHEME = "qt5ct"
|
|
|
|
QT_LOGGING_DEBUG = 1
|
|
|
|
QT_DEBUG_PLUGINS = 1
|
|
|
|
|
2023-09-28 12:44:13 +00:00
|
|
|
SQUISH_DIR = "/opt/squish-runner-7.1-20230222-1555"
|
|
|
|
PYTHONPATH = "${SQUISH_DIR}/lib:${SQUISH_DIR}/lib/python:${PYTHONPATH}"
|
|
|
|
LD_LIBRARY_PATH = "${SQUISH_DIR}/lib:${SQUISH_DIR}/python3/lib:${LD_LIBRARY_PATH}"
|
|
|
|
|
2023-10-10 08:30:56 +00:00
|
|
|
TESTRAIL_CREDS = credentials('test-rail-api-devops')
|
2023-09-28 12:44:13 +00:00
|
|
|
TESTRAIL_URL = "https://ethstatus.testrail.net"
|
2023-10-10 08:30:56 +00:00
|
|
|
|
|
|
|
CI_CREDS = credentials('status-im-auto')
|
2023-09-28 12:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
2023-10-09 09:38:48 +00:00
|
|
|
|
|
|
|
gitParameter(
|
|
|
|
branch: '',
|
|
|
|
branchFilter: 'origin/(.*)',
|
|
|
|
defaultValue: 'master',
|
|
|
|
description: 'Git branch to checkout.',
|
|
|
|
name: 'GIT_REF',
|
|
|
|
quickFilterEnabled: false,
|
|
|
|
selectedValue: 'DEFAULT',
|
|
|
|
sortMode: 'ASCENDING_SMART',
|
|
|
|
tagFilter: '*',
|
|
|
|
type: 'PT_BRANCH'
|
|
|
|
)
|
2023-09-28 12:44:13 +00:00
|
|
|
string(
|
|
|
|
name: 'BUILD',
|
2023-10-10 08:30:56 +00:00
|
|
|
description: 'Link to tar.gz file.',
|
|
|
|
defaultValue: ''
|
2023-09-28 12:44:13 +00:00
|
|
|
)
|
|
|
|
string(
|
|
|
|
name: 'TEST_NAME',
|
2023-10-09 09:38:48 +00:00
|
|
|
description: 'Paste test name/part of test name to run specific test.',
|
2023-09-28 12:44:13 +00:00
|
|
|
defaultValue: ''
|
|
|
|
)
|
|
|
|
string(
|
|
|
|
name: 'TEST_SCOPE',
|
2023-10-09 09:38:48 +00:00
|
|
|
description: 'Paste tag to run specific scope of tests.',
|
2023-09-28 12:44:13 +00:00
|
|
|
defaultValue: ''
|
|
|
|
)
|
|
|
|
string(
|
|
|
|
name: 'TESTRAIL_RUN_ID',
|
2023-10-09 09:38:48 +00:00
|
|
|
description: 'Test run ID in Test Rail.',
|
2023-09-28 12:44:13 +00:00
|
|
|
defaultValue: ''
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
|
|
|
timeout(time: 120, unit: 'MINUTES')
|
|
|
|
/* manage how many builds we keep */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
artifactNumToKeepStr: '3',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Download') {
|
2023-10-10 08:30:56 +00:00
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
sh "mkdir '${env.WORKSPACE}/tmp/'"
|
|
|
|
}
|
|
|
|
fileOperations([
|
|
|
|
fileDownloadOperation(url:"${params.BUILD}", userName:"${CI_CREDS_USR}", password:"${CI_CREDS_PSW}", targetLocation:"./tmp", targetFileName:"StatusIm-Desktop.tar.gz", proxyHost:"", proxyPort:"")
|
|
|
|
])
|
|
|
|
script {
|
|
|
|
sh "tar -zxvf '${env.WORKSPACE}/tmp/StatusIm-Desktop.tar.gz' -C '${env.WORKSPACE}/tmp'"
|
|
|
|
env.APP_DIR = "${env.WORKSPACE}/${utils.findFile('tmp/*.AppImage')}"
|
|
|
|
}
|
|
|
|
}
|
2023-09-28 12:44:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stage('Setup') {
|
|
|
|
steps { script {
|
|
|
|
sh 'pip3 install --user -r requirements.txt'
|
|
|
|
} }
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Test') {
|
|
|
|
steps { wrap([
|
|
|
|
$class: 'Xvfb',
|
|
|
|
autoDisplayName: true,
|
2023-10-06 08:33:42 +00:00
|
|
|
parallelBuild: true,
|
2023-09-28 12:44:13 +00:00
|
|
|
screen: '1920x1080x24',
|
2023-10-09 09:38:48 +00:00
|
|
|
additionalOptions: '-dpi 1'
|
2023-09-28 12:44:13 +00:00
|
|
|
]) { script {
|
2023-10-06 08:33:42 +00:00
|
|
|
sh "fluxbox &"
|
2023-10-10 08:30:56 +00:00
|
|
|
env.TESTRAIL_USR = "${TESTRAIL_CREDS_USR}"
|
|
|
|
env.TESTRAIL_PWD = "${TESTRAIL_CREDS_PSW}"
|
2023-09-28 12:44:13 +00:00
|
|
|
def cmd = ''
|
|
|
|
if (params.TEST_NAME != "") {
|
|
|
|
cmd = cmd + " -k ${params.TEST_NAME}"
|
|
|
|
}
|
|
|
|
if (params.TEST_SCOPE != "") {
|
|
|
|
cmd = cmd + " -m ${params.TEST_SCOPE}"
|
|
|
|
}
|
|
|
|
sh "cp -f '${env.WORKSPACE}'/configs/_local.py.ci '${env.WORKSPACE}'/configs/_local.py"
|
|
|
|
sh "python3 -m pytest ${cmd} --disable-warnings --alluredir=${env.WORKSPACE}/allure-results"
|
|
|
|
}}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always { script {
|
|
|
|
allure([
|
|
|
|
jdk: '',
|
|
|
|
properties: [],
|
|
|
|
results: [[path: 'allure-results']],
|
|
|
|
reportBuildPolicy: 'ALWAYS',
|
|
|
|
])
|
|
|
|
}}
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|