2018-02-22 22:11:27 +03:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
2018-07-19 02:29:43 +03:00
|
|
|
def branch = env.BRANCH_NAME ?: 'master'
|
|
|
|
|
2017-02-22 21:29:12 +03:00
|
|
|
/** Desired capabilities */
|
2017-01-20 22:05:36 +03:00
|
|
|
def capabilities = [
|
|
|
|
browserName: 'Firefox',
|
2019-05-07 08:22:09 +03:00
|
|
|
version: '66.0',
|
2017-03-01 12:54:11 +03:00
|
|
|
platform: 'Windows 10'
|
2017-01-20 22:05:36 +03:00
|
|
|
]
|
|
|
|
|
2017-02-22 21:29:12 +03:00
|
|
|
pipeline {
|
|
|
|
agent any
|
2017-08-07 21:44:44 +03:00
|
|
|
libraries {
|
2018-06-27 17:14:30 +03:00
|
|
|
lib('fxtest@1.10')
|
2017-08-07 21:44:44 +03:00
|
|
|
}
|
2018-02-15 18:55:39 +03:00
|
|
|
triggers {
|
2018-07-19 02:29:43 +03:00
|
|
|
pollSCM(branch == 'master' ? 'H/5 * * * *' : '')
|
|
|
|
cron(branch == 'master' ? 'H H * * *' : '')
|
2018-02-15 18:55:39 +03:00
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
options {
|
2017-03-14 21:33:39 +03:00
|
|
|
ansiColor('xterm')
|
2017-02-22 21:29:12 +03:00
|
|
|
timestamps()
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
2017-01-20 22:05:36 +03:00
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
environment {
|
2017-11-14 21:37:54 +03:00
|
|
|
PYTEST_PROCESSES = "${PYTEST_PROCESSES ?: "auto"}"
|
2017-04-25 15:25:55 +03:00
|
|
|
PYTEST_ADDOPTS =
|
2017-11-14 21:37:54 +03:00
|
|
|
"-n=${PYTEST_PROCESSES} " +
|
2017-04-25 15:25:55 +03:00
|
|
|
"--tb=short " +
|
|
|
|
"--color=yes " +
|
|
|
|
"--driver=SauceLabs " +
|
2018-01-10 22:39:13 +03:00
|
|
|
"--variables=capabilities.json"
|
2017-03-31 23:31:31 +03:00
|
|
|
PULSE = credentials('PULSE')
|
2017-11-14 02:22:49 +03:00
|
|
|
SAUCELABS = credentials('SAUCELABS')
|
2017-01-20 22:05:36 +03:00
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
stages {
|
|
|
|
stage('Lint') {
|
2018-01-10 22:39:13 +03:00
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
steps {
|
|
|
|
sh "tox -e flake8"
|
|
|
|
}
|
2017-01-20 22:05:36 +03:00
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
stage('Test') {
|
2018-01-10 22:39:13 +03:00
|
|
|
parallel {
|
|
|
|
stage('py36') {
|
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
writeCapabilities(capabilities, 'capabilities.json')
|
|
|
|
sh "tox -e py36"
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
stash includes: 'results/py36.html', name: 'py36'
|
|
|
|
archiveArtifacts 'results/*'
|
|
|
|
junit 'results/*.xml'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('py27') {
|
|
|
|
agent {
|
|
|
|
dockerfile true
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
writeCapabilities(capabilities, 'capabilities.json')
|
|
|
|
sh "tox -e py27"
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
stash includes: 'results/py27.html', name: 'py27'
|
|
|
|
archiveArtifacts 'results/*'
|
|
|
|
junit 'results/*.xml'
|
|
|
|
submitToActiveData('results/py27_raw.txt')
|
|
|
|
submitToTreeherder('fxapom', 'T', 'Tests', 'results/*', 'results/py27_tbpl.txt')
|
|
|
|
}
|
|
|
|
}
|
2017-01-20 22:05:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
post {
|
2018-01-10 22:39:13 +03:00
|
|
|
always {
|
|
|
|
unstash 'py36'
|
|
|
|
unstash 'py27'
|
|
|
|
publishHTML(target: [
|
|
|
|
allowMissing: false,
|
|
|
|
alwaysLinkToLastBuild: true,
|
|
|
|
keepAll: true,
|
|
|
|
reportDir: 'results',
|
|
|
|
reportFiles: "py36.html, py27.html",
|
|
|
|
reportName: 'HTML Report'])
|
|
|
|
}
|
|
|
|
changed {
|
|
|
|
ircNotification()
|
|
|
|
}
|
2017-02-22 21:29:12 +03:00
|
|
|
failure {
|
2017-10-27 12:46:07 +03:00
|
|
|
emailext(
|
2017-10-30 12:29:42 +03:00
|
|
|
attachLog: true,
|
2018-01-10 22:39:13 +03:00
|
|
|
attachmentsPattern: 'results/*.html',
|
2017-10-30 12:29:42 +03:00
|
|
|
body: '$BUILD_URL\n\n$FAILED_TESTS',
|
2017-10-27 12:46:07 +03:00
|
|
|
replyTo: '$DEFAULT_REPLYTO',
|
|
|
|
subject: '$DEFAULT_SUBJECT',
|
|
|
|
to: '$DEFAULT_RECIPIENTS')
|
2017-02-22 21:29:12 +03:00
|
|
|
}
|
2017-01-20 22:05:36 +03:00
|
|
|
}
|
|
|
|
}
|