mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 08:35:21 +00:00
Merge branch 'master' into port-50197
This commit is contained in:
commit
686fc03101
16
.ci/docs
16
.ci/docs
@ -2,7 +2,6 @@
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def global_timeout = 2
|
||||
def salt_target_branch = 'master'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
@ -41,13 +40,22 @@ wrappedNode('docs', global_timeout, '#jenkins-prod-pr') {
|
||||
'''
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
stage('Build HTML Docs') {
|
||||
sh shell_header + '''
|
||||
eval "$(pyenv init -)"
|
||||
pyenv shell 3.6.8
|
||||
nox -e docs
|
||||
nox -e 'docs-html(compress=True)'
|
||||
'''
|
||||
archiveArtifacts artifacts: 'doc/doc-archive.tar.gz'
|
||||
archiveArtifacts artifacts: 'doc/html-archive.tar.gz'
|
||||
}
|
||||
|
||||
stage('Build Man Pages') {
|
||||
sh shell_header + '''
|
||||
eval "$(pyenv init -)"
|
||||
pyenv shell 3.6.8
|
||||
nox -e 'docs-man(compress=True, update=False)'
|
||||
'''
|
||||
archiveArtifacts artifacts: 'doc/man-archive.tar.gz'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'amazon'
|
||||
def distro_version = '1'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'amazon'
|
||||
def distro_version = '2'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'amazon'
|
||||
def distro_version = '2'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'arch'
|
||||
def distro_version = 'lts'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '-n integration.modules.test_pkg'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'arch'
|
||||
def distro_version = 'lts'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '-n integration.modules.test_pkg'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '6'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
35
.ci/kitchen-centos7-py2-cloud
Normal file
35
.ci/kitchen-centos7-py2-cloud
Normal file
@ -0,0 +1,35 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-cloud'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-centos7-py2-m2crypto
Normal file
45
.ci/kitchen-centos7-py2-m2crypto
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq-m2crypto'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
46
.ci/kitchen-centos7-py2-proxy
Normal file
46
.ci/kitchen-centos7-py2-proxy
Normal file
@ -0,0 +1,46 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--proxy'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label,
|
||||
extra_codecov_flags: ["proxy"])
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-centos7-py2-pycryptodomex
Normal file
45
.ci/kitchen-centos7-py2-pycryptodomex
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq-pycryptodomex'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'TCP'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-tcp'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
45
.ci/kitchen-centos7-py2-tornado
Normal file
45
.ci/kitchen-centos7-py2-tornado
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-tornado'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
35
.ci/kitchen-centos7-py3-cloud
Normal file
35
.ci/kitchen-centos7-py3-cloud
Normal file
@ -0,0 +1,35 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-cloud'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-centos7-py3-m2crypto
Normal file
45
.ci/kitchen-centos7-py3-m2crypto
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq-m2crypto'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
46
.ci/kitchen-centos7-py3-proxy
Normal file
46
.ci/kitchen-centos7-py3-proxy
Normal file
@ -0,0 +1,46 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--proxy'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label,
|
||||
extra_codecov_flags: ["proxy"])
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-centos7-py3-pycryptodomex
Normal file
45
.ci/kitchen-centos7-py3-pycryptodomex
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq-pycryptodomex'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'centos'
|
||||
def distro_version = '7'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'TCP'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-tcp'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'debian'
|
||||
def distro_version = '10'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'debian'
|
||||
def distro_version = '8'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'debian'
|
||||
def distro_version = '9'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'debian'
|
||||
def distro_version = '9'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,159 +0,0 @@
|
||||
@Library('salt@1.1') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'fedora'
|
||||
def distro_version = '29'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: '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 milestone
|
||||
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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
@ -1,159 +0,0 @@
|
||||
@Library('salt@1.1') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'fedora'
|
||||
def distro_version = '29'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: '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 milestone
|
||||
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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'fedora'
|
||||
def distro_version = '30'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'fedora'
|
||||
def distro_version = '30'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
146
.ci/kitchen-macosxhighsierra-py2
Normal file
146
.ci/kitchen-macosxhighsierra-py2
Normal file
@ -0,0 +1,146 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'highsierra'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'NOX_ENABLE_FROM_FILENAMES=true',
|
||||
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
|
||||
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
|
||||
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
sh '''
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
|
||||
do
|
||||
prlctl stop $i --kill
|
||||
done
|
||||
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
|
||||
do
|
||||
prlctl delete $i
|
||||
done
|
||||
'''
|
||||
}
|
||||
// Checkout the repo
|
||||
stage('Clone') {
|
||||
cleanWs notFailBuild: true
|
||||
checkout scm
|
||||
}
|
||||
|
||||
// Setup the kitchen required bundle
|
||||
stage('Setup') {
|
||||
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
sh '''
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: ft=groovy
|
146
.ci/kitchen-macosxhighsierra-py3
Normal file
146
.ci/kitchen-macosxhighsierra-py3
Normal file
@ -0,0 +1,146 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'highsierra'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'NOX_ENABLE_FROM_FILENAMES=true',
|
||||
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
|
||||
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
|
||||
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
sh '''
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
|
||||
do
|
||||
prlctl stop $i --kill
|
||||
done
|
||||
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
|
||||
do
|
||||
prlctl delete $i
|
||||
done
|
||||
'''
|
||||
}
|
||||
// Checkout the repo
|
||||
stage('Clone') {
|
||||
cleanWs notFailBuild: true
|
||||
checkout scm
|
||||
}
|
||||
|
||||
// Setup the kitchen required bundle
|
||||
stage('Setup') {
|
||||
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
sh '''
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: ft=groovy
|
@ -1,4 +1,4 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
@ -9,13 +9,14 @@ def global_timeout = testrun_timeout + 1;
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'mojave'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,29 +24,26 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=runtests-${test_transport.toLowerCase()}",
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'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=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"TEST_TRANSPORT=${test_transport}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
@ -65,7 +63,6 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
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
|
||||
@ -88,7 +85,7 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
|
||||
@ -128,15 +125,18 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
@ -9,13 +9,14 @@ def global_timeout = testrun_timeout + 1;
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'mojave'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,29 +24,26 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=runtests-${test_transport.toLowerCase()}",
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'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=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"TEST_TRANSPORT=${test_transport}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
@ -65,7 +63,6 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
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
|
||||
@ -88,7 +85,7 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
|
||||
@ -128,15 +125,18 @@ wrappedNode('kitchen-slave-mac', global_timeout, '#jenkins-prod-pr') {
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
146
.ci/kitchen-macosxsierra-py2
Normal file
146
.ci/kitchen-macosxsierra-py2
Normal file
@ -0,0 +1,146 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'sierra'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'NOX_ENABLE_FROM_FILENAMES=true',
|
||||
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
|
||||
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
|
||||
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
sh '''
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
|
||||
do
|
||||
prlctl stop $i --kill
|
||||
done
|
||||
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
|
||||
do
|
||||
prlctl delete $i
|
||||
done
|
||||
'''
|
||||
}
|
||||
// Checkout the repo
|
||||
stage('Clone') {
|
||||
cleanWs notFailBuild: true
|
||||
checkout scm
|
||||
}
|
||||
|
||||
// Setup the kitchen required bundle
|
||||
stage('Setup') {
|
||||
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
sh '''
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: ft=groovy
|
146
.ci/kitchen-macosxsierra-py3
Normal file
146
.ci/kitchen-macosxsierra-py3
Normal file
@ -0,0 +1,146 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'macosx'
|
||||
def distro_version = 'sierra'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = ''
|
||||
def concurrent_builds = 1
|
||||
def jenkins_slave_label = 'kitchen-slave-mac'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
|
||||
withEnv([
|
||||
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
|
||||
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
|
||||
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
|
||||
"NOX_ENV_NAME=${nox_env_name}",
|
||||
'NOX_ENABLE_FROM_FILENAMES=true',
|
||||
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
|
||||
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
|
||||
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"TEST_SUITE=${python_version}",
|
||||
"TEST_PLATFORM=${distro_name}-${distro_version}",
|
||||
"FORCE_FULL=${params.runFull}",
|
||||
]) {
|
||||
stage('VM Cleanup') {
|
||||
sh '''
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
|
||||
do
|
||||
prlctl stop $i --kill
|
||||
done
|
||||
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
|
||||
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
|
||||
do
|
||||
prlctl delete $i
|
||||
done
|
||||
'''
|
||||
}
|
||||
// Checkout the repo
|
||||
stage('Clone') {
|
||||
cleanWs notFailBuild: true
|
||||
checkout scm
|
||||
}
|
||||
|
||||
// Setup the kitchen required bundle
|
||||
stage('Setup') {
|
||||
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
sh '''
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
def distro_strings = [
|
||||
distro_name,
|
||||
distro_version
|
||||
]
|
||||
def report_strings = (
|
||||
[python_version] + nox_env_name.split('-')
|
||||
).flatten()
|
||||
uploadCodeCoverage(
|
||||
report_path: 'artifacts/coverage/coverage.xml',
|
||||
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
|
||||
report_flags: ([distro_strings.join('')] + report_strings).flatten()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'opensuse'
|
||||
def distro_version = '15'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'opensuse'
|
||||
def distro_version = '15'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
45
.ci/kitchen-ubuntu1604-py2-m2crypto
Normal file
45
.ci/kitchen-ubuntu1604-py2-m2crypto
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq-m2crypto'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
46
.ci/kitchen-ubuntu1604-py2-proxy
Normal file
46
.ci/kitchen-ubuntu1604-py2-proxy
Normal file
@ -0,0 +1,46 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--proxy'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label,
|
||||
extra_codecov_flags: ["proxy"])
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-ubuntu1604-py2-pycryptodomex
Normal file
45
.ci/kitchen-ubuntu1604-py2-pycryptodomex
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-zeromq-pycryptodomex'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'TCP'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-tcp'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
45
.ci/kitchen-ubuntu1604-py2-tornado
Normal file
45
.ci/kitchen-ubuntu1604-py2-tornado
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py2'
|
||||
def nox_env_name = 'runtests-tornado'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
45
.ci/kitchen-ubuntu1604-py3-m2crypto
Normal file
45
.ci/kitchen-ubuntu1604-py3-m2crypto
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq-m2crypto'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
46
.ci/kitchen-ubuntu1604-py3-proxy
Normal file
46
.ci/kitchen-ubuntu1604-py3-proxy
Normal file
@ -0,0 +1,46 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--proxy'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label,
|
||||
extra_codecov_flags: ["proxy"])
|
||||
|
||||
// vim: ft=groovy
|
45
.ci/kitchen-ubuntu1604-py3-pycryptodomex
Normal file
45
.ci/kitchen-ubuntu1604-py3-pycryptodomex
Normal file
@ -0,0 +1,45 @@
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py3'
|
||||
def nox_env_name = 'runtests-zeromq-pycryptodomex'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
])
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// Define a milestone for this build so that, if another build starts, this one will be aborted
|
||||
milestone(buildNumber)
|
||||
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1604'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'TCP'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-tcp'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1804'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 6
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'ubuntu'
|
||||
def distro_version = '1804'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--ssh-tests'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = true
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,137 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula vagrant'
|
||||
}
|
||||
|
||||
stage('Create VM') {
|
||||
retry(3) {
|
||||
sh '''
|
||||
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
|
||||
cp -f ~/workspace/spot.yml .kitchen.local.yml
|
||||
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM || (bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; rm .kitchen.local.yml; bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM); 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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 8
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'windows'
|
||||
def distro_version = '2016'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--unit'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = false
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,136 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula 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 "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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 8
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'windows'
|
||||
def distro_version = '2016'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--unit'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = false
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,136 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula 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 "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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 8
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'windows'
|
||||
def distro_version = '2019'
|
||||
def python_version = 'py2'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--unit'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = false
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,136 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula 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 "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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
@ -1,21 +1,20 @@
|
||||
@Library('salt@1.1') _
|
||||
@Library('salt@master-1.3') _
|
||||
|
||||
// Define the maximum time, in hours, that a test run should run for
|
||||
def testrun_timeout = 8
|
||||
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
|
||||
// hour to allow for artifacts to be downloaded, if possible.
|
||||
def global_timeout = testrun_timeout + 1;
|
||||
|
||||
def distro_name = 'windows'
|
||||
def distro_version = '2019'
|
||||
def python_version = 'py3'
|
||||
def test_transport = 'ZeroMQ'
|
||||
def salt_target_branch = 'master'
|
||||
def golden_images_branch = '2019.2'
|
||||
def nox_env_name = 'runtests-zeromq'
|
||||
def golden_images_branch = 'master'
|
||||
def nox_passthrough_opts = '--unit'
|
||||
def concurrent_builds = 1
|
||||
def use_spot_instances = false
|
||||
def jenkins_slave_label = 'kitchen-slave'
|
||||
|
||||
properties([
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
|
||||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
|
||||
parameters([
|
||||
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
|
||||
])
|
||||
@ -23,136 +22,24 @@ properties([
|
||||
|
||||
// Be sure to cancel any previously running builds
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) {
|
||||
if (buildNumber > concurrent_builds) {
|
||||
// This will cancel the previous build which also defined a matching milestone
|
||||
milestone(buildNumber - 1)
|
||||
milestone(buildNumber - concurrent_builds)
|
||||
}
|
||||
// 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',
|
||||
'RBENV_VERSION=2.6.3',
|
||||
"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 opennebula 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 "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_version}-create.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
sh '''
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
|
||||
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
|
||||
'''
|
||||
}
|
||||
|
||||
try {
|
||||
timeout(time: testrun_timeout, unit: 'HOURS') {
|
||||
stage('Converge VM') {
|
||||
sh '''
|
||||
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; 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_version}-converge.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
stage('Run Tests') {
|
||||
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
|
||||
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
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}-verify.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
|
||||
fi
|
||||
"""
|
||||
stage('Download Artefacts') {
|
||||
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
|
||||
sh '''
|
||||
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
|
||||
'''
|
||||
}
|
||||
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}-download.log"
|
||||
fi
|
||||
if [ -s ".kitchen/logs/kitchen.log" ]; then
|
||||
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
|
||||
fi
|
||||
"""
|
||||
}
|
||||
archiveArtifacts(
|
||||
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
|
||||
allowEmptyArchive: true
|
||||
)
|
||||
junit 'artifacts/xml-unittests-output/*.xml'
|
||||
} finally {
|
||||
stage('Cleanup') {
|
||||
sh '''
|
||||
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
|
||||
'''
|
||||
}
|
||||
stage('Upload Coverage') {
|
||||
script {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: '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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
runTests(
|
||||
env: env,
|
||||
distro_name: distro_name,
|
||||
distro_version: distro_version,
|
||||
python_version: python_version,
|
||||
golden_images_branch: golden_images_branch,
|
||||
nox_env_name: nox_env_name,
|
||||
nox_passthrough_opts: nox_passthrough_opts,
|
||||
testrun_timeout: testrun_timeout,
|
||||
run_full: params.runFull,
|
||||
use_spot_instances: use_spot_instances,
|
||||
jenkins_slave_label: jenkins_slave_label)
|
||||
|
||||
// vim: ft=groovy
|
||||
|
1
.ci/lint
1
.ci/lint
@ -30,7 +30,6 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') {
|
||||
stage('checkout-scm') {
|
||||
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
|
||||
|
64
.codecov.yml
64
.codecov.yml
@ -6,12 +6,11 @@ codecov:
|
||||
branch: master
|
||||
|
||||
notify:
|
||||
require_ci_to_pass: no
|
||||
require_ci_to_pass: yes # Less spammy. Only notify on passing builds.
|
||||
|
||||
ignore:
|
||||
- ^*.py$
|
||||
- doc/.*
|
||||
- tests/.*
|
||||
- ^*.py$ # python files at the repo root, ie, setup.py
|
||||
- doc/.* # ignore any code under doc/
|
||||
|
||||
coverage:
|
||||
round: up
|
||||
@ -20,30 +19,61 @@ coverage:
|
||||
|
||||
status:
|
||||
project: # measuring the overall project coverage
|
||||
default:
|
||||
default: false # disable the default status that measures entire project
|
||||
salt: # declare a new status context "salt"
|
||||
enabled: yes # must be yes|true to enable this status
|
||||
if_no_uploads: error # will post commit status of "error" if no coverage reports we uploaded
|
||||
paths: "!tests/" # remove all files in "tests/"
|
||||
target: auto # will use the coverage from the base commit (pull request base or parent commit) coverage to compare against.
|
||||
base: auto # will use the pull request base if the commit is on a pull request. If not, the parent commit will be used.
|
||||
if_no_uploads: error # will post commit status of "error" if no coverage reports were uploaded
|
||||
# options: success, error, failure
|
||||
if_not_found: success # if parent is not found report status as success, error, or failure
|
||||
if_ci_failed: success # if ci fails report status as success, error, or failure
|
||||
if_ci_failed: error # if ci fails report status as success, error, or failure
|
||||
tests: # declare a new status context "tests"
|
||||
enabled: yes # must be yes|true to enable this status
|
||||
#target: 100% # we always want 100% coverage here
|
||||
target: auto # auto while we get this going
|
||||
base: auto # will use the pull request base if the commit is on a pull request. If not, the parent commit will be used.
|
||||
paths: "!salt/" # only include coverage in "tests/" folder
|
||||
if_no_uploads: error # will post commit status of "error" if no coverage reports were uploaded
|
||||
# options: success, error, failure
|
||||
if_not_found: success # if parent is not found report status as success, error, or failure
|
||||
if_ci_failed: error # if ci fails report status as success, error, or failure
|
||||
|
||||
patch: # pull requests only: this commit status will measure the
|
||||
# entire pull requests Coverage Diff. Checking if the lines
|
||||
# adjusted are covered at least X%.
|
||||
default:
|
||||
enabled: no # must be yes|true to enable this status
|
||||
target: 80% # specify the target "X%" coverage to hit
|
||||
if_no_uploads: error # will post commit status of "error" if no coverage reports we uploaded
|
||||
# options: success, error, failure
|
||||
enabled: yes # must be yes|true to enable this status
|
||||
target: 100% # Newly added lines must have 100% coverage
|
||||
if_no_uploads: error # will post commit status of "error" if no coverage reports were uploaded
|
||||
# options: success, error, failure
|
||||
if_not_found: success
|
||||
if_ci_failed: success
|
||||
if_ci_failed: error
|
||||
|
||||
changes: # if there are any unexpected changes in coverage
|
||||
default:
|
||||
enabled: no # must be yes|true to enable this status
|
||||
if_no_uploads: success
|
||||
enabled: yes # must be yes|true to enable this status
|
||||
if_no_uploads: error
|
||||
if_not_found: success
|
||||
if_ci_failed: success
|
||||
if_ci_failed: error
|
||||
|
||||
# No commends because we're not yet running the full test suite on PRs
|
||||
comment: off
|
||||
flags:
|
||||
salt:
|
||||
paths:
|
||||
- salt/
|
||||
tests:
|
||||
paths:
|
||||
- tests/
|
||||
|
||||
comment:
|
||||
layout: "reach, diff, flags, files"
|
||||
after_n_builds: 46 # Only comment on PRs after N builds
|
||||
# This value is the output of:
|
||||
# sh -c 'echo "$(ls .ci/ | grep kitchen | wc -l)"'
|
||||
|
||||
behavior: new # Comment posting behaviour
|
||||
# default: update, if exists. Otherwise post new.
|
||||
# once: update, if exists. Otherwise post new. Skip if deleted.
|
||||
# new: delete old and post new.
|
||||
# spammy: post new (do not delete old comments).
|
||||
|
@ -1,14 +1,11 @@
|
||||
[run]
|
||||
branch = True
|
||||
cover_pylib = False
|
||||
source =
|
||||
salt
|
||||
parallel = True
|
||||
concurrency = multiprocessing
|
||||
omit =
|
||||
tests/*.py
|
||||
setup.py
|
||||
salt/daemons/test/*
|
||||
.nox/*
|
||||
|
||||
[report]
|
||||
# Regexes for lines to exclude from consideration
|
||||
@ -30,7 +27,3 @@ exclude_lines =
|
||||
|
||||
|
||||
ignore_errors = True
|
||||
|
||||
[paths]
|
||||
source =
|
||||
salt
|
||||
|
80
.github/CODEOWNERS
vendored
80
.github/CODEOWNERS
vendored
@ -8,72 +8,58 @@
|
||||
|
||||
# This file uses an fnmatch-style matching pattern.
|
||||
|
||||
# Team Boto
|
||||
salt/*/*boto* @saltstack/team-boto
|
||||
|
||||
# Team Core
|
||||
requirements/* @saltstack/team-core
|
||||
rfcs/* @saltstack/team-core
|
||||
salt/auth/* @saltstack/team-core
|
||||
salt/cache/* @saltstack/team-core
|
||||
salt/cli/* @saltstack/team-core
|
||||
salt/client/* @saltstack/team-core
|
||||
salt/config/* @saltstack/team-core
|
||||
salt/daemons/* @saltstack/team-core
|
||||
salt/pillar/* @saltstack/team-core
|
||||
salt/loader.py @saltstack/team-core
|
||||
salt/payload.py @saltstack/team-core
|
||||
salt/master.py @saltstack/team-core
|
||||
salt/*/master* @saltstack/team-core
|
||||
salt/minion.py @saltstack/team-core
|
||||
salt/*/minion* @saltstack/team-core
|
||||
* @saltstack/team-core
|
||||
|
||||
# Team Boto
|
||||
salt/*/*boto* @saltstack/team-boto @saltstack/team-core
|
||||
|
||||
# Team Cloud
|
||||
salt/cloud/* @saltstack/team-cloud
|
||||
salt/utils/openstack/* @saltstack/team-cloud
|
||||
salt/utils/aws.py @saltstack/team-cloud
|
||||
salt/*/*cloud* @saltstack/team-cloud
|
||||
salt/cloud/* @saltstack/team-cloud @saltstack/team-core
|
||||
salt/utils/openstack/* @saltstack/team-cloud @saltstack/team-core
|
||||
salt/utils/aws.py @saltstack/team-cloud @saltstack/team-core
|
||||
salt/*/*cloud* @saltstack/team-cloud @saltstack/team-core
|
||||
|
||||
# Team NetAPI
|
||||
salt/cli/api.py @saltstack/team-netapi
|
||||
salt/client/netapi.py @saltstack/team-netapi
|
||||
salt/netapi/* @saltstack/team-netapi
|
||||
salt/cli/api.py @saltstack/team-netapi @saltstack/team-core
|
||||
salt/client/netapi.py @saltstack/team-netapi @saltstack/team-core
|
||||
salt/netapi/* @saltstack/team-netapi @saltstack/team-core
|
||||
|
||||
# Team Network
|
||||
salt/proxy/* @saltstack/team-proxy
|
||||
salt/proxy/* @saltstack/team-proxy @saltstack/team-core
|
||||
|
||||
# Team SPM
|
||||
salt/cli/spm.py @saltstack/team-spm
|
||||
salt/spm/* @saltstack/team-spm
|
||||
salt/cli/spm.py @saltstack/team-spm @saltstack/team-core
|
||||
salt/spm/* @saltstack/team-spm @saltstack/team-core
|
||||
|
||||
# Team SSH
|
||||
salt/cli/ssh.py @saltstack/team-ssh
|
||||
salt/client/ssh/* @saltstack/team-ssh
|
||||
salt/roster/* @saltstack/team-ssh
|
||||
salt/runners/ssh.py @saltstack/team-ssh
|
||||
salt/*/thin.py @saltstack/team-ssh
|
||||
salt/cli/ssh.py @saltstack/team-ssh @saltstack/team-core
|
||||
salt/client/ssh/* @saltstack/team-ssh @saltstack/team-core
|
||||
salt/roster/* @saltstack/team-ssh @saltstack/team-core
|
||||
salt/runners/ssh.py @saltstack/team-ssh @saltstack/team-core
|
||||
salt/*/thin.py @saltstack/team-ssh @saltstack/team-core
|
||||
|
||||
# Team State
|
||||
salt/state.py @saltstack/team-state
|
||||
salt/state.py @saltstack/team-state @saltstack/team-core
|
||||
|
||||
# Team SUSE
|
||||
salt/*/*btrfs* @saltstack/team-suse
|
||||
salt/*/*kubernetes* @saltstack/team-suse
|
||||
salt/*/*pkg* @saltstack/team-suse
|
||||
salt/*/*snapper* @saltstack/team-suse
|
||||
salt/*/*xfs* @saltstack/team-suse
|
||||
salt/*/*zypper* @saltstack/team-suse
|
||||
salt/*/*btrfs* @saltstack/team-suse @saltstack/team-core
|
||||
salt/*/*kubernetes* @saltstack/team-suse @saltstack/team-core
|
||||
salt/*/*pkg* @saltstack/team-suse @saltstack/team-core
|
||||
salt/*/*snapper* @saltstack/team-suse @saltstack/team-core
|
||||
salt/*/*xfs* @saltstack/team-suse @saltstack/team-core
|
||||
salt/*/*zypper* @saltstack/team-suse @saltstack/team-core
|
||||
|
||||
# Team Transport
|
||||
salt/transport/* @saltstack/team-transport
|
||||
salt/utils/zeromq.py @saltstack/team-transport
|
||||
salt/transport/* @saltstack/team-transport @saltstack/team-core
|
||||
salt/utils/zeromq.py @saltstack/team-transport @saltstack/team-core
|
||||
|
||||
# Team Windows
|
||||
salt/*/*win* @saltstack/team-windows
|
||||
salt/modules/reg.py @saltstack/team-windows
|
||||
salt/states/reg.py @saltstack/team-windows
|
||||
tests/*/*win* @saltstack/team-windows
|
||||
tests/*/test_reg.py @saltstack/team-windows
|
||||
salt/*/*win* @saltstack/team-windows @saltstack/team-core
|
||||
salt/modules/reg.py @saltstack/team-windows @saltstack/team-core
|
||||
salt/states/reg.py @saltstack/team-windows @saltstack/team-core
|
||||
tests/*/*win* @saltstack/team-windows @saltstack/team-core
|
||||
tests/*/test_reg.py @saltstack/team-windows @saltstack/team-core
|
||||
|
||||
# Jenkins Integration
|
||||
.ci/* @saltstack/saltstack-sre-team @saltstack/team-core
|
||||
|
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -9,6 +9,8 @@ Remove this section if not relevant
|
||||
Remove this section if not relevant
|
||||
|
||||
### Tests written?
|
||||
**[NOTICE] Bug fixes or features added to Salt require tests.**
|
||||
Please review the [test documentation](https://docs.saltstack.com/en/latest/topics/tutorials/writing_tests.html) for details on how to implement tests into Salt's test suite.
|
||||
|
||||
Yes/No
|
||||
|
||||
|
@ -6,26 +6,24 @@ repos:
|
||||
- id: pip-tools-compile
|
||||
alias: compile-linux-py2.7-zmq-requirements
|
||||
name: Linux Py2.7 ZeroMQ Requirements
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
|
||||
exclude: ^requirements/static/(lint|cloud|docs|osx|windows)\.in$
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
|
||||
exclude: ^requirements/static/(lint|cloud|docs|darwin|windows)\.in$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=2.7
|
||||
- --platform=linux
|
||||
- --out-prefix=zeromq
|
||||
- --include=requirements/base.txt
|
||||
- --include=requirements/zeromq.txt
|
||||
- --include=requirements/pytest.txt
|
||||
- --remove-line=^pycrypto==(.*)$
|
||||
- id: pip-tools-compile
|
||||
alias: compile-osx-py2.7-zmq-requirements
|
||||
name: OSX Py2.7 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/osx\.in))$
|
||||
alias: compile-darwin-py2.7-zmq-requirements
|
||||
name: Darwin Py2.7 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=2.7
|
||||
- --platform=darwin
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/osx/req.txt
|
||||
- --include=pkg/osx/req_ext.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -41,7 +39,6 @@ repos:
|
||||
- -v
|
||||
- --py-version=2.7
|
||||
- --platform=windows
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/windows/req.txt
|
||||
- --include=pkg/windows/req_win.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -70,13 +67,12 @@ repos:
|
||||
- id: pip-tools-compile
|
||||
alias: compile-linux-py3.4-zmq-requirements
|
||||
name: Linux Py3.4 ZeroMQ Requirements
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|osx|windows)\.in$
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.4
|
||||
- --platform=linux
|
||||
- --out-prefix=zeromq
|
||||
- --include=requirements/base.txt
|
||||
- --include=requirements/zeromq.txt
|
||||
- --include=requirements/pytest.txt
|
||||
@ -93,26 +89,24 @@ repos:
|
||||
- id: pip-tools-compile
|
||||
alias: compile-linux-py3.5-zmq-requirements
|
||||
name: Linux Py3.5 ZeroMQ Requirements
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|osx|windows)\.in$
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.5
|
||||
- --platform=linux
|
||||
- --out-prefix=zeromq
|
||||
- --include=requirements/base.txt
|
||||
- --include=requirements/zeromq.txt
|
||||
- --include=requirements/pytest.txt
|
||||
- --remove-line=^pycrypto==(.*)$
|
||||
- id: pip-tools-compile
|
||||
alias: compile-osx-py3.5-zmq-requirements
|
||||
name: OSX Py3.5 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/osx\.in))$
|
||||
alias: compile-darwin-py3.5-zmq-requirements
|
||||
name: Darwin Py3.5 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.5
|
||||
- --platform=darwin
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/osx/req.txt
|
||||
- --include=pkg/osx/req_ext.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -128,7 +122,6 @@ repos:
|
||||
- -v
|
||||
- --py-version=3.5
|
||||
- --platform=windows
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/windows/req.txt
|
||||
- --include=pkg/windows/req_win.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -156,26 +149,24 @@ repos:
|
||||
- id: pip-tools-compile
|
||||
alias: compile-linux-py3.6-zmq-requirements
|
||||
name: Linux Py3.6 ZeroMQ Requirements
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|osx|windows)\.in$
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.6
|
||||
- --platform=linux
|
||||
- --out-prefix=zeromq
|
||||
- --include=requirements/base.txt
|
||||
- --include=requirements/zeromq.txt
|
||||
- --include=requirements/pytest.txt
|
||||
- --remove-line=^pycrypto==(.*)$
|
||||
- id: pip-tools-compile
|
||||
alias: compile-osx-py3.6-zmq-requirements
|
||||
name: OSX Py3.6 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/osx\.in))$
|
||||
alias: compile-darwin-py3.6-zmq-requirements
|
||||
name: Darwin Py3.6 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.6
|
||||
- --platform=darwin
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/osx/req.txt
|
||||
- --include=pkg/osx/req_ext.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -191,7 +182,6 @@ repos:
|
||||
- -v
|
||||
- --py-version=3.6
|
||||
- --platform=windows
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/windows/req.txt
|
||||
- --include=pkg/windows/req_win.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -219,26 +209,24 @@ repos:
|
||||
- id: pip-tools-compile
|
||||
alias: compile-linux-py3.7-zmq-requirements
|
||||
name: Linux Py3.7 ZeroMQ Requirements
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|osx|windows)\.in$
|
||||
files: ^requirements/((base|zeromq|pytest)\.txt|static/linux\.in)$
|
||||
exclude: ^requirements/static/(centos-6|amzn-2018\.03|lint|cloud|docs|darwin|windows)\.in$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.7
|
||||
- --platform=linux
|
||||
- --out-prefix=zeromq
|
||||
- --include=requirements/base.txt
|
||||
- --include=requirements/zeromq.txt
|
||||
- --include=requirements/pytest.txt
|
||||
- --remove-line=^pycrypto==(.*)$
|
||||
- id: pip-tools-compile
|
||||
alias: compile-osx-py3.7-zmq-requirements
|
||||
name: OSX Py3.7 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/osx\.in))$
|
||||
alias: compile-darwin-py3.7-zmq-requirements
|
||||
name: Darwin Py3.7 ZeroMQ Requirements
|
||||
files: ^(pkg/osx/(req|req_ext)\.txt|requirements/((base|zeromq|pytest)\.txt|static/darwin\.in))$
|
||||
args:
|
||||
- -v
|
||||
- --py-version=3.7
|
||||
- --platform=darwin
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/osx/req.txt
|
||||
- --include=pkg/osx/req_ext.txt
|
||||
- --include=requirements/base.txt
|
||||
@ -254,7 +242,6 @@ repos:
|
||||
- -v
|
||||
- --py-version=3.7
|
||||
- --platform=windows
|
||||
- --out-prefix=zeromq
|
||||
- --include=pkg/windows/req.txt
|
||||
- --include=pkg/windows/req_win.txt
|
||||
- --include=requirements/base.txt
|
||||
|
56
CHANGELOG.md
Normal file
56
CHANGELOG.md
Normal file
@ -0,0 +1,56 @@
|
||||
# Changelog
|
||||
All notable changes to Salt will be documented in this file.
|
||||
|
||||
This changelog follows [keepachangelog](https://keepachangelog.com/en/1.0.0/) format, and is intended for human consumption.
|
||||
|
||||
This project versioning is *similar* to [Semantic Versioning](https://semver.org), and is documented in [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20/files).
|
||||
Versions are `MAJOR.PATCH`.
|
||||
|
||||
## Unreleased (Neon)
|
||||
|
||||
### Removed
|
||||
|
||||
- [#54943](https://github.com/saltstack/salt/pull/54943) - RAET transport method has been removed per the deprecation schedule - [@s0undt3ch](https://github.com/s0undt3ch)
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Changed
|
||||
|
||||
- [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20) - Changed to numeric versions.
|
||||
- [SEP 1](https://github.com/saltstack/salt-enhancement-proposals/blob/master/accepted/0001-changelog-format.md), [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20) - Adopted keepachangelog format.
|
||||
|
||||
### Fixed
|
||||
|
||||
### Added
|
||||
|
||||
- [#54917](https://github.com/saltstack/salt/pull/54917) - Added get_settings, put_settings and flush_synced methods for Elasticsearch module. - [@Oloremo](https://github.com/Oloremo)
|
||||
|
||||
---
|
||||
|
||||
## [2019.2.2]
|
||||
|
||||
### Changed
|
||||
|
||||
- [#54758](https://github.com/saltstack/salt/issues/54758) - Missing sls file during `state.show_states` displays message instead of failing - [@Ch3LL](https://github.com/Ch3LL)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#54521](https://github.com/saltstack/salt/issues/54521) - `failhard` during orchestration now fails as expected - [@mattp-](https://github.com/mattp-) / [@Oloremo](https://github.com/Oloremo)
|
||||
- [#54741](https://github.com/saltstack/salt/issues/54741) - `schedule.run_job` without time element now works as expected - [@garethgreenaway](https://github.com/garethgreenaway)
|
||||
- [#54755](https://github.com/saltstack/salt/issues/54755) - Pip state ensures pip was imported before trying to remove - [@dwoz](https://github.com/dwoz)
|
||||
- [#54760](https://github.com/saltstack/salt/issues/54760) - Fix `salt-cloud -Q` for OpenStack driver - [@vdloo](https://github.com/vdloo) / [@Akm0d](https://github.com/Akm0d)
|
||||
- [#54762](https://github.com/saltstack/salt/issues/54762) - IPv6 addresses with brackets no longer break master/minion communication - [@dhiltonp](https://github.com/dhiltonp)
|
||||
- [#54765](https://github.com/saltstack/salt/issues/54765) - Masterless jinja imports - [@dwoz](https://github.com/dwoz)
|
||||
- [#54776](https://github.com/saltstack/salt/issues/54776) - `ping_interval` in minion config no longer prevents startup - [@dwoz](https://github.com/dwoz)
|
||||
- [#54820](https://github.com/saltstack/salt/issues/54820) - `scheduler.present` no longer always reports changes when scheduler is disabled - [@garethgreenaway](https://github.com/garethgreenaway)
|
||||
- [#54941](https://github.com/saltstack/salt/issues/54941) - Pillar data is no longer refreshed on every call - [@dwoz](https://github.com/dwoz)
|
||||
|
||||
|
||||
### Added
|
||||
|
||||
- [#54919](https://github.com/saltstack/salt/pull/54919) - Added missing `win_wusa` state and module docs - [@twangboy](https://github.com/twangboy)
|
||||
|
||||
## [2019.2.1] - 2019-09-25 [YANKED]
|
||||
|
||||
|
||||
- See [old release notes](https://docs.saltstack.com/en/latest/topics/releases/2019.2.1.html)
|
@ -60,7 +60,6 @@ services`_ offerings.
|
||||
* Facebook - `<https://www.facebook.com/SaltStack/>`_
|
||||
* LinkedIn - `<https://www.linkedin.com/company/salt-stack-inc>`_
|
||||
* LinkedIn Group - `<https://www.linkedin.com/groups/4877160>`_
|
||||
* Google+ - `<https://plus.google.com/b/112856352920437801867/+SaltStackInc/posts>`_
|
||||
|
||||
.. _global community: http://www.meetup.com/pro/saltstack/
|
||||
.. _SaltConf: http://saltconf.com/
|
||||
|
@ -391,7 +391,7 @@
|
||||
#mine_interval: 60
|
||||
|
||||
# Windows platforms lack posix IPC and must rely on slower TCP based inter-
|
||||
# process communications. Set ipc_mode to 'tcp' on such systems
|
||||
# process communications. ipc_mode is set to 'tcp' on such systems.
|
||||
#ipc_mode: ipc
|
||||
|
||||
# Overwrite the default tcp ports used by the minion when ipc_mode is set to 'tcp'
|
||||
|
@ -1,79 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
|
||||
|
||||
|
||||
compile-translation-catalogs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Compile the existing translation catalogs.
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
import sys
|
||||
import fnmatch
|
||||
|
||||
# Import 3rd-party libs
|
||||
HAS_BABEL = False
|
||||
try:
|
||||
from babel.messages import mofile, pofile
|
||||
HAS_BABEL = True
|
||||
except ImportError:
|
||||
try:
|
||||
import polib
|
||||
except ImportError:
|
||||
print(
|
||||
'You need to install either babel or pofile in order to compile '
|
||||
'the message catalogs. One of:\n'
|
||||
' pip install babel\n'
|
||||
' pip install polib'
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
DOC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
LOCALES_DIR = os.path.join(DOC_DIR, 'locale')
|
||||
|
||||
|
||||
def main():
|
||||
'''
|
||||
Run the compile code
|
||||
'''
|
||||
|
||||
print('Gathering the translation catalogs to compile...'),
|
||||
sys.stdout.flush()
|
||||
entries = {}
|
||||
for locale in os.listdir(os.path.join(LOCALES_DIR)):
|
||||
if locale == 'pot':
|
||||
continue
|
||||
|
||||
locale_path = os.path.join(LOCALES_DIR, locale)
|
||||
entries[locale] = []
|
||||
|
||||
for dirpath, _, filenames in os.walk(locale_path):
|
||||
for filename in fnmatch.filter(filenames, '*.po'):
|
||||
entries[locale].append(os.path.join(dirpath, filename))
|
||||
print('DONE')
|
||||
|
||||
for locale, po_files in sorted(entries.items()):
|
||||
lc_messages_path = os.path.join(LOCALES_DIR, locale, 'LC_MESSAGES')
|
||||
print('\nCompiling the \'{0}\' locale:'.format(locale))
|
||||
for po_file in sorted(po_files):
|
||||
relpath = os.path.relpath(po_file, lc_messages_path)
|
||||
print ' {0}.po -> {0}.mo'.format(relpath.split('.po', 1)[0])
|
||||
if HAS_BABEL:
|
||||
catalog = pofile.read_po(open(po_file))
|
||||
mofile.write_mo(
|
||||
open(po_file.replace('.po', '.mo'), 'wb'), catalog
|
||||
)
|
||||
continue
|
||||
|
||||
catalog = polib.pofile(po_file)
|
||||
catalog.save_as_mofile(fpath=po_file.replace('.po', '.mo'))
|
||||
|
||||
print('Done')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
|
||||
|
||||
|
||||
download-translation-catalog
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Download a translation catalog from Transifex.
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Import 3rd-party libs
|
||||
try:
|
||||
import txclib.utils
|
||||
except ImportError:
|
||||
print(
|
||||
'The \'transifex-client\' library needs to be installed. '
|
||||
'Please execute one of \'pip install transifex-client\' or '
|
||||
'\'easy_install transifex-client\''
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
DOC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
LOCALES_DIR = os.path.join(DOC_DIR, 'locale')
|
||||
|
||||
|
||||
def main():
|
||||
'''
|
||||
Run the compile code
|
||||
'''
|
||||
|
||||
os.chdir(DOC_DIR)
|
||||
tx_root = txclib.utils.find_dot_tx()
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print('You need to pass a locale to this script. For example: '
|
||||
'pt_PT, zh_CN, ru, etc...')
|
||||
sys.exit(1)
|
||||
|
||||
for locale in sys.argv[1:]:
|
||||
print('Download \'{0}\' translations catalog...'.format(locale))
|
||||
txclib.utils.exec_command('pull', ['-l', locale], tx_root)
|
||||
|
||||
print('Done')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,223 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
|
||||
|
||||
|
||||
update-transifex-source-translations
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Update the transifex sources configuration file and push the source
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import logging
|
||||
import subprocess
|
||||
import ConfigParser
|
||||
|
||||
try:
|
||||
import txclib.utils
|
||||
except ImportError:
|
||||
sys.stdout.write(
|
||||
'The \'transifex-client\' library needs to be installed. '
|
||||
'Please execute one of \'pip install transifex-client\' or '
|
||||
'\'easy_install transifex-client\'\n'
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
DOC_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
||||
|
||||
def main():
|
||||
'''
|
||||
Run the update code
|
||||
'''
|
||||
os.chdir(DOC_DIR)
|
||||
|
||||
sys.stdout.write('Extracting translatable strings....\n')
|
||||
try:
|
||||
subprocess.check_call(['make', 'gettext'])
|
||||
except subprocess.CalledProcessError as exc:
|
||||
sys.stdout.write('An error occurred while extracting the translation '
|
||||
'strings: {0}\n'.format(exc))
|
||||
sys.exit(1)
|
||||
|
||||
locale_dir = os.path.join(DOC_DIR, 'locale')
|
||||
pot_dir = os.path.join(DOC_DIR, '_build', 'locale')
|
||||
tx_root = txclib.utils.find_dot_tx()
|
||||
tx_config = os.path.join(tx_root, '.tx', 'config')
|
||||
|
||||
if not tx_root:
|
||||
sys.stdout.write(
|
||||
'Unable to find the \'.tx/\' directory. Unable to continue\n'
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# We do not want the txclib INFO or WARNING logging
|
||||
logging.getLogger('txclib').setLevel(logging.ERROR)
|
||||
|
||||
sys.stdout.write('Gathering the translation template files...')
|
||||
sys.stdout.flush()
|
||||
entries = []
|
||||
for dirpath, dirnames, filenames in os.walk(pot_dir):
|
||||
for filename in filenames:
|
||||
pot_file = os.path.join(dirpath, filename)
|
||||
base, ext = os.path.splitext(pot_file)
|
||||
if ext != '.pot':
|
||||
continue
|
||||
resource_path = os.path.relpath(base, pot_dir)
|
||||
try:
|
||||
import babel.messages.pofile
|
||||
if not len(babel.messages.pofile.read_po(open(pot_file))):
|
||||
# Empty pot file, continue
|
||||
continue
|
||||
except ImportError:
|
||||
# No babel package, let's keep on going
|
||||
pass
|
||||
|
||||
resource_name = resource_path.replace(
|
||||
'\\', '/').replace('/', '--').replace('.', '_')
|
||||
entries.append((resource_path, resource_name))
|
||||
sys.stdout.write('Done\n')
|
||||
|
||||
# Let's load the resources already present in the configuration file
|
||||
cfg = ConfigParser.SafeConfigParser()
|
||||
cfg.read([tx_config])
|
||||
handled_resources = set(
|
||||
section for section in
|
||||
cfg.sections() if section.startswith('salt.')
|
||||
)
|
||||
|
||||
sys.stdout.write('Updating the entries in \'.tx/config\'...\n')
|
||||
sys.stdout.flush()
|
||||
total_entries = len(entries)
|
||||
for idx, (resource_path, resource_name) in enumerate(sorted(entries)):
|
||||
sys.stdout.write(
|
||||
'[{0:>{pad}}/{1}] Updating resource for '
|
||||
'{resource_path}.pot ({resource_name})'.format(
|
||||
idx + 1,
|
||||
total_entries,
|
||||
pad=len(str(total_entries)),
|
||||
locale_dir=locale_dir,
|
||||
resource_name=resource_name,
|
||||
resource_path=resource_path
|
||||
)
|
||||
)
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
txclib.utils.exec_command(
|
||||
'set',
|
||||
'--auto-local -r salt.{resource_name} '
|
||||
'{locale_dir}/<lang>/LC_MESSAGES/{resource_path}.po '
|
||||
'--source-lang en '
|
||||
'--source-file {pot_dir}/{resource_path}.pot '
|
||||
'--source-name {resource_path}.rst '
|
||||
'--execute'.format(
|
||||
resource_name=resource_name,
|
||||
resource_path=resource_path,
|
||||
locale_dir=locale_dir,
|
||||
pot_dir=pot_dir.rstrip('/')
|
||||
).split(),
|
||||
tx_root
|
||||
)
|
||||
sys.stdout.write('\n')
|
||||
if 'salt.{0}'.format(resource_name) in handled_resources:
|
||||
handled_resources.remove('salt.{0}'.format(resource_name))
|
||||
except Exception as err:
|
||||
sys.stdout.write('An error occurred: {0}\n'.format(err))
|
||||
except KeyboardInterrupt:
|
||||
sys.stdout.write('\n')
|
||||
sys.exit(1)
|
||||
time.sleep(0.025)
|
||||
|
||||
if handled_resources:
|
||||
non_handled_resources = len(handled_resources)
|
||||
sys.stdout.write(
|
||||
'Removing old resources from configuration and upstream'
|
||||
'(if possible)\n'
|
||||
)
|
||||
for idx, resource_name in enumerate(sorted(handled_resources)):
|
||||
sys.stdout.write(
|
||||
'[{0:>{pad}}/{1}] Removing resource \'{resource_name}\''.format(
|
||||
idx + 1,
|
||||
non_handled_resources,
|
||||
pad=len(str(non_handled_resources)),
|
||||
resource_name=resource_name,
|
||||
)
|
||||
)
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
txclib.utils.exec_command(
|
||||
'delete',
|
||||
['-r', resource_name],
|
||||
tx_root
|
||||
)
|
||||
handled_resources.remove(resource_name)
|
||||
except Exception as err:
|
||||
sys.stdout.write('An error occurred: {0}\n'.format(err))
|
||||
finally:
|
||||
if cfg.has_section(resource_name):
|
||||
cfg.remove_section(resource_name)
|
||||
sys.stdout.write('\n')
|
||||
time.sleep(0.025)
|
||||
cfg.write(open(tx_config, 'w'))
|
||||
sys.stdout.write('\n')
|
||||
|
||||
# Set the translations file type we're using
|
||||
txclib.utils.exec_command('set', ['-t', 'PO'], tx_root)
|
||||
time.sleep(0.025)
|
||||
|
||||
if 'TRANSIFEX_NO_PUSH' not in os.environ:
|
||||
|
||||
sys.stdout.write('\n')
|
||||
sys.stdout.write('Pushing translation template files...\n')
|
||||
for idx, (resource_path, resource_name) in enumerate(sorted(entries)):
|
||||
sys.stdout.write(
|
||||
'[{0:>{pad}}/{1}] Pushing resource for '
|
||||
'{resource_path}.pot ({resource_name})'.format(
|
||||
idx + 1,
|
||||
total_entries,
|
||||
pad=len(str(total_entries)),
|
||||
locale_dir=locale_dir,
|
||||
resource_name=resource_name,
|
||||
resource_path=resource_path
|
||||
)
|
||||
)
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
txclib.utils.exec_command(
|
||||
'push',
|
||||
'--resource salt.{resource_name} '
|
||||
'--source '
|
||||
'--skip '
|
||||
'--no-interactive'.format(
|
||||
resource_name=resource_name,
|
||||
resource_path=resource_path,
|
||||
locale_dir=locale_dir
|
||||
).split(),
|
||||
tx_root
|
||||
)
|
||||
sys.stdout.write('\n')
|
||||
except Exception as err:
|
||||
sys.stdout.write('An error occurred: {0}\n'.format(err))
|
||||
except KeyboardInterrupt:
|
||||
sys.stdout.write('\n')
|
||||
sys.exit(1)
|
||||
time.sleep(0.025)
|
||||
|
||||
if handled_resources:
|
||||
sys.stdout.write('=' * 80)
|
||||
sys.stdout.write(
|
||||
'\nDon\'t forget to delete the following remote resources:\n')
|
||||
for resource_name in sorted(handled_resources):
|
||||
sys.stdout.write(' {0}\n'.format(resource_name))
|
||||
sys.stdout.write('=' * 80)
|
||||
|
||||
sys.stdout.write('\nDONE\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
4834
doc/.tx/config
4834
doc/.tx/config
File diff suppressed because it is too large
Load Diff
82
doc/Makefile
82
doc/Makefile
@ -9,29 +9,14 @@ BUILDDIR = _build
|
||||
SPHINXLANG =
|
||||
XELATEX = xelatex
|
||||
|
||||
# ----- Translations Support ------------------------------------------------>
|
||||
# If language is set, also set translation options
|
||||
ifeq ($(shell [ "x$(SPHINXLANG)" != "x" ] && echo 0 || echo 1), 0)
|
||||
TRANSLATIONOPTS = -D language='$(SPHINXLANG)'
|
||||
else
|
||||
TRANSLATIONOPTS =
|
||||
endif
|
||||
|
||||
# Reset settings if sphinx-intl is not available
|
||||
ifeq ($(shell which sphinx-intl >/dev/null 2>&1; echo $$?), 1)
|
||||
SPHINXLANG =
|
||||
TRANSLATIONOPTS =
|
||||
endif
|
||||
# <---- Translations Support -------------------------------------------------
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(TRANSLATIONOPTS) $(SPHINXOPTS) .
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean check_sphinx-build html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext translations download-translations
|
||||
.PHONY: help clean check_sphinx-build html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@ -53,7 +38,6 @@ help:
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@ -68,38 +52,38 @@ clean:
|
||||
check_sphinx-build:
|
||||
@which $(SPHINXBUILD) >/dev/null 2>&1 || (echo "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://www.sphinx-doc.org/en/master/)" >&2; false)
|
||||
|
||||
html: check_sphinx-build translations
|
||||
html: check_sphinx-build
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml: check_sphinx-build translations
|
||||
dirhtml: check_sphinx-build
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml: check_sphinx-build translations
|
||||
singlehtml: check_sphinx-build
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle: check_sphinx-build translations
|
||||
pickle: check_sphinx-build
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json: check_sphinx-build translations
|
||||
json: check_sphinx-build
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp: check_sphinx-build translations
|
||||
htmlhelp: check_sphinx-build
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp: check_sphinx-build translations
|
||||
qthelp: check_sphinx-build
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
@ -108,7 +92,7 @@ qthelp: check_sphinx-build translations
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Salt.qhc"
|
||||
|
||||
devhelp: check_sphinx-build translations
|
||||
devhelp: check_sphinx-build
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@ -117,31 +101,31 @@ devhelp: check_sphinx-build translations
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Salt"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub: check_sphinx-build translations
|
||||
epub: check_sphinx-build
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex: check_sphinx-build translations
|
||||
latex: check_sphinx-build
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf: check_sphinx-build translations
|
||||
latexpdf: check_sphinx-build
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja: check_sphinx-build translations
|
||||
latexpdfja: check_sphinx-build
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
pdf: check_sphinx-build translations
|
||||
pdf: check_sphinx-build
|
||||
@if [ "$(XELATEX)" = "xelatex" ] || [ "x$(XELATEX)" = "x" ]; then \
|
||||
echo "The '$(XELATEX)' command was not found."; \
|
||||
fi
|
||||
@ -150,40 +134,35 @@ pdf: check_sphinx-build translations
|
||||
$(MAKE) -C $(BUILDDIR)/latex -i "PDFLATEX=latexmk" "LATEXMKOPTS=-xelatex -interaction=nonstopmode -f -quiet"
|
||||
@echo "xelatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
cheatsheet: translations
|
||||
cheatsheet:
|
||||
@echo "Running cheatsheet/salt.tex file through xelatex..."
|
||||
cd cheatsheet && xelatex salt.tex && cp salt.pdf ../salt-cheatsheet.pdf
|
||||
@echo "./salt-cheatsheet.pdf created."
|
||||
|
||||
text: check_sphinx-build translations
|
||||
text: check_sphinx-build
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man: check_sphinx-build translations
|
||||
man: check_sphinx-build
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo: check_sphinx-build translations
|
||||
texinfo: check_sphinx-build
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info: check_sphinx-build translations
|
||||
info: check_sphinx-build
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext: check_sphinx-build
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale"
|
||||
|
||||
changes: check_sphinx-build translations
|
||||
changes: check_sphinx-build
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
@ -205,27 +184,12 @@ doctest: check_sphinx-build
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
xml: check_sphinx-build translations
|
||||
xml: check_sphinx-build
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml: check_sphinx-build translations
|
||||
pseudoxml: check_sphinx-build
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
|
||||
translations:
|
||||
@if [ "$(SPHINXLANG)" = "en" ] || [ "x$(SPHINXLANG)" = "x" ]; then \
|
||||
echo "No need to update translations. Skipping..."; \
|
||||
elif [ ! -d locale/$(SPHINXLANG) ]; then \
|
||||
echo "The locale directory for $(SPHINXLANG) does not exist"; \
|
||||
exit 1; \
|
||||
else \
|
||||
echo "Compiling exising message catalog for '$(SPHINXLANG)'"; \
|
||||
.scripts/compile-translation-catalogs; \
|
||||
fi
|
||||
|
||||
download-translations:
|
||||
@echo "Downloading $(SPHINXLANG) translations"
|
||||
.scripts/download-translation-catalog $(SPHINXLANG)
|
||||
|
24
doc/_ext/saltrepo.py
Normal file
24
doc/_ext/saltrepo.py
Normal file
@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
saltrepo
|
||||
~~~~~~~~
|
||||
|
||||
SaltStack Repository Sphinx directives
|
||||
'''
|
||||
|
||||
def source_read_handler(app, docname, source):
|
||||
if '|repo_primary_branch|' in source[0]:
|
||||
source[0] = source[0].replace(
|
||||
'|repo_primary_branch|',
|
||||
app.config.html_context['repo_primary_branch']
|
||||
)
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.connect('source-read', source_read_handler)
|
||||
|
||||
return {
|
||||
'version': 'builtin',
|
||||
'parallel_read_safe': True,
|
||||
'parallel_write_safe': True,
|
||||
}
|
14
doc/_themes/saltstack/layout.html
vendored
14
doc/_themes/saltstack/layout.html
vendored
@ -264,20 +264,6 @@
|
||||
<script type="text/javascript" language="javascript">llactid=23943</script>
|
||||
<script type="text/javascript" language="javascript" src="http://t6.trackalyzer.com/trackalyze.js"></script>
|
||||
|
||||
<script>
|
||||
var _gaq = _gaq || [];
|
||||
var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
|
||||
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
|
||||
_gaq.push(['_setAccount', 'UA-26984928-1']);
|
||||
_gaq.push(['_setDomainName', 'saltstack.com']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
46
doc/_themes/saltstack2/layout.html
vendored
46
doc/_themes/saltstack2/layout.html
vendored
@ -52,7 +52,8 @@
|
||||
SEARCH_CX: '{{ search_cx }}',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||
HAS_SOURCE: '{{ has_source|lower }}'
|
||||
HAS_SOURCE: '{{ has_source|lower }}',
|
||||
REPO_PRIMARY_BRANCH_TAB_NAME: '{{ repo_primary_branch | capitalize }}'
|
||||
};
|
||||
</script>
|
||||
{%- for scriptfile in script_files %}
|
||||
@ -178,15 +179,18 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-11 col-md-offset-1 col-lg-10 col-lg-offset-1">
|
||||
<nav class="pull-left text-muted">
|
||||
<a href="https://github.com/saltstack/salt/edit/develop/doc/{{pagename}}.rst">Edit on GitHub</a>
|
||||
<a href="https://github.com/saltstack/salt/edit/{{ repo_primary_branch }}/doc/{{pagename}}.rst">Edit on GitHub</a>
|
||||
</nav>
|
||||
<nav id="localnav">
|
||||
<ul class="nav navbar-nav">
|
||||
{%- block relbar_small %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{% if not (build_type == "develop" or build_type == "next") and on_saltstack %}
|
||||
{% if not (build_type == repo_primary_branch or build_type == "next") and on_saltstack %}
|
||||
<li><a class="icon-dl" href="/en/pdf/Salt-{{ release }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li>
|
||||
<li><a class="icon-dl" href="/en/epub/Salt-{{ release }}.epub"><img height="25" width="18" class="nolightbox" src="{{ pathto('_static/images/epub_icon.svg', 1) }}"></a></li>
|
||||
{% elif build_type == repo_primary_branch and on_saltstack %}
|
||||
<li><a class="icon-dl" href="/en/pdf/Salt-{{ repo_primary_branch }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li>
|
||||
<li><a class="icon-dl" href="/en/epub/Salt-{{ repo_primary_branch }}.epub"><img height="25" width="18" class="nolightbox" src="{{ pathto('_static/images/epub_icon.svg', 1) }}"></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
@ -202,9 +206,9 @@
|
||||
|
||||
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-warning-sign"></i> These release notes are for an old release of Salt. This release might contain known security and other issues that are fixed in the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Release notes for the latest release" href="{{ release }}.html">latest release</a>.</div>
|
||||
|
||||
{% elif build_type == "develop" and on_saltstack %}
|
||||
{% elif build_type == repo_primary_branch and on_saltstack %}
|
||||
|
||||
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-warning-sign"></i> You are viewing docs from the develop branch, some of these features are not yet released.</div>
|
||||
<div class="alert alert-warning dev-notification-text" role="alert"><i class="glyphicon glyphicon-warning-sign"></i> You are viewing docs from the {{ repo_primary_branch }} branch, some of these features are not yet released.</div>
|
||||
|
||||
{% elif build_type == "inactive" and on_saltstack %}
|
||||
|
||||
@ -244,16 +248,16 @@
|
||||
<p><i>{{ today }}</i></p>
|
||||
|
||||
{% if build_type == "latest" %}
|
||||
<p>You are viewing docs for the latest stable release, {{ latest_release }}. Switch to docs for the previous stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the previous stable release" href="/en/{{ previous_release_dir }}/">{{ previous_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the develop branch" href="/en/develop/">develop</a> branch.</p>
|
||||
<p>You are viewing docs for the latest stable release, {{ latest_release }}. Switch to docs for the previous stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the previous stable release" href="/en/{{ previous_release_dir }}/">{{ previous_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the {{ repo_primary_branch }} branch" href="/en/{{ repo_primary_branch }}/">{{ repo_primary_branch }}</a> branch.</p>
|
||||
|
||||
{% elif build_type == "previous" %}
|
||||
<p>You are viewing docs for the previous stable release, {{ previous_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the develop branch" href="/en/develop/">develop</a> branch.</p>
|
||||
<p>You are viewing docs for the previous stable release, {{ previous_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the {{ repo_primary_branch }} branch" href="/en/{{ repo_primary_branch }}/">{{ repo_primary_branch }}</a> branch.</p>
|
||||
|
||||
{% elif build_type == "inactive" %}
|
||||
<p>You are viewing docs for an inactive release, {{ previous_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the develop branch" href="/en/develop/">develop</a> branch.</p>
|
||||
<p>You are viewing docs for an inactive release, {{ previous_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>, or to a recent doc build from the <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Latest docs from the {{ repo_primary_branch }} branch" href="/en/{{ repo_primary_branch }}/">{{ repo_primary_branch }}</a> branch.</p>
|
||||
|
||||
{% elif build_type == "develop" %}
|
||||
<p>You are viewing docs built from a recent snapshot of the develop branch. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>.</p>
|
||||
{% elif build_type == repo_primary_branch %}
|
||||
<p>You are viewing docs built from a recent snapshot of the {{ repo_primary_branch }} branch. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>.</p>
|
||||
|
||||
{% elif build_type == "next" %}
|
||||
<p>You are viewing preview docs for the next major release, {{ next_release }}. Switch to docs for the latest stable release, <a data-container="body" data-toggle="tooltip" data-placement="bottom" title="Docs for the latest stable release" href="/en/latest/">{{ latest_release }}</a>.</p>
|
||||
@ -285,12 +289,12 @@
|
||||
<!-- <a class="ss-logo" href="http://saltstack.com"><img width="250" height="63" class="nolightbox sidebar-logo" src="{{ pathto('_static/images/saltstack_logo.svg', 1) }}"></a>
|
||||
|
||||
{% if on_saltstack %}
|
||||
|
||||
{#
|
||||
{% if [True, False]|random %}
|
||||
<a href="http://saltconf.com/register" target="_blank"><img class="nolightbox sidebar-banner center" src="{{ pathto('_static/images/banner-saltconf.png', 1) }}"/></a>
|
||||
{% else %}
|
||||
<a href="http://saltstack.com/support" target="_blank"><img class="nolightbox sidebar-banner center" src="{{ pathto('_static/images/banner-support.png', 1) }}"/></a>
|
||||
{% endif %}-->
|
||||
{% endif %} #}-->
|
||||
<a href="https://saltconf.com/menu-ad" target="_blank"><img class="nolightbox sidebar-banner center" src="https://get.saltstack.com/rs/304-PHQ-615/images/Salt-docs-menu-ad-250x63.jpg"/></a>
|
||||
|
||||
|
||||
@ -304,11 +308,11 @@
|
||||
|
||||
<div class="releaselinks versions {{ build_type }}">
|
||||
|
||||
<a class="btn btn-secondary{% if build_type == "previous" or build_type == "inactive" %} active{% endif %}" id="previous"{% if build_type == "previous" or build_type == "inactive" %} title="View release notes"{% else %} title="Switch to docs for the previous stable release"{% endif %} data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/{{ previous_release_dir }}/">{{ previous_release }}{% if build_type == "previous" or build_type == "inactive" %} <i class="glyphicon glyphicon-ok"></i>{%- endif %}</a>
|
||||
<a class="btn btn-secondary{% if build_type == "previous" or build_type == "inactive" %} active{% endif %}" id="previous"{% if build_type == "previous" or build_type == "inactive" %} title="View release notes"{% else %} title="Switch to docs for the previous stable release"{% endif %} data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/{{ previous_release_dir }}/">{{ previous_release }}{% if build_type == "previous" or build_type == "inactive" %} <i class="glyphicon glyphicon-ok"></i>{% endif %}</a>
|
||||
|
||||
<a class="btn btn-secondary{% if build_type == "latest" %} active{% endif %}" id="latest"{% if build_type == "latest" %} title="View release notes"{% else %} title="Switch to docs for the latest stable release"{% endif %} data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/latest/">{{ latest_release }}{% if build_type == "latest" %} <i class="glyphicon glyphicon-ok"></i>{% endif %}</a>
|
||||
|
||||
<a class="btn btn-secondary{% if build_type == "develop" %} active{% endif %}" id="develop"{% if build_type == "develop" %} title="View all release notes"{% endif %} title="Switch to docs built recently from the develop branch" data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/develop/">Develop{% if build_type == "develop" %} <i class="glyphicon glyphicon-ok"></i>{% endif %}</a>
|
||||
<a class="btn btn-secondary{% if build_type == repo_primary_branch %} active{% endif %}" id="{{ repo_primary_branch }}"{% if build_type == repo_primary_branch %} title="View all release notes"{% endif %} title="Switch to docs built recently from the {{ repo_primary_branch }} branch" data-container="body" data-toggle="tooltip" data-placement="bottom" href="/en/{{ repo_primary_branch }}/">{{ repo_primary_branch | capitalize }}{% if build_type == repo_primary_branch %} <i class="glyphicon glyphicon-ok"></i>{% endif %}</a>
|
||||
|
||||
</div>
|
||||
|
||||
@ -376,20 +380,6 @@
|
||||
<script type="text/javascript" language="javascript">llactid=23943</script>
|
||||
<script type="text/javascript" language="javascript" src="https://trackalyzer.com/trackalyze_secure.js"></script>
|
||||
|
||||
<script>
|
||||
var _gaq = _gaq || [];
|
||||
var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
|
||||
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
|
||||
_gaq.push(['_setAccount', 'UA-26984928-1']);
|
||||
_gaq.push(['_setDomainName', 'saltstack.com']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
@ -125,7 +125,7 @@ $( document ).ready(function() {
|
||||
window.location.href = window.location.href.replace($currentVer.attr("href"), clickedVer);
|
||||
}
|
||||
else {
|
||||
if ($currentVer.text().indexOf("Develop") == -1) {
|
||||
if ($currentVer.text().indexOf(DOCUMENTATION_OPTIONS.REPO_PRIMARY_BRANCH_TAB_NAME) == -1) {
|
||||
window.location.href = clickedVer + "topics/releases/" + $currentVer.text().trim() + ".html";
|
||||
}
|
||||
else window.location.href = clickedVer + "topics/releases/";
|
||||
|
39
doc/conf.py
39
doc/conf.py
@ -253,9 +253,9 @@ intersphinx_mapping = {
|
||||
on_saltstack = 'SALT_ON_SALTSTACK' in os.environ
|
||||
|
||||
project = 'Salt'
|
||||
|
||||
repo_primary_branch = 'master' # This is the default branch on GitHub for the Salt project
|
||||
version = salt.version.__version__
|
||||
latest_release = '2019.2.1' # latest release
|
||||
latest_release = '2019.2.2' # latest release
|
||||
previous_release = '2018.3.4' # latest release from previous branch
|
||||
previous_release_dir = '2018.3' # path on web server for previous branch
|
||||
next_release = '' # next release
|
||||
@ -268,22 +268,31 @@ if on_saltstack:
|
||||
copyright = time.strftime("%Y")
|
||||
|
||||
# < --- START do not merge these settings to other branches START ---> #
|
||||
build_type = 'latest' # latest, previous, develop, next
|
||||
release = latest_release
|
||||
build_type = repo_primary_branch # latest, previous, master, next
|
||||
# < --- END do not merge these settings to other branches END ---> #
|
||||
|
||||
# Set google custom search engine
|
||||
|
||||
if release == latest_release:
|
||||
if build_type == repo_primary_branch:
|
||||
release = latest_release
|
||||
search_cx = '011515552685726825874:v1had6i279q' # master
|
||||
#search_cx = '011515552685726825874:x17j5zl74g8' # develop
|
||||
elif build_type == 'next':
|
||||
release = next_release
|
||||
search_cx = '011515552685726825874:ht0p8miksrm' # latest
|
||||
elif build_type == 'previous':
|
||||
release = previous_release
|
||||
if release.startswith('2018.3'):
|
||||
search_cx = '011515552685726825874:vadptdpvyyu' # 2018.3
|
||||
elif release.startswith('2017.7'):
|
||||
search_cx = '011515552685726825874:w-hxmnbcpou' # 2017.7
|
||||
elif release.startswith('2016.11'):
|
||||
search_cx = '011515552685726825874:dlsj745pvhq' # 2016.11
|
||||
else:
|
||||
search_cx = '011515552685726825874:ht0p8miksrm' # latest
|
||||
else: # latest or something else
|
||||
release = latest_release
|
||||
search_cx = '011515552685726825874:ht0p8miksrm' # latest
|
||||
elif release.startswith('2018.3'):
|
||||
search_cx = '011515552685726825874:vadptdpvyyu' # 2018.3
|
||||
elif release.startswith('2017.7'):
|
||||
search_cx = '011515552685726825874:w-hxmnbcpou' # 2017.7
|
||||
elif release.startswith('2016.11'):
|
||||
search_cx = '011515552685726825874:dlsj745pvhq' # 2016.11
|
||||
else:
|
||||
search_cx = '011515552685726825874:x17j5zl74g8' # develop
|
||||
|
||||
needs_sphinx = '1.3'
|
||||
|
||||
@ -306,6 +315,7 @@ extensions = [
|
||||
'sphinx.ext.intersphinx',
|
||||
'httpdomain',
|
||||
'youtube',
|
||||
'saltrepo'
|
||||
#'saltautodoc', # Must be AFTER autodoc
|
||||
#'shorturls',
|
||||
]
|
||||
@ -364,7 +374,7 @@ rst_prolog = """\
|
||||
|
||||
# A shortcut for linking to tickets on the GitHub issue tracker
|
||||
extlinks = {
|
||||
'blob': ('https://github.com/saltstack/salt/blob/%s/%%s' % 'develop', None),
|
||||
'blob': ('https://github.com/saltstack/salt/blob/%s/%%s' % repo_primary_branch, None),
|
||||
'issue': ('https://github.com/saltstack/salt/issues/%s', 'issue #'),
|
||||
'pull': ('https://github.com/saltstack/salt/pull/%s', 'PR #'),
|
||||
'formula_url': ('https://github.com/saltstack-formulas/%s', ''),
|
||||
@ -436,6 +446,7 @@ html_context = {
|
||||
'build_type': build_type,
|
||||
'today': today,
|
||||
'copyright': copyright,
|
||||
'repo_primary_branch': repo_primary_branch
|
||||
}
|
||||
|
||||
html_use_index = True
|
||||
|
@ -769,6 +769,30 @@ Statically assigns grains to the minion.
|
||||
cabinet: 13
|
||||
cab_u: 14-15
|
||||
|
||||
.. conf_minion:: grains_blacklist
|
||||
|
||||
``grains_blacklist``
|
||||
--------------------
|
||||
|
||||
Default: ``[]``
|
||||
|
||||
Each grains key will be compared against each of the expressions in this list.
|
||||
Any keys which match will be filtered from the grains. Exact matches, glob
|
||||
matches, and regular expressions are supported.
|
||||
|
||||
.. note::
|
||||
Some states and execution modules depend on grains. Filtering may cause
|
||||
them to be unavailable or run unreliably.
|
||||
|
||||
.. versionadded:: Neon
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
grains_blacklist:
|
||||
- cpu_flags
|
||||
- zmq*
|
||||
- ipv[46]
|
||||
|
||||
.. conf_minion:: grains_cache
|
||||
|
||||
``grains_cache``
|
||||
@ -893,6 +917,20 @@ minion. Since this grain is expensive, it is disabled by default.
|
||||
|
||||
iscsi_grains: True
|
||||
|
||||
.. conf_minion:: nvme_grains
|
||||
|
||||
``nvme_grains``
|
||||
------------------------
|
||||
|
||||
Default: ``False``
|
||||
|
||||
The ``nvme_grains`` setting will enable the ``nvme_nqn`` grain on the
|
||||
minion. Since this grain is expensive, it is disabled by default.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
nvme_grains: True
|
||||
|
||||
.. conf_minion:: mine_enabled
|
||||
|
||||
``mine_enabled``
|
||||
@ -1326,7 +1364,7 @@ creates a new connection for every return to the master.
|
||||
Default: ``ipc``
|
||||
|
||||
Windows platforms lack POSIX IPC and must rely on slower TCP based inter-
|
||||
process communications. Set ipc_mode to ``tcp`` on such systems.
|
||||
process communications. ``ipc_mode`` is set to ``tcp`` on such systems.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
@ -44,8 +44,8 @@ will be skipped if the ``update`` function is run on the fileserver.
|
||||
Backends for the fileserver are located in `salt/fileserver/`_ (the files not
|
||||
named ``__init__.py``).
|
||||
|
||||
.. _`salt/fileserver/__init__.py`: https://github.com/saltstack/salt/tree/develop/salt/fileserver/__init__.py
|
||||
.. _`salt/fileserver/`: https://github.com/saltstack/salt/tree/develop/salt/fileserver
|
||||
.. _`salt/fileserver/__init__.py`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/fileserver/__init__.py
|
||||
.. _`salt/fileserver/`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/fileserver
|
||||
|
||||
Fileclient
|
||||
----------
|
||||
|
@ -383,4 +383,4 @@ Full List of Returners
|
||||
.. toctree::
|
||||
all/index
|
||||
|
||||
.. _`redis`: https://github.com/saltstack/salt/tree/develop/salt/returners/redis_return.py
|
||||
.. _`redis`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/returners/redis_return.py
|
||||
|
@ -3,7 +3,7 @@ salt.runners.mattermost
|
||||
|
||||
**Note for 2017.7 releases!**
|
||||
|
||||
Due to the `salt.runners.config <https://github.com/saltstack/salt/blob/develop/salt/runners/config.py>`_ module not being available in this release series, importing the `salt.runners.config <https://github.com/saltstack/salt/blob/develop/salt/runners/config.py>`_ module from the develop branch is required to make this module work.
|
||||
Due to the `salt.runners.config <https://github.com/saltstack/salt/blob/|repo_primary_branch|/salt/runners/config.py>`_ module not being available in this release series, importing the `salt.runners.config <https://github.com/saltstack/salt/blob/|repo_primary_branch|/salt/runners/config.py>`_ module from the |repo_primary_branch| branch is required to make this module work.
|
||||
|
||||
Ref: `Mattermost runner failing to retrieve config values due to unavailable config runner #43479 <https://github.com/saltstack/salt/issues/43479>`_
|
||||
|
||||
|
@ -14,5 +14,6 @@ serializer modules
|
||||
json
|
||||
msgpack
|
||||
python
|
||||
toml
|
||||
yaml
|
||||
yamlex
|
||||
|
6
doc/ref/serializers/all/salt.serializers.toml.rst
Normal file
6
doc/ref/serializers/all/salt.serializers.toml.rst
Normal file
@ -0,0 +1,6 @@
|
||||
=====================
|
||||
salt.serializers.toml
|
||||
=====================
|
||||
|
||||
.. automodule:: salt.serializers.toml
|
||||
:members:
|
@ -5,10 +5,10 @@ Ordering States
|
||||
===============
|
||||
|
||||
The way in which configuration management systems are executed is a hotly
|
||||
debated topic in the configuration management world. Two
|
||||
major philosophies exist on the subject, to either execute in an imperative
|
||||
fashion where things are executed in the order in which they are defined, or
|
||||
in a declarative fashion where dependencies need to be mapped between objects.
|
||||
debated topic in the configuration management world. Two major philosophies
|
||||
exist on the subject, to either execute in an imperative fashion where things
|
||||
are executed in the order in which they are defined, or in a declarative
|
||||
fashion where dependencies need to be mapped between objects.
|
||||
|
||||
Imperative ordering is finite and generally considered easier to write, but
|
||||
declarative ordering is much more powerful and flexible but generally considered
|
||||
@ -27,20 +27,17 @@ State Auto Ordering
|
||||
.. versionadded: 0.17.0
|
||||
|
||||
Salt always executes states in a finite manner, meaning that they will always
|
||||
execute in the same order regardless of the system that is executing them.
|
||||
But in Salt 0.17.0, the ``state_auto_order`` option was added. This option
|
||||
makes states get evaluated in the order in which they are defined in sls
|
||||
files, including the top.sls file.
|
||||
execute in the same order regardless of the system that is executing them. This
|
||||
evaluation order makes it easy to know what order the states will be executed in,
|
||||
but it is important to note that the requisite system will override the ordering
|
||||
defined in the files, and the ``order`` option, described below, will also
|
||||
override the order in which states are executed.
|
||||
|
||||
The evaluation order makes it easy to know what order the states will be
|
||||
executed in, but it is important to note that the requisite system will
|
||||
override the ordering defined in the files, and the ``order`` option described
|
||||
below will also override the order in which states are defined in sls files.
|
||||
|
||||
If the classic ordering is preferred (lexicographic), then set
|
||||
``state_auto_order`` to ``False`` in the master configuration file. Otherwise,
|
||||
``state_auto_order`` defaults to ``True``.
|
||||
This ordering system can be disabled in preference of lexicographic (classic)
|
||||
ordering by setting the ``state_auto_order`` option to ``False`` in the master
|
||||
configuration file. Otherwise, ``state_auto_order`` defaults to ``True``.
|
||||
|
||||
How compiler ordering is managed is described further in :ref:`compiler-ordering`.
|
||||
|
||||
.. _ordering_requisites:
|
||||
|
||||
|
@ -21,7 +21,7 @@ illustrate:
|
||||
.. code-block:: yaml
|
||||
|
||||
/etc/salt/master: # maps to "name", unless a "name" argument is specified below
|
||||
file.managed: # maps to <filename>.<function> - e.g. "managed" in https://github.com/saltstack/salt/tree/develop/salt/states/file.py
|
||||
file.managed: # maps to <filename>.<function> - e.g. "managed" in https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/states/file.py
|
||||
- user: root # one of many options passed to the manage function
|
||||
- group: root
|
||||
- mode: 644
|
||||
@ -59,7 +59,7 @@ A well-written state function will follow these steps:
|
||||
This is an extremely simplified example. Feel free to browse the `source
|
||||
code`_ for Salt's state modules to see other examples.
|
||||
|
||||
.. _`source code`: https://github.com/saltstack/salt/tree/develop/salt/states
|
||||
.. _`source code`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/states
|
||||
|
||||
1. Set up the return dictionary and perform any necessary input validation
|
||||
(type checking, looking for use of mutually-exclusive arguments, etc.).
|
||||
|
@ -31,7 +31,7 @@ imports, to decide whether to load the module. In most cases, it will return a
|
||||
filename, then that name should be returned instead of ``True``. An example of
|
||||
this may be seen in the Azure module:
|
||||
|
||||
https://github.com/saltstack/salt/tree/develop/salt/cloud/clouds/msazure.py
|
||||
https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/cloud/clouds/msazure.py
|
||||
|
||||
The get_configured_provider() Function
|
||||
--------------------------------------
|
||||
@ -57,7 +57,7 @@ created by the cloud host, wait for it to become available, and then
|
||||
A good example to follow for writing a cloud driver module based on libcloud
|
||||
is the module provided for Linode:
|
||||
|
||||
https://github.com/saltstack/salt/tree/develop/salt/cloud/clouds/linode.py
|
||||
https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/cloud/clouds/linode.py
|
||||
|
||||
The basic flow of a ``create()`` function is as follows:
|
||||
|
||||
@ -183,7 +183,7 @@ imports should be absent from the Salt Cloud module.
|
||||
|
||||
A good example of a non-libcloud driver is the DigitalOcean driver:
|
||||
|
||||
https://github.com/saltstack/salt/tree/develop/salt/cloud/clouds/digitalocean.py
|
||||
https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/cloud/clouds/digitalocean.py
|
||||
|
||||
The ``create()`` Function
|
||||
-------------------------
|
||||
|
@ -89,7 +89,7 @@ functions include:
|
||||
A good, well commented example of this process is the Fedora deployment
|
||||
script:
|
||||
|
||||
https://github.com/saltstack/salt/blob/develop/salt/cloud/deploy/Fedora.sh
|
||||
https://github.com/saltstack/salt/blob/|repo_primary_branch|/salt/cloud/deploy/Fedora.sh
|
||||
|
||||
A number of legacy deploy scripts are included with the release tarball. None
|
||||
of them are as functional or complete as Salt Bootstrap, and are still included
|
||||
|
@ -78,12 +78,12 @@ Fork a Repo Guide_>`_ and is well worth reading.
|
||||
git fetch upstream
|
||||
git checkout -b fix-broken-thing upstream/2016.11
|
||||
|
||||
If you're working on a feature, create your branch from the develop branch.
|
||||
If you're working on a feature, create your branch from the |repo_primary_branch| branch.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git fetch upstream
|
||||
git checkout -b add-cool-feature upstream/develop
|
||||
git checkout -b add-cool-feature upstream/|repo_primary_branch|
|
||||
|
||||
#. Edit and commit changes to your branch.
|
||||
|
||||
@ -149,7 +149,7 @@ Fork a Repo Guide_>`_ and is well worth reading.
|
||||
.. code-block:: bash
|
||||
|
||||
git fetch upstream
|
||||
git rebase upstream/develop add-cool-feature
|
||||
git rebase upstream/|repo_primary_branch| add-cool-feature
|
||||
git push -u origin add-cool-feature
|
||||
|
||||
If you do rebase, and the push is rejected with a
|
||||
@ -185,9 +185,9 @@ Fork a Repo Guide_>`_ and is well worth reading.
|
||||
|
||||
https://github.com/my-account/salt/compare/saltstack:2016.11...fix-broken-thing
|
||||
|
||||
If your branch is a feature, choose ``develop`` as the base branch,
|
||||
If your branch is a feature, choose ``|repo_primary_branch|`` as the base branch,
|
||||
|
||||
https://github.com/my-account/salt/compare/saltstack:develop...add-cool-feature
|
||||
https://github.com/my-account/salt/compare/saltstack:|repo_primary_branch|...add-cool-feature
|
||||
|
||||
#. Review that the proposed changes are what you expect.
|
||||
#. Write a descriptive comment. Include links to related issues (e.g.
|
||||
@ -219,10 +219,10 @@ Fork a Repo Guide_>`_ and is well worth reading.
|
||||
Salt's Branch Topology
|
||||
----------------------
|
||||
|
||||
There are three different kinds of branches in use: develop, main release
|
||||
There are three different kinds of branches in use: |repo_primary_branch|, main release
|
||||
branches, and dot release branches.
|
||||
|
||||
- All feature work should go into the ``develop`` branch.
|
||||
- All feature work should go into the ``|repo_primary_branch|`` branch.
|
||||
- Bug fixes and documentation changes should go into the oldest **supported
|
||||
main** release branch affected by the the bug or documentation change (you
|
||||
can use the blame button in github to figure out when the bug was introduced).
|
||||
@ -236,22 +236,22 @@ branches, and dot release branches.
|
||||
|
||||
.. note::
|
||||
|
||||
GitHub will open pull requests against Salt's main branch, ``develop``,
|
||||
GitHub will open pull requests against Salt's main branch, ``|repo_primary_branch|``,
|
||||
by default. Be sure to check which branch is selected when creating the
|
||||
pull request.
|
||||
|
||||
The Develop Branch
|
||||
==================
|
||||
The |repo_primary_branch| Branch
|
||||
================================
|
||||
|
||||
The ``develop`` branch is unstable and bleeding-edge. Pull requests containing
|
||||
feature additions or non-bug-fix changes should be made against the ``develop``
|
||||
The ``|repo_primary_branch|`` branch is unstable and bleeding-edge. Pull requests containing
|
||||
feature additions or non-bug-fix changes should be made against the ``|repo_primary_branch|``
|
||||
branch.
|
||||
|
||||
.. note::
|
||||
|
||||
If you have a bug fix or documentation change and have already forked your
|
||||
working branch from ``develop`` and do not know how to rebase your commits
|
||||
against another branch, then submit it to ``develop`` anyway. SaltStack's
|
||||
working branch from ``|repo_primary_branch|`` and do not know how to rebase your commits
|
||||
against another branch, then submit it to ``|repo_primary_branch|`` anyway. SaltStack's
|
||||
development team will be happy to back-port it to the correct branch.
|
||||
|
||||
**Please make sure you let the maintainers know that the pull request needs
|
||||
@ -298,7 +298,7 @@ automatically be "merged-forward" into the newer branches.
|
||||
|
||||
For example, a pull request is merged into ``2017.7``. Then, the entire
|
||||
``2017.7`` branch is merged-forward into the ``2018.3`` branch, and the
|
||||
``2018.3`` branch is merged-forward into the ``develop`` branch.
|
||||
``2018.3`` branch is merged-forward into the ``|repo_primary_branch|`` branch.
|
||||
|
||||
This process makes is easy for contributors to make only one pull-request
|
||||
against an older branch, but allows the change to propagate to all **main**
|
||||
@ -338,7 +338,7 @@ message text directly. Only including the text in a pull request will not
|
||||
close the issue.
|
||||
|
||||
GitHub will close the referenced issue once the *commit* containing the
|
||||
magic text is merged into the default branch (``develop``). Any magic text
|
||||
magic text is merged into the default branch (``|repo_primary_branch|``). Any magic text
|
||||
input only into the pull request description will not be seen at the
|
||||
Git-level when those commits are merged-forward. In other words, only the
|
||||
commits are merged-forward and not the pull request text.
|
||||
@ -348,7 +348,7 @@ commits are merged-forward and not the pull request text.
|
||||
Backporting Pull Requests
|
||||
=========================
|
||||
|
||||
If a bug is fixed on ``develop`` and the bug is also present on a
|
||||
If a bug is fixed on ``|repo_primary_branch|`` and the bug is also present on a
|
||||
currently-supported release branch, it will need to be back-ported to an
|
||||
applicable branch.
|
||||
|
||||
@ -363,11 +363,11 @@ applicable branch.
|
||||
changes themselves.
|
||||
|
||||
It is often easiest to fix a bug on the oldest supported release branch and
|
||||
then merge that branch forward into ``develop`` (as described earlier in this
|
||||
then merge that branch forward into ``|repo_primary_branch|`` (as described earlier in this
|
||||
document). When that is not possible the fix must be back-ported, or copied,
|
||||
into any other affected branches.
|
||||
|
||||
These steps assume a pull request ``#1234`` has been merged into ``develop``.
|
||||
These steps assume a pull request ``#1234`` has been merged into ``|repo_primary_branch|``.
|
||||
And ``upstream`` is the name of the remote pointing to the main Salt repo.
|
||||
|
||||
#. Identify the oldest supported release branch that is affected by the bug.
|
||||
@ -450,20 +450,20 @@ the name of the main `saltstack/salt`_ repository.
|
||||
|
||||
git fetch upstream
|
||||
|
||||
#. Update your copy of the ``develop`` branch.
|
||||
#. Update your copy of the ``|repo_primary_branch|`` branch.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git checkout develop
|
||||
git merge --ff-only upstream/develop
|
||||
git checkout |repo_primary_branch|
|
||||
git merge --ff-only upstream/|repo_primary_branch|
|
||||
|
||||
If Git complains that a fast-forward merge is not possible, you have local
|
||||
commits.
|
||||
|
||||
* Run ``git pull --rebase origin develop`` to rebase your changes on top of
|
||||
* Run ``git pull --rebase origin |repo_primary_branch|`` to rebase your changes on top of
|
||||
the upstream changes.
|
||||
* Or, run ``git branch <branch-name>`` to create a new branch with your
|
||||
commits. You will then need to reset your ``develop`` branch before
|
||||
commits. You will then need to reset your ``|repo_primary_branch|`` branch before
|
||||
updating it with the changes from upstream.
|
||||
|
||||
If Git complains that local files will be overwritten, you have changes to
|
||||
@ -474,7 +474,7 @@ the name of the main `saltstack/salt`_ repository.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git push origin develop
|
||||
git push origin |repo_primary_branch|
|
||||
|
||||
#. Repeat the previous two steps for any other branches you work with, such as
|
||||
the current release branch.
|
||||
@ -551,6 +551,6 @@ Script, see the Bootstrap Script's `Contributing Guidelines`_.
|
||||
.. _GPG Probot: https://probot.github.io/apps/gpg/
|
||||
.. _help articles: https://help.github.com/articles/signing-commits-with-gpg/
|
||||
.. _GPG Signature Verification feature announcement: https://github.com/blog/2144-gpg-signature-verification
|
||||
.. _bootstrap-salt.sh: https://github.com/saltstack/salt/blob/develop/salt/cloud/deploy/bootstrap-salt.sh
|
||||
.. _bootstrap-salt.sh: https://github.com/saltstack/salt/blob/|repo_primary_branch|/salt/cloud/deploy/bootstrap-salt.sh
|
||||
.. _salt-bootstrap repo: https://github.com/saltstack/salt-bootstrap
|
||||
.. _Contributing Guidelines: https://github.com/saltstack/salt-bootstrap/blob/develop/CONTRIBUTING.md
|
||||
|
@ -182,7 +182,7 @@ From above example, 'external_pillar' is the top dictionary name. Therefore:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt-call '*' pillar.get external_pillar
|
||||
salt '*' pillar.get external_pillar
|
||||
|
||||
|
||||
You shouldn't just add items to ``pillar`` and return that, since that will
|
||||
|
@ -69,7 +69,7 @@ test files for Salt execution modules.
|
||||
in the ``test_module_name_source_match`` function. This unit test
|
||||
ensures that we maintain the naming convention for test files.
|
||||
|
||||
.. __: https://github.com/saltstack/salt/blob/develop/tests/filename_map.yml
|
||||
.. __: https://github.com/saltstack/salt/blob/|repo_primary_branch|/tests/filename_map.yml
|
||||
|
||||
|
||||
Integration Tests
|
||||
@ -416,13 +416,13 @@ Tests for New Features
|
||||
|
||||
If you are adding new functionality to Salt, please write the tests for this new
|
||||
feature in the same pull request as the new feature. New features should always be
|
||||
submitted to the ``develop`` branch.
|
||||
submitted to the ``|repo_primary_branch|`` branch.
|
||||
|
||||
If you have already submitted the new feature, but did not write tests in the original
|
||||
pull request that has already been merged, please feel free to submit a new pull
|
||||
request containing tests. If the feature was recently added to Salt's ``develop``
|
||||
request containing tests. If the feature was recently added to Salt's ``|repo_primary_branch|``
|
||||
branch, then the tests should be added there as well. However, if the feature was
|
||||
added to ``develop`` some time ago and is already present in one or more release
|
||||
added to ``|repo_primary_branch|`` some time ago and is already present in one or more release
|
||||
branches, please refer to the `Tests for Entire Files or Functions`_ section below
|
||||
for more details about where to submit tests for functions or files that do not
|
||||
already have tests.
|
||||
@ -448,7 +448,7 @@ earliest supported release branch that contains the file or function you're test
|
||||
Once your tests are submitted in a pull request and is merged into the branch in
|
||||
question, the tests you wrote will be merged-forward by SaltStack core engineers and
|
||||
the new tests will propagate to the newer release branches. That way the tests you
|
||||
wrote will apply to all current and relevant release branches, and not just the ``develop``
|
||||
wrote will apply to all current and relevant release branches, and not just the ``|repo_primary_branch|``
|
||||
branch, for example. This methodology will help protect against regressions on older
|
||||
files in Salt's codebase.
|
||||
|
||||
|
@ -1,97 +0,0 @@
|
||||
Translating Documentation
|
||||
=========================
|
||||
|
||||
If you wish to help translate the Salt documentation to your language, please
|
||||
head over to the `Transifex`_ website and `signup`__ for an account.
|
||||
|
||||
Once registered, head over to the `Salt Translation Project`__, and either
|
||||
click on **Request Language** if you can't find yours, or, select the language
|
||||
for which you wish to contribute and click **Join Team**.
|
||||
|
||||
`Transifex`_ provides some useful reading resources on their `support
|
||||
domain`__, namely, some useful articles `directed to translators`__.
|
||||
|
||||
|
||||
.. __: https://www.transifex.com/signup/
|
||||
.. __: https://www.transifex.com/projects/p/salt/
|
||||
.. __: http://support.transifex.com/
|
||||
.. __: http://support.transifex.com/customer/portal/topics/414107-translators/articles
|
||||
|
||||
|
||||
Building A Localized Version of the Documentation
|
||||
-------------------------------------------------
|
||||
|
||||
While you're working on your translation on `Transifex`_, you might want to
|
||||
have a look at how it's rendering.
|
||||
|
||||
|
||||
Install The Transifex Client
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To interact with the `Transifex`_ web service you will need to install the
|
||||
`transifex-client`__:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install transifex-client
|
||||
|
||||
|
||||
.. __: https://github.com/transifex/transifex-client
|
||||
|
||||
|
||||
|
||||
Configure The Transifex Client
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once installed, you will need to set it up on your computer. We created a
|
||||
script to help you with that:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.scripts/setup-transifex-config
|
||||
|
||||
|
||||
|
||||
Download Remote Translations
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There's a little script which simplifies the download process of the
|
||||
translations(which isn't that complicated in the first place).
|
||||
So, let's assume you're translating ``pt_PT``, Portuguese(Portugal). To
|
||||
download the translations, execute from the ``doc/`` directory of your Salt
|
||||
checkout:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
make download-translations SPHINXLANG=pt_PT
|
||||
|
||||
|
||||
To download ``pt_PT``, Portuguese(Portugal), and ``nl``, Dutch, you can use the
|
||||
helper script directly:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.scripts/download-translation-catalog pt_PT nl
|
||||
|
||||
|
||||
Build Localized Documentation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
After the download process finishes, which might take a while, the next step is
|
||||
to build a localized version of the documentation.
|
||||
Following the ``pt_PT`` example above:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make html SPHINXLANG=pt_PT
|
||||
|
||||
|
||||
View Localized Documentation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Open your browser, point it to the local documentation path and check the
|
||||
localized output you've just build.
|
||||
|
||||
|
||||
.. _`Transifex`: https://www.transifex.com
|
@ -48,21 +48,21 @@ completed, add SaltStack as a second remote and fetch any changes from
|
||||
$ git remote add upstream https://github.com/saltstack/salt.git
|
||||
$ git fetch upstream
|
||||
|
||||
For this tutorial, we will be working off from the ``develop`` branch, which is
|
||||
For this tutorial, we will be working off from the ``|repo_primary_branch|`` branch, which is
|
||||
the default branch for the SaltStack GitHub project. This branch needs to
|
||||
track ``upstream/develop`` so that we will get all upstream changes when they
|
||||
track ``upstream/|repo_primary_branch|`` so that we will get all upstream changes when they
|
||||
happen.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout develop
|
||||
$ git branch --set-upstream-to upstream/develop
|
||||
$ git checkout |repo_primary_branch|
|
||||
$ git branch --set-upstream-to upstream/|repo_primary_branch|
|
||||
|
||||
-----
|
||||
Fetch
|
||||
-----
|
||||
|
||||
Fetch any ``upstream`` changes on the ``develop`` branch and sync them to your
|
||||
Fetch any ``upstream`` changes on the ``|repo_primary_branch|`` branch and sync them to your
|
||||
local copy of the branch with a single command:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -84,7 +84,7 @@ Now we are ready to get to work. Consult the `sprint beginner bug list
|
||||
and select an execution module whose ``__virtual__`` function needs to be
|
||||
updated. I'll select the ``alternatives`` module.
|
||||
|
||||
Create a new branch off from ``develop``. Be sure to name it something short
|
||||
Create a new branch off from ``|repo_primary_branch|``. Be sure to name it something short
|
||||
and descriptive.
|
||||
|
||||
.. code-block:: bash
|
||||
@ -173,7 +173,7 @@ In your browser, navigate to the `new pull request
|
||||
<https://github.com/saltstack/salt/compare>`_ page on the ``saltstack/salt``
|
||||
GitHub repository and click on ``compare across forks``. Select
|
||||
``<my_account>`` from the list of head forks and the branch you are wanting to
|
||||
merge into ``develop`` (``virt_ret`` in this case).
|
||||
merge into ``|repo_primary_branch|`` (``virt_ret`` in this case).
|
||||
|
||||
When you have finished reviewing the changes, click ``Create pull request``.
|
||||
|
||||
@ -194,7 +194,7 @@ request``.
|
||||
|
||||
* I find it easiest to edit the following URL:
|
||||
|
||||
``https://github.com/saltstack/salt/compare/develop...<my_account>:virt_ret``
|
||||
``https://github.com/saltstack/salt/compare/|repo_primary_branch|...<my_account>:virt_ret``
|
||||
|
||||
---------
|
||||
Resources
|
||||
|
@ -265,7 +265,7 @@ customize or fix bugs. It will also allow you to build your own installation.
|
||||
There are several scripts to automate creating a Windows installer as well as
|
||||
setting up an environment that facilitates developing and troubleshooting Salt
|
||||
code. They are located in the ``pkg\windows`` directory in the Salt repo
|
||||
`(here) <https://github.com/saltstack/salt/tree/develop/pkg/windows>`_.
|
||||
`(here) <https://github.com/saltstack/salt/tree/|repo_primary_branch|/pkg/windows>`_.
|
||||
|
||||
Scripts:
|
||||
--------
|
||||
|
@ -741,11 +741,11 @@ done:
|
||||
option in the `master config template`_ should be updated to show the correct
|
||||
new default value.
|
||||
|
||||
.. _`salt/renderers/`: https://github.com/saltstack/salt/tree/develop/salt/renderers/
|
||||
.. _`salt/config/__init__.py`: https://github.com/saltstack/salt/tree/develop/salt/config/__init__.py
|
||||
.. _`master config file`: https://github.com/saltstack/salt/tree/develop/doc/ref/configuration/master.rst
|
||||
.. _`minion config file`: https://github.com/saltstack/salt/tree/develop/doc/ref/configuration/minion.rst
|
||||
.. _`master config template`: https://github.com/saltstack/salt/tree/develop/conf/master
|
||||
.. _`salt/renderers/`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/renderers/
|
||||
.. _`salt/config/__init__.py`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/salt/config/__init__.py
|
||||
.. _`master config file`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/doc/ref/configuration/master.rst
|
||||
.. _`minion config file`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/doc/ref/configuration/minion.rst
|
||||
.. _`master config template`: https://github.com/saltstack/salt/tree/|repo_primary_branch|/conf/master
|
||||
|
||||
Binary Data in the Pillar
|
||||
=========================
|
||||
|
@ -929,11 +929,12 @@ you can now configure which type numbers indicate a login and logout.
|
||||
See the :py:mod:`wtmp beacon documentation <salt.beacons.wtmp>` for more
|
||||
information.
|
||||
|
||||
Deprecations
|
||||
============
|
||||
|
||||
API Deprecations
|
||||
----------------
|
||||
Deprecated and Removed Options
|
||||
==============================
|
||||
|
||||
API Removed Arguments
|
||||
---------------------
|
||||
|
||||
Support for :ref:`LocalClient <local-client>`'s ``expr_form`` argument has
|
||||
been removed. Please use ``tgt_type`` instead. This change was made due to
|
||||
@ -952,14 +953,14 @@ their code to use ``tgt_type``.
|
||||
>>> local.cmd('*', 'cmd.run', ['whoami'], tgt_type='glob')
|
||||
{'jerry': 'root'}
|
||||
|
||||
Minion Configuration Deprecations
|
||||
---------------------------------
|
||||
Minion Configuration Deprecated Option
|
||||
--------------------------------------
|
||||
|
||||
The :conf_minion:`master_shuffle` configuration option is deprecated as of the
|
||||
``2019.2.0`` release. Please use the :conf_minion:`random_master` option instead.
|
||||
|
||||
Module Deprecations
|
||||
-------------------
|
||||
Module Removed Options
|
||||
----------------------
|
||||
|
||||
- The :py:mod:`napalm_network <salt.modules.napalm_network>` module has been
|
||||
changed as follows:
|
||||
@ -1011,8 +1012,8 @@ Module Deprecations
|
||||
functions have been removed. Please use :py:func:`win_wua.list
|
||||
<salt.modules.win_wua.list_>` instead.
|
||||
|
||||
Pillar Deprecations
|
||||
-------------------
|
||||
Pillar Removed Option
|
||||
---------------------
|
||||
|
||||
- The :py:mod:`vault <salt.pillar.vault>` external pillar has been changed as
|
||||
follows:
|
||||
@ -1020,8 +1021,8 @@ Pillar Deprecations
|
||||
- Support for the ``profile`` argument was removed. Any options passed up
|
||||
until and following the first ``path=`` are discarded.
|
||||
|
||||
Roster Deprecations
|
||||
-------------------
|
||||
Roster Removed Option
|
||||
---------------------
|
||||
|
||||
- The :py:mod:`cache <salt.roster.cache>` roster has been changed as follows:
|
||||
|
||||
@ -1032,8 +1033,8 @@ Roster Deprecations
|
||||
``private``, ``public``, ``global`` or ``local`` settings. The syntax for
|
||||
these settings has changed to ``ipv4-*`` or ``ipv6-*``, respectively.
|
||||
|
||||
State Deprecations
|
||||
------------------
|
||||
State Removed Modules and Options
|
||||
---------------------------------
|
||||
|
||||
- The ``docker`` state module has been removed
|
||||
|
||||
@ -1126,8 +1127,8 @@ State Deprecations
|
||||
- Support for virtual packages has been removed from the
|
||||
py:mod:`pkg state <salt.states.pkg>`.
|
||||
|
||||
Utils Deprecations
|
||||
------------------
|
||||
Utils Removed Options
|
||||
---------------------
|
||||
|
||||
The ``cloud`` utils module had the following changes:
|
||||
|
||||
@ -1151,7 +1152,7 @@ been deprecated in favor of ``pypsexec``.
|
||||
Salt-Cloud has deprecated the use ``impacket`` in favor of ``smbprotocol``.
|
||||
This changes was made because ``impacket`` is not compatible with Python 3.
|
||||
|
||||
SaltSSH major updates
|
||||
SaltSSH Major Updates
|
||||
=====================
|
||||
|
||||
SaltSSH now works across different major Python versions. Python 2.7 ~ Python 3.x
|
||||
|
@ -7,16 +7,72 @@ Version 2019.2.2 is a bugfix release for :ref:`2019.2.0 <release-2019-2-0>`.
|
||||
Statistics
|
||||
==========
|
||||
|
||||
- Total Merges: **20**
|
||||
- Total Issue References: **11**
|
||||
- Total PR References: **20**
|
||||
- Total Merges: **26**
|
||||
- Total Issue References: **12**
|
||||
- Total PR References: **26**
|
||||
|
||||
- Contributors: **12** (`Akm0d`_, `Ch3LL`_, `Oloremo`_, `OrlandoArcapix`_, `bryceml`_, `dhiltonp`_, `dwoz`_, `frogunder`_, `garethgreenaway`_, `javierbertoli`_, `pizzapanther`_, `s0undt3ch`_)
|
||||
- Contributors: **13** (`Akm0d`_, `Ch3LL`_, `Oloremo`_, `OrlandoArcapix`_, `bryceml`_, `dhiltonp`_, `dwoz`_, `frogunder`_, `garethgreenaway`_, `javierbertoli`_, `pizzapanther`_, `s0undt3ch`_, `twangboy`_)
|
||||
|
||||
Changelog for v2019.2.1..v2019.2.2
|
||||
==================================
|
||||
|
||||
*Generated at: 2019-10-02 18:33:46 UTC*
|
||||
*Generated at: 2019-10-11 20:54:15 UTC*
|
||||
|
||||
* **PR** `#54919`_: (`twangboy`_) Add missing docs for win_wusa state and module (2019.2.1)
|
||||
@ *2019-10-11 18:28:11 UTC*
|
||||
|
||||
* 7d253bc Merge pull request `#54919`_ from twangboy/update_docs
|
||||
|
||||
* 57ff199 Add docs for win_wusa
|
||||
|
||||
* **ISSUE** `#54941`_: (`UtahDave`_) Pillar data is refreshed for EVERY salt command in 2019.2.1 and 2019.2.2 (refs: `#54942`_)
|
||||
|
||||
* **PR** `#54942`_: (`dwoz`_) Fix for 54941 pillar_refresh regression
|
||||
@ *2019-10-11 18:27:31 UTC*
|
||||
|
||||
* 2f817bc Merge pull request `#54942`_ from dwoz/fix-54941
|
||||
|
||||
* cb5d326 Add a test for 54941 using test.ping
|
||||
|
||||
* 348d1c4 Add regression tests for issue 54941
|
||||
|
||||
* 766f3ca Initial commit of a potential fix for 54941
|
||||
|
||||
* **PR** `#54897`_: (`bryceml`_) update version numbers to be correct
|
||||
@ *2019-10-05 01:59:14 UTC*
|
||||
|
||||
* f783108 Merge pull request `#54897`_ from bryceml/2019.2.1_fix_docs
|
||||
|
||||
* e9a2a70 update version numbers to be correct
|
||||
|
||||
* **PR** `#54894`_: (`bryceml`_) 2019.2.1 fix docs
|
||||
@ *2019-10-04 22:31:26 UTC*
|
||||
|
||||
* 3233663 Merge pull request `#54894`_ from bryceml/2019.2.1_fix_docs
|
||||
|
||||
* 2456aaa Porting PR `#52948`_ to 2019.2.1
|
||||
|
||||
* 94a1e3b Porting PR `#52752`_ to 2019.2.1
|
||||
|
||||
* c7b7474 modifying saltconf ads
|
||||
|
||||
* d48057b add new saltconf ads
|
||||
|
||||
* **PR** `#54858`_: (`frogunder`_) remove in progress from releasenotes 2019.2.2
|
||||
@ *2019-10-02 20:42:59 UTC*
|
||||
|
||||
* 4b06eca Merge pull request `#54858`_ from frogunder/releasenotes_remove2019.2.2
|
||||
|
||||
* a697abd remove in progress from releasenotes 2019.2.2
|
||||
|
||||
* **PR** `#54854`_: (`frogunder`_) releasenotes 2019.2.2
|
||||
@ *2019-10-02 18:58:21 UTC*
|
||||
|
||||
* aaf2d1c Merge pull request `#54854`_ from frogunder/release_notes_2019.2.2
|
||||
|
||||
* a41dc59 Update 2019.2.2.rst
|
||||
|
||||
* 9bea043 releasenotes 2019.2.2
|
||||
|
||||
* **PR** `#54852`_: (`frogunder`_) Update man pages for 2019.2.2
|
||||
@ *2019-10-02 18:27:07 UTC*
|
||||
@ -97,7 +153,7 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
|
||||
* c585550 fix broken salt-cloud openstack query
|
||||
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54807`_, `#54784`_, `#54823`_)
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54823`_, `#54784`_, `#54807`_)
|
||||
|
||||
* **PR** `#54823`_: (`dhiltonp`_) ip_bracket can now accept ipv6 addresses with brackets
|
||||
@ *2019-10-01 01:13:34 UTC*
|
||||
@ -106,7 +162,7 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
|
||||
* faa1d98 ip_bracket can now accept ipv6 addresses with brackets
|
||||
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54807`_, `#54784`_, `#54823`_)
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54823`_, `#54784`_, `#54807`_)
|
||||
|
||||
* **PR** `#54807`_: (`dwoz`_) Fix pip state pip >=10.0 and <=18.0
|
||||
@ *2019-09-30 09:20:14 UTC*
|
||||
@ -193,7 +249,7 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
|
||||
* a35e609 Adding __init__.py to metaproxy directory so that metaproxy is included when running setup.py.
|
||||
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54807`_, `#54784`_, `#54823`_)
|
||||
* **ISSUE** `#54762`_: (`margau`_) 2019.2.1: Breaks Minion-Master Communication (refs: `#54823`_, `#54784`_, `#54807`_)
|
||||
|
||||
* **PR** `#54784`_: (`dhiltonp`_) fix dns_check to return uri-compatible ipv6 addresses, add tests
|
||||
@ *2019-09-28 08:36:51 UTC*
|
||||
@ -242,6 +298,8 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
* 168a6c1 switch to ruby 2.6.3
|
||||
|
||||
.. _`#1`: https://github.com/saltstack/salt/issues/1
|
||||
.. _`#52752`: https://github.com/saltstack/salt/pull/52752
|
||||
.. _`#52948`: https://github.com/saltstack/salt/pull/52948
|
||||
.. _`#54521`: https://github.com/saltstack/salt/issues/54521
|
||||
.. _`#54706`: https://github.com/saltstack/salt/pull/54706
|
||||
.. _`#54731`: https://github.com/saltstack/salt/pull/54731
|
||||
@ -271,12 +329,20 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
.. _`#54830`: https://github.com/saltstack/salt/pull/54830
|
||||
.. _`#54845`: https://github.com/saltstack/salt/pull/54845
|
||||
.. _`#54852`: https://github.com/saltstack/salt/pull/54852
|
||||
.. _`#54854`: https://github.com/saltstack/salt/pull/54854
|
||||
.. _`#54858`: https://github.com/saltstack/salt/pull/54858
|
||||
.. _`#54894`: https://github.com/saltstack/salt/pull/54894
|
||||
.. _`#54897`: https://github.com/saltstack/salt/pull/54897
|
||||
.. _`#54919`: https://github.com/saltstack/salt/pull/54919
|
||||
.. _`#54941`: https://github.com/saltstack/salt/issues/54941
|
||||
.. _`#54942`: https://github.com/saltstack/salt/pull/54942
|
||||
.. _`Akm0d`: https://github.com/Akm0d
|
||||
.. _`Ch3LL`: https://github.com/Ch3LL
|
||||
.. _`Oloremo`: https://github.com/Oloremo
|
||||
.. _`OrangeDog`: https://github.com/OrangeDog
|
||||
.. _`OrlandoArcapix`: https://github.com/OrlandoArcapix
|
||||
.. _`Reiner030`: https://github.com/Reiner030
|
||||
.. _`UtahDave`: https://github.com/UtahDave
|
||||
.. _`awerner`: https://github.com/awerner
|
||||
.. _`bryceml`: https://github.com/bryceml
|
||||
.. _`dhiltonp`: https://github.com/dhiltonp
|
||||
@ -290,3 +356,4 @@ Changelog for v2019.2.1..v2019.2.2
|
||||
.. _`paul-palmer`: https://github.com/paul-palmer
|
||||
.. _`pizzapanther`: https://github.com/pizzapanther
|
||||
.. _`s0undt3ch`: https://github.com/s0undt3ch
|
||||
.. _`twangboy`: https://github.com/twangboy
|
||||
|
@ -8,7 +8,7 @@ Installing/Testing a Salt Release Candidate
|
||||
|
||||
It's time for a new feature release of Salt! Follow the instructions below to
|
||||
install the latest release candidate of Salt, and try :ref:`all the shiny new
|
||||
features <release-2018-3-0>`! Be sure to report any bugs you find on `Github
|
||||
features <release-2019-2-0>`! Be sure to report any bugs you find on `Github
|
||||
<https://github.com/saltstack/salt/issues/new/>`_.
|
||||
|
||||
Installing Using Packages
|
||||
@ -18,22 +18,52 @@ Builds for a few platforms are available as part of the RC at https://repo.salts
|
||||
|
||||
.. note::
|
||||
|
||||
For RHEL and Ubuntu, Follow the instructions on
|
||||
https://repo.saltstack.com/, but insert ``salt_rc/`` into the URL between
|
||||
the hostname and the remainder of the path. For example:
|
||||
Follow the instructions on https://repo.saltstack.com/,
|
||||
but insert ``salt_rc/`` into the URL between the hostname
|
||||
and the remainder of the path.
|
||||
|
||||
For Redhat Python 2
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
baseurl=https://repo.saltstack.com/salt_rc/yum/redhat/$releasever/$basearch/
|
||||
|
||||
For Redhat Python 3
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
baseurl=https://repo.saltstack.com/salt_rc/py3/redhat/$releasever/$basearch/
|
||||
|
||||
For Ubuntu Python 2
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
deb http://repo.saltstack.com/salt_rc/apt/ubuntu/14.04/amd64 jessie main
|
||||
deb http://repo.saltstack.com/salt_rc/apt/ubuntu/18.04/amd64 bionic main
|
||||
|
||||
For Ubuntu Python 3
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
deb http://repo.saltstack.com/salt_rc/py3/ubuntu/18.04/amd64 bionic main
|
||||
|
||||
For Debian Python 2
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
deb http://repo.saltstack.com/salt_rc/apt/debian/9/amd64 stretch main
|
||||
|
||||
For Debian Python 3
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
deb http://repo.saltstack.com/salt_rc/py3/debian/9/amd64 stretch main
|
||||
|
||||
|
||||
Available builds:
|
||||
|
||||
- Ubuntu16
|
||||
- Redhat7
|
||||
- Ubuntu 18
|
||||
- Debian 9
|
||||
- Redhat 7
|
||||
- Windows
|
||||
|
||||
.. FreeBSD
|
||||
@ -47,14 +77,14 @@ You can install a release candidate of Salt using `Salt Bootstrap
|
||||
.. code-block:: bash
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -P git v2018.3.0rc1
|
||||
sudo sh install_salt.sh -P git v2019.2.0rc1
|
||||
|
||||
If you want to also install a master using Salt Bootstrap, use the ``-M`` flag:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -P -M git v2018.3.0rc1
|
||||
sudo sh install_salt.sh -P -M git v2019.2.0rc1
|
||||
|
||||
If you want to install only a master and not a minion using Salt Bootstrap, use
|
||||
the ``-M`` and ``-N`` flags:
|
||||
@ -62,13 +92,13 @@ the ``-M`` and ``-N`` flags:
|
||||
.. code-block:: bash
|
||||
|
||||
curl -o install_salt.sh -L https://bootstrap.saltstack.com
|
||||
sudo sh install_salt.sh -P -M -N git v2018.3.0rc1
|
||||
sudo sh install_salt.sh -P -M -N git v2019.2.0rc1
|
||||
|
||||
Installing Using PyPI
|
||||
=====================
|
||||
|
||||
Installing from the `source archive
|
||||
<https://pypi.python.org/pypi?:action=display&name=salt&version=2018.3.0rc1>`_ on
|
||||
<https://pypi.python.org/pypi?:action=display&name=salt&version=2019.2.0rc1>`_ on
|
||||
`PyPI <https://pypi.python.org/pypi>`_ is fairly straightforward.
|
||||
|
||||
.. note::
|
||||
@ -106,4 +136,4 @@ Then install salt using the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo pip install salt==2018.3.0rc1
|
||||
sudo pip install salt==2019.2.0rc1
|
||||
|
@ -4,18 +4,6 @@
|
||||
Thorium Complex Reactor
|
||||
=======================
|
||||
|
||||
.. note::
|
||||
|
||||
Thorium is a provisional feature of Salt and is subject to change
|
||||
and removal if the feature proves to not be a viable solution.
|
||||
|
||||
.. note::
|
||||
|
||||
Thorium was added to Salt as an experimental feature in the 2016.3.0
|
||||
release, as of 2016.3.0 this feature is considered experimental, no
|
||||
guarantees are made for support of any kind yet.
|
||||
|
||||
|
||||
The original Salt Reactor is based on the idea of listening for a specific
|
||||
event and then reacting to it. This model comes with many logical limitations,
|
||||
for instance it is very difficult (and hacky) to fire a reaction based on
|
||||
|
307
noxfile.py
307
noxfile.py
@ -15,6 +15,7 @@ import json
|
||||
import pprint
|
||||
import shutil
|
||||
import tempfile
|
||||
import datetime
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.stderr.write('Do not execute this file directly. Use nox instead, it will know how to handle this file\n')
|
||||
@ -34,8 +35,8 @@ PIP_INSTALL_SILENT = (os.environ.get('JENKINS_URL') or os.environ.get('CI') or o
|
||||
# Global Path Definitions
|
||||
REPO_ROOT = os.path.abspath(os.path.dirname(__file__))
|
||||
SITECUSTOMIZE_DIR = os.path.join(REPO_ROOT, 'tests', 'support', 'coverage')
|
||||
IS_DARWIN = sys.platform.lower().startswith('darwin')
|
||||
IS_WINDOWS = sys.platform.lower().startswith('win')
|
||||
|
||||
# Python versions to run against
|
||||
_PYTHON_VERSIONS = ('2', '2.7', '3', '3.4', '3.5', '3.6', '3.7')
|
||||
|
||||
@ -45,10 +46,18 @@ nox.options.reuse_existing_virtualenvs = True
|
||||
# Don't fail on missing interpreters
|
||||
nox.options.error_on_missing_interpreters = False
|
||||
|
||||
# Change current directory to REPO_ROOT
|
||||
os.chdir(REPO_ROOT)
|
||||
|
||||
RUNTESTS_LOGFILE = os.path.join(
|
||||
'artifacts', 'logs',
|
||||
'runtests-{}.log'.format(datetime.datetime.now().strftime('%Y%m%d%H%M%S.%f'))
|
||||
)
|
||||
|
||||
|
||||
def _create_ci_directories():
|
||||
for dirname in ('logs', 'coverage', 'xml-unittests-output'):
|
||||
path = os.path.join(REPO_ROOT, 'artifacts', dirname)
|
||||
path = os.path.join('artifacts', dirname)
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
@ -175,9 +184,9 @@ def _install_system_packages(session):
|
||||
shutil.copyfile(src, dst)
|
||||
|
||||
|
||||
def _install_requirements(session, transport, *extra_requirements):
|
||||
def _get_distro_pip_constraints(session, transport):
|
||||
# Install requirements
|
||||
distro_requirements = None
|
||||
distro_constraints = []
|
||||
|
||||
if transport == 'tcp':
|
||||
# The TCP requirements are the exact same requirements as the ZeroMQ ones
|
||||
@ -186,51 +195,105 @@ def _install_requirements(session, transport, *extra_requirements):
|
||||
pydir = _get_pydir(session)
|
||||
|
||||
if IS_WINDOWS:
|
||||
_distro_requirements = os.path.join(REPO_ROOT,
|
||||
'requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-windows.txt'.format(transport))
|
||||
if os.path.exists(_distro_requirements):
|
||||
distro_requirements = _distro_requirements
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-windows.txt'.format(transport))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'windows.txt')
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'windows-crypto.txt')
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
elif IS_DARWIN:
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-darwin.txt'.format(transport))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'darwin.txt')
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'darwin-crypto.txt')
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
else:
|
||||
_install_system_packages(session)
|
||||
distro = _get_distro_info(session)
|
||||
distro_keys = [
|
||||
'linux',
|
||||
'{id}'.format(**distro),
|
||||
'{id}-{version}'.format(**distro),
|
||||
'{id}-{version_parts[major]}'.format(**distro)
|
||||
]
|
||||
for distro_key in distro_keys:
|
||||
_distro_requirements = os.path.join(REPO_ROOT,
|
||||
'requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-{}.txt'.format(transport, distro_key))
|
||||
if os.path.exists(_distro_requirements):
|
||||
distro_requirements = _distro_requirements
|
||||
break
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}.txt'.format(distro_key))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-crypto.txt'.format(distro_key))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-{}.txt'.format(transport, distro_key))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
distro_constraints.append(_distro_constraints)
|
||||
_distro_constraints = os.path.join('requirements',
|
||||
'static',
|
||||
pydir,
|
||||
'{}-{}-crypto.txt'.format(transport, distro_key))
|
||||
if os.path.exists(_distro_constraints):
|
||||
distro_constraints.append(_distro_constraints)
|
||||
return distro_constraints
|
||||
|
||||
if distro_requirements is not None:
|
||||
_requirements_files = [distro_requirements]
|
||||
requirements_files = []
|
||||
else:
|
||||
_requirements_files = [
|
||||
os.path.join(REPO_ROOT, 'requirements', 'pytest.txt')
|
||||
|
||||
def _install_requirements(session, transport, *extra_requirements):
|
||||
# Install requirements
|
||||
distro_constraints = _get_distro_pip_constraints(session, transport)
|
||||
|
||||
_requirements_files = [
|
||||
os.path.join('requirements', 'base.txt'),
|
||||
os.path.join('requirements', 'zeromq.txt'),
|
||||
os.path.join('requirements', 'pytest.txt')
|
||||
]
|
||||
if sys.platform.startswith('linux'):
|
||||
requirements_files = [
|
||||
os.path.join('requirements', 'static', 'linux.in')
|
||||
]
|
||||
elif sys.platform.startswith('win'):
|
||||
requirements_files = [
|
||||
os.path.join('pkg', 'windows', 'req.txt'),
|
||||
os.path.join('requirements', 'static', 'windows.in')
|
||||
]
|
||||
elif sys.platform.startswith('darwin'):
|
||||
requirements_files = [
|
||||
os.path.join('pkg', 'osx', 'req.txt'),
|
||||
os.path.join('pkg', 'osx', 'req_ext.txt'),
|
||||
os.path.join('requirements', 'static', 'darwin.in')
|
||||
]
|
||||
if sys.platform.startswith('linux'):
|
||||
requirements_files = [
|
||||
os.path.join(REPO_ROOT, 'requirements', 'tests.txt')
|
||||
]
|
||||
elif sys.platform.startswith('win'):
|
||||
requirements_files = [
|
||||
os.path.join(REPO_ROOT, 'pkg', 'windows', 'req.txt'),
|
||||
]
|
||||
elif sys.platform.startswith('darwin'):
|
||||
requirements_files = [
|
||||
os.path.join(REPO_ROOT, 'pkg', 'osx', 'req.txt'),
|
||||
os.path.join(REPO_ROOT, 'pkg', 'osx', 'req_ext.txt'),
|
||||
]
|
||||
|
||||
while True:
|
||||
if not requirements_files:
|
||||
@ -254,10 +317,25 @@ def _install_requirements(session, transport, *extra_requirements):
|
||||
continue
|
||||
|
||||
for requirements_file in _requirements_files:
|
||||
session.install('--progress-bar=off', '-r', requirements_file, silent=PIP_INSTALL_SILENT)
|
||||
install_command = [
|
||||
'--progress-bar=off', '-r', requirements_file
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
if extra_requirements:
|
||||
session.install('--progress-bar=off', *extra_requirements, silent=PIP_INSTALL_SILENT)
|
||||
install_command = [
|
||||
'--progress-bar=off',
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
install_command += list(extra_requirements)
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
|
||||
def _run_with_coverage(session, *test_cmd):
|
||||
@ -293,7 +371,20 @@ def _run_with_coverage(session, *test_cmd):
|
||||
# Sometimes some of the coverage files are corrupt which would trigger a CommandFailed
|
||||
# exception
|
||||
pass
|
||||
session.run('coverage', 'xml', '-o', os.path.join(REPO_ROOT, 'artifacts', 'coverage', 'coverage.xml'))
|
||||
# Generate report for salt code coverage
|
||||
session.run(
|
||||
'coverage', 'xml',
|
||||
'-o', os.path.join('artifacts', 'coverage', 'salt.xml'),
|
||||
'--omit=tests/*',
|
||||
'--include=salt/*'
|
||||
)
|
||||
# Generate report for tests code coverage
|
||||
session.run(
|
||||
'coverage', 'xml',
|
||||
'-o', os.path.join('artifacts', 'coverage', 'tests.xml'),
|
||||
'--omit=salt/*',
|
||||
'--include=tests/*'
|
||||
)
|
||||
|
||||
|
||||
def _runtests(session, coverage, cmd_args):
|
||||
@ -371,12 +462,19 @@ def runtests_parametrized(session, coverage, transport, crypto):
|
||||
session.run('pip', 'uninstall', '-y', 'pycrypto', 'pycryptodome', 'pycryptodomex', silent=True)
|
||||
else:
|
||||
session.run('pip', 'uninstall', '-y', 'm2crypto', silent=True)
|
||||
session.install('--progress-bar=off', crypto, silent=PIP_INSTALL_SILENT)
|
||||
distro_constraints = _get_distro_pip_constraints(session, transport)
|
||||
install_command = [
|
||||
'--progress-bar=off',
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
install_command.append(crypto)
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
cmd_args = [
|
||||
'--tests-logfile={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--tests-logfile={}'.format(RUNTESTS_LOGFILE),
|
||||
'--transport={}'.format(transport)
|
||||
] + session.posargs
|
||||
_runtests(session, coverage, cmd_args)
|
||||
@ -515,14 +613,12 @@ def runtests_cloud(session, coverage):
|
||||
_install_requirements(session, 'zeromq', 'unittest-xml-reporting==2.2.1')
|
||||
|
||||
pydir = _get_pydir(session)
|
||||
cloud_requirements = os.path.join(REPO_ROOT, 'requirements', 'static', pydir, 'cloud.txt')
|
||||
cloud_requirements = os.path.join('requirements', 'static', pydir, 'cloud.txt')
|
||||
|
||||
session.install('--progress-bar=off', '-r', cloud_requirements, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
cmd_args = [
|
||||
'--tests-logfile={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--tests-logfile={}'.format(RUNTESTS_LOGFILE),
|
||||
'--cloud-provider-tests'
|
||||
] + session.posargs
|
||||
_runtests(session, coverage, cmd_args)
|
||||
@ -537,9 +633,7 @@ def runtests_tornado(session, coverage):
|
||||
session.install('--progress-bar=off', 'pyzmq==17.0.0', silent=PIP_INSTALL_SILENT)
|
||||
|
||||
cmd_args = [
|
||||
'--tests-logfile={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--tests-logfile={}'.format(RUNTESTS_LOGFILE)
|
||||
] + session.posargs
|
||||
_runtests(session, coverage, cmd_args)
|
||||
|
||||
@ -557,13 +651,21 @@ def pytest_parametrized(session, coverage, transport, crypto):
|
||||
session.run('pip', 'uninstall', '-y', 'pycrypto', 'pycryptodome', 'pycryptodomex', silent=True)
|
||||
else:
|
||||
session.run('pip', 'uninstall', '-y', 'm2crypto', silent=True)
|
||||
session.install('--progress-bar=off', crypto, silent=PIP_INSTALL_SILENT)
|
||||
distro_constraints = _get_distro_pip_constraints(session, transport)
|
||||
install_command = [
|
||||
'--progress-bar=off',
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
install_command.append(crypto)
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
cmd_args = [
|
||||
'--rootdir', REPO_ROOT,
|
||||
'--log-file={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--log-file={}'.format(RUNTESTS_LOGFILE),
|
||||
'--log-file-level=debug',
|
||||
'--no-print-logs',
|
||||
'-ra',
|
||||
'-s',
|
||||
@ -704,19 +806,18 @@ def pytest_cloud(session, coverage):
|
||||
# Install requirements
|
||||
_install_requirements(session, 'zeromq')
|
||||
pydir = _get_pydir(session)
|
||||
cloud_requirements = os.path.join(REPO_ROOT, 'requirements', 'static', pydir, 'cloud.txt')
|
||||
cloud_requirements = os.path.join('requirements', 'static', pydir, 'cloud.txt')
|
||||
|
||||
session.install('--progress-bar=off', '-r', cloud_requirements, silent=PIP_INSTALL_SILENT)
|
||||
|
||||
cmd_args = [
|
||||
'--rootdir', REPO_ROOT,
|
||||
'--log-file={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--log-file={}'.format(RUNTESTS_LOGFILE),
|
||||
'--log-file-level=debug',
|
||||
'--no-print-logs',
|
||||
'-ra',
|
||||
'-s',
|
||||
os.path.join(REPO_ROOT, 'tests', 'integration', 'cloud', 'providers')
|
||||
os.path.join('tests', 'integration', 'cloud', 'providers')
|
||||
] + session.posargs
|
||||
_pytest(session, coverage, cmd_args)
|
||||
|
||||
@ -731,9 +832,8 @@ def pytest_tornado(session, coverage):
|
||||
|
||||
cmd_args = [
|
||||
'--rootdir', REPO_ROOT,
|
||||
'--log-file={}'.format(
|
||||
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
|
||||
),
|
||||
'--log-file={}'.format(RUNTESTS_LOGFILE),
|
||||
'--log-file-level=debug',
|
||||
'--no-print-logs',
|
||||
'-ra',
|
||||
'-s',
|
||||
@ -762,7 +862,18 @@ def _pytest(session, coverage, cmd_args):
|
||||
|
||||
def _lint(session, rcfile, flags, paths):
|
||||
_install_requirements(session, 'zeromq')
|
||||
session.install('--progress-bar=off', '-r', 'requirements/static/{}/lint.txt'.format(_get_pydir(session)), silent=PIP_INSTALL_SILENT)
|
||||
requirements_file = 'requirements/static/lint.in'
|
||||
distro_constraints = [
|
||||
'requirements/static/{}/lint.txt'.format(_get_pydir(session))
|
||||
]
|
||||
install_command = [
|
||||
'--progress-bar=off', '-r', requirements_file
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
session.run('pylint', '--version')
|
||||
pylint_report_path = os.environ.get('PYLINT_REPORT')
|
||||
|
||||
@ -836,19 +947,73 @@ def lint_tests(session):
|
||||
|
||||
|
||||
@nox.session(python='3')
|
||||
def docs(session):
|
||||
@nox.parametrize('update', [False, True])
|
||||
@nox.parametrize('compress', [False, True])
|
||||
def docs(session, compress, update):
|
||||
'''
|
||||
Build Salt's Documentation
|
||||
'''
|
||||
session.notify('docs-html(compress={})'.format(compress))
|
||||
session.notify('docs-man(compress={}, update={})'.format(compress, update))
|
||||
|
||||
|
||||
@nox.session(name='docs-html', python='3')
|
||||
@nox.parametrize('compress', [False, True])
|
||||
def docs_html(session, compress):
|
||||
'''
|
||||
Build Salt's HTML Documentation
|
||||
'''
|
||||
pydir = _get_pydir(session)
|
||||
if pydir == 'py3.4':
|
||||
session.error('Sphinx only runs on Python >= 3.5')
|
||||
session.install(
|
||||
'--progress-bar=off',
|
||||
'-r', 'requirements/static/{}/docs.txt'.format(pydir),
|
||||
silent=PIP_INSTALL_SILENT)
|
||||
requirements_file = 'requirements/static/docs.in'
|
||||
distro_constraints = [
|
||||
'requirements/static/{}/docs.txt'.format(_get_pydir(session))
|
||||
]
|
||||
install_command = [
|
||||
'--progress-bar=off', '-r', requirements_file
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
os.chdir('doc/')
|
||||
session.run('make', 'clean', external=True)
|
||||
session.run('make', 'html', 'SPHINXOPTS=-W', external=True)
|
||||
session.run('tar', '-czvf', 'doc-archive.tar.gz', '_build/html')
|
||||
if compress:
|
||||
session.run('tar', '-czvf', 'html-archive.tar.gz', '_build/html', external=True)
|
||||
os.chdir('..')
|
||||
|
||||
|
||||
@nox.session(name='docs-man', python='3')
|
||||
@nox.parametrize('update', [False, True])
|
||||
@nox.parametrize('compress', [False, True])
|
||||
def docs_man(session, compress, update):
|
||||
'''
|
||||
Build Salt's Manpages Documentation
|
||||
'''
|
||||
pydir = _get_pydir(session)
|
||||
if pydir == 'py3.4':
|
||||
session.error('Sphinx only runs on Python >= 3.5')
|
||||
requirements_file = 'requirements/static/docs.in'
|
||||
distro_constraints = [
|
||||
'requirements/static/{}/docs.txt'.format(_get_pydir(session))
|
||||
]
|
||||
install_command = [
|
||||
'--progress-bar=off', '-r', requirements_file
|
||||
]
|
||||
for distro_constraint in distro_constraints:
|
||||
install_command.extend([
|
||||
'--constraint', distro_constraint
|
||||
])
|
||||
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
||||
os.chdir('doc/')
|
||||
session.run('make', 'clean', external=True)
|
||||
session.run('make', 'man', 'SPHINXOPTS=-W', external=True)
|
||||
if update:
|
||||
session.run('rm', '-rf', 'man/', external=True)
|
||||
session.run('cp', '-Rp', '_build/man', 'man/', external=True)
|
||||
if compress:
|
||||
session.run('tar', '-czvf', 'man-archive.tar.gz', '_build/man', external=True)
|
||||
os.chdir('..')
|
||||
|
@ -24,7 +24,7 @@ pyobjc==5.1.2
|
||||
pyopenssl
|
||||
python-dateutil==2.8.0
|
||||
python-gnupg==0.4.4
|
||||
pyyaml==3.13
|
||||
pyyaml==5.1.2
|
||||
pyzmq==18.0.1
|
||||
requests==2.21.0
|
||||
setproctitle
|
||||
|
@ -28,7 +28,7 @@ pyopenssl==19.0.0
|
||||
python-dateutil==2.8.0
|
||||
python-gnupg==0.4.4
|
||||
pythonnet==2.3.0
|
||||
pyyaml==3.13
|
||||
pyyaml==5.1.2
|
||||
pyzmq==18.0.1
|
||||
requests==2.21.0
|
||||
setproctitle
|
||||
|
@ -2,7 +2,7 @@ Jinja2
|
||||
# This should be changed to msgpack-python for Packages
|
||||
# msgpack-python>0.3,!=0.5.5
|
||||
msgpack>=0.5,!=0.5.5
|
||||
PyYAML<5.1
|
||||
PyYAML
|
||||
MarkupSafe
|
||||
requests>=1.0.0
|
||||
tornado>=4.2.1,<6.0; python_version < '3'
|
||||
|
@ -1,12 +0,0 @@
|
||||
-r base.txt
|
||||
|
||||
mock>=2.0.0
|
||||
SaltPyLint>=v2017.3.6
|
||||
testinfra>=1.7.0,!=1.17.0
|
||||
|
||||
# httpretty Needs to be here for now even though it's a dependency of boto.
|
||||
# A pip install on a fresh system will decide to target httpretty 0.8.10 to
|
||||
# satisfy other requirements, and httpretty 0.8.10 has bugs in setup.py that
|
||||
# prevent it from being successfully installed (at least on Python 3.4).
|
||||
httpretty; python_version >= '3.4'
|
||||
pylint==1.6.5
|
@ -1,2 +0,0 @@
|
||||
# This is a legacy file, use dev.txt
|
||||
-r dev.txt
|
@ -1,2 +0,0 @@
|
||||
# This is a legacy file, use dev.txt
|
||||
-r dev.txt
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user