"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file ".ci/kitchen-windows2016-py3" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

kitchen-windows2016-py3  (salt-2019.2.0):kitchen-windows2016-py3  (salt-2019.2.1)
timeout(time: 6, unit: 'HOURS') { @Library('salt@1.1') _
node('kitchen-slave') {
timestamps { // Define the maximum time, in hours, that a test run should run for
ansiColor('xterm') { def testrun_timeout = 8
withEnv([ // Now define a global pipeline timeout. This is the test run timeout with one(1
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml ) additional
', // hour to allow for artifacts to be downloaded, if possible.
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml', def global_timeout = testrun_timeout + 1;
'PATH=/usr/local/rbenv/shims/:/usr/local/sbin:/usr/local/bin
:/usr/sbin:/usr/bin:/root/bin:/root/bin', def distro_name = 'windows'
'RBENV_VERSION=2.4.2', def distro_version = '2016'
'TEST_SUITE=py3', def python_version = 'py3'
'TEST_PLATFORM=windows-2016', def test_transport = 'ZeroMQ'
'PY_COLORS=1', def salt_target_branch = '2019.2.1'
]) { def golden_images_branch = '2019.2'
stage('checkout-scm') { def nox_passthrough_opts = '--unit'
cleanWs notFailBuild: true
checkout scm properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '
', daysToKeepStr: '', numToKeepStr: '10')),
parameters([
booleanParam(defaultValue: true, description: 'Run full test suite', nam
e: 'runFull')
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > 1) {
// This will cancel the previous build which also defined a matching milesto
ne
milestone(buildNumber - 1)
}
// Define a milestone for this build so that, if another build starts, this one
will be aborted
milestone(buildNumber)
wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') {
withEnv([
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/nox-platforms.yml',
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/nox-verifier.yml',
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
"NOX_ENV_NAME=runtests-${test_transport.toLowerCase()}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"SALT_TARGET_BRANCH=${salt_target_branch}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_
transport.toLowerCase()}",
'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
root/bin',
'RBENV_VERSION=2.4.2',
"TEST_SUITE=${python_version}",
"TEST_PLATFORM=${distro_name}-${distro_version}",
"TEST_TRANSPORT=${test_transport}",
"FORCE_FULL=${params.runFull}",
]) {
// Checkout the repo
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
sh 'git fetch --no-tags https://github.com/saltstack/salt.git +refs/
heads/${SALT_TARGET_BRANCH}:refs/remotes/origin/${SALT_TARGET_BRANCH}'
}
// Setup the kitchen required bundle
stage('Setup') {
sh 'bundle install --with ec2 windows --without docker macos openneb
ula vagrant'
}
stage('Create VM') {
retry(3) {
sh '''
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; echo "Exi
tCode: $?";
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro
_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_
version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-
create.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create
.log"
fi
"""
}
}
sshagent(credentials: ['jenkins-testing-ssh-key']) {
sh 'ssh-add ~/.ssh/kitchen.pem'
try {
timeout(time: testrun_timeout, unit: 'HOURS') {
stage('Converge VM') {
sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_PLATF
ORM; echo "ExitCode: $?";'
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-
${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-$
{distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_v
ersion}-converge.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitche
n-converge.log"
fi
"""
} }
try { stage('Run Tests') {
stage('github-pending') { withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
githubNotify credentialsId: 'test-jenkins-credential sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLA
s', TFORM; echo "ExitCode: $?";'
description: "running ${TEST_SUITE}-${TEST_PLATF
ORM}...",
status: 'PENDING',
context: "jenkins/pr/${TEST_SUITE}-${TEST_PLATFO
RM}"
}
stage('setup-bundle') {
sh 'bundle install --with ec2 windows --without open
nebula docker'
} }
try { }
stage('run kitchen') { }
withCredentials([ } finally {
[$class: 'AmazonWebServicesCredentialsBindin try {
g', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_ACCESS_KEY_ID', sh """
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'] if [ -s ".kitchen/logs/${python_version}-${distro_name}-${di
]) { stro_version}.log" ]; then
sshagent(credentials: ['jenkins-testing-ssh- mv ".kitchen/logs/${python_version}-${distro_name}-${dis
key']) { tro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_versi
sh 'ssh-add ~/.ssh/jenkins-testing.pem' on}-verify.log"
sh 'bundle exec kitchen converge $TEST_S fi
UITE-$TEST_PLATFORM || bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM' if [ -s ".kitchen/logs/kitchen.log" ]; then
sh 'bundle exec kitchen verify $TEST_SUI mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-ve
TE-$TEST_PLATFORM' rify.log"
} fi
} """
} stage('Download Artefacts') {
} finally { withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
stage('cleanup kitchen') { sh '''
script { bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFOR
withCredentials([ M || exit 0
[$class: 'AmazonWebServicesCredentialsBi '''
nding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_ACCESS_KEY_I
D', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']
]) {
sshagent(credentials: ['jenkins-testing-
ssh-key']) {
sh 'ssh-add ~/.ssh/jenkins-testing.p
em'
sh 'bundle exec kitchen destroy $TES
T_SUITE-$TEST_PLATFORM'
}
}
}
archiveArtifacts artifacts: 'artifacts/xml-unitt
ests-output/*.xml'
archiveArtifacts artifacts: 'artifacts/logs/mini
on'
archiveArtifacts artifacts: 'artifacts/logs/salt
-runtests.log'
}
} }
} catch (Exception e) { sh """
currentBuild.result = 'FAILURE' if [ -s ".kitchen/logs/${python_version}-${distro_name}-
} finally { ${distro_version}.log" ]; then
try { mv ".kitchen/logs/${python_version}-${distro_name}-$
junit 'artifacts/xml-unittests-output/*.xml' {distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_v
} finally { ersion}-download.log"
cleanWs notFailBuild: true fi
def currentResult = currentBuild.result ?: 'SUCCESS' if [ -s ".kitchen/logs/kitchen.log" ]; then
if (currentResult == 'SUCCESS') { mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitche
githubNotify credentialsId: 'test-jenkins-creden n-download.log"
tials', fi
description: "The ${TEST_SUITE}-${TEST_PLATF """
ORM} job has passed", }
status: 'SUCCESS', archiveArtifacts(
context: "jenkins/pr/${TEST_SUITE}-${TEST_PL artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-c
ATFORM}" reate.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/
} else { *-download.log,artifacts/xml-unittests-output/*.xml",
githubNotify credentialsId: 'test-jenkins-creden allowEmptyArchive: true
tials', )
description: "The ${TEST_SUITE}-${TEST_PLATF junit 'artifacts/xml-unittests-output/*.xml'
ORM} job has failed", } finally {
status: 'FAILURE', stage('Cleanup') {
context: "jenkins/pr/${TEST_SUITE}-${TEST_PL sh '''
ATFORM}" bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM;
slackSend channel: "#jenkins-prod-pr", echo "ExitCode: $?";
color: '#FF0000', '''
message: "FAILED: PR-Job: '${env.JOB_NAME} [ }
${env.BUILD_NUMBER}]' (${env.BUILD_URL})" stage('Upload Coverage') {
script {
withCredentials([[$class: 'StringBinding', credentia
lsId: 'codecov-upload-token-salt', variable: 'CODECOV_TOKEN']]) {
sh '''
if [ -n "${FORCE_FULL}" -a "${FORCE_FULL}" = "true
" -a -f artifacts/coverage/coverage.xml ]; then
curl -L https://codecov.io/bash | /bin/sh -s -
- -R $(pwd) -s artifacts/coverage/ -F "${CODECOV_FLAGS}" || true
fi
'''
} }
} }
} }
} }
} }
} }
} }
} }
// vim: ft=groovy
 End of changes. 5 change blocks. 
100 lines changed or deleted 176 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)