diff --git a/.ci/docs b/.ci/docs index c9aa337a04a7..2ff232deaa46 100644 --- a/.ci/docs +++ b/.ci/docs @@ -2,7 +2,7 @@ // Define the maximum time, in hours, that a test run should run for def global_timeout = 2 -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' properties([ buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')), diff --git a/.ci/kitchen-amazon1-py2 b/.ci/kitchen-amazon1-py2 new file mode 100644 index 000000000000..143cf13db11f --- /dev/null +++ b/.ci/kitchen-amazon1-py2 @@ -0,0 +1,159 @@ +@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 = '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_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 diff --git a/.ci/kitchen-amazon2-py2 b/.ci/kitchen-amazon2-py2 index a3bc34a297a9..f8c027486983 100644 --- a/.ci/kitchen-amazon2-py2 +++ b/.ci/kitchen-amazon2-py2 @@ -10,7 +10,7 @@ def distro_name = 'amazon' def distro_version = '2' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-amazon2-py3 b/.ci/kitchen-amazon2-py3 index ff508d3d030d..159e1dda1f7d 100644 --- a/.ci/kitchen-amazon2-py3 +++ b/.ci/kitchen-amazon2-py3 @@ -10,7 +10,7 @@ def distro_name = 'amazon' def distro_version = '2' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-archlts-py2 b/.ci/kitchen-archlts-py2 new file mode 100644 index 000000000000..7aa8f99518fd --- /dev/null +++ b/.ci/kitchen-archlts-py2 @@ -0,0 +1,159 @@ +@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 = '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_passthrough_opts = '-n integration.modules.test_pkg' + +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 diff --git a/.ci/kitchen-archlts-py3 b/.ci/kitchen-archlts-py3 new file mode 100644 index 000000000000..551dfc271430 --- /dev/null +++ b/.ci/kitchen-archlts-py3 @@ -0,0 +1,159 @@ +@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 = '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_passthrough_opts = '-n integration.modules.test_pkg' + +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 diff --git a/.ci/kitchen-centos6-py2 b/.ci/kitchen-centos6-py2 index 98bfb68c8aed..f217666ebf95 100644 --- a/.ci/kitchen-centos6-py2 +++ b/.ci/kitchen-centos6-py2 @@ -10,7 +10,7 @@ def distro_name = 'centos' def distro_version = '6' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-centos7-py2 b/.ci/kitchen-centos7-py2 index e64e1ffd6586..f980e3ce5999 100644 --- a/.ci/kitchen-centos7-py2 +++ b/.ci/kitchen-centos7-py2 @@ -10,7 +10,7 @@ def distro_name = 'centos' def distro_version = '7' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-centos7-py2-tcp b/.ci/kitchen-centos7-py2-tcp index b742feaadf83..3f9265520c68 100644 --- a/.ci/kitchen-centos7-py2-tcp +++ b/.ci/kitchen-centos7-py2-tcp @@ -10,7 +10,7 @@ def distro_name = 'centos' def distro_version = '7' def python_version = 'py2' def test_transport = 'TCP' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-centos7-py3 b/.ci/kitchen-centos7-py3 index d6094f37e5af..b004d61172a6 100644 --- a/.ci/kitchen-centos7-py3 +++ b/.ci/kitchen-centos7-py3 @@ -10,7 +10,7 @@ def distro_name = 'centos' def distro_version = '7' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-centos7-py3-tcp b/.ci/kitchen-centos7-py3-tcp index daba37d78a08..3b7339c2aedd 100644 --- a/.ci/kitchen-centos7-py3-tcp +++ b/.ci/kitchen-centos7-py3-tcp @@ -10,7 +10,7 @@ def distro_name = 'centos' def distro_version = '7' def python_version = 'py3' def test_transport = 'TCP' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-debian10-py3 b/.ci/kitchen-debian10-py3 new file mode 100644 index 000000000000..1a00e06f92dc --- /dev/null +++ b/.ci/kitchen-debian10-py3 @@ -0,0 +1,159 @@ +@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 = '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_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 diff --git a/.ci/kitchen-debian8-py2 b/.ci/kitchen-debian8-py2 index 9a0fe07faacb..89b7f0af6c14 100644 --- a/.ci/kitchen-debian8-py2 +++ b/.ci/kitchen-debian8-py2 @@ -10,7 +10,7 @@ def distro_name = 'debian' def distro_version = '8' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-debian9-py2 b/.ci/kitchen-debian9-py2 index 1288dd047f4e..1b4c37acb1ce 100644 --- a/.ci/kitchen-debian9-py2 +++ b/.ci/kitchen-debian9-py2 @@ -10,7 +10,7 @@ def distro_name = 'debian' def distro_version = '9' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-debian9-py3 b/.ci/kitchen-debian9-py3 index f863dc4cf16f..023ede4aae7a 100644 --- a/.ci/kitchen-debian9-py3 +++ b/.ci/kitchen-debian9-py3 @@ -10,7 +10,7 @@ def distro_name = 'debian' def distro_version = '9' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-fedora29-py2 b/.ci/kitchen-fedora29-py2 index 9232163c87fb..19bb3bc5ebca 100644 --- a/.ci/kitchen-fedora29-py2 +++ b/.ci/kitchen-fedora29-py2 @@ -10,7 +10,7 @@ def distro_name = 'fedora' def distro_version = '29' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-fedora29-py3 b/.ci/kitchen-fedora29-py3 index 543189af6154..99b881dc3358 100644 --- a/.ci/kitchen-fedora29-py3 +++ b/.ci/kitchen-fedora29-py3 @@ -10,7 +10,7 @@ def distro_name = 'fedora' def distro_version = '29' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-fedora30-py2 b/.ci/kitchen-fedora30-py2 new file mode 100644 index 000000000000..3f45aa3c802c --- /dev/null +++ b/.ci/kitchen-fedora30-py2 @@ -0,0 +1,159 @@ +@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 = '30' +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 diff --git a/.ci/kitchen-fedora30-py3 b/.ci/kitchen-fedora30-py3 new file mode 100644 index 000000000000..194020b69113 --- /dev/null +++ b/.ci/kitchen-fedora30-py3 @@ -0,0 +1,159 @@ +@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 = '30' +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 diff --git a/.ci/kitchen-macosxmojave-py2 b/.ci/kitchen-macosxmojave-py2 new file mode 100644 index 000000000000..7ef399f805e4 --- /dev/null +++ b/.ci/kitchen-macosxmojave-py2 @@ -0,0 +1,146 @@ +@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 = '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_passthrough_opts = '' + +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-mac', 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_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') { + 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 + 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 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 * 60 - 15, unit: 'MINUTES') { + 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') { + 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 diff --git a/.ci/kitchen-macosxmojave-py3 b/.ci/kitchen-macosxmojave-py3 new file mode 100644 index 000000000000..a46d63ab19b6 --- /dev/null +++ b/.ci/kitchen-macosxmojave-py3 @@ -0,0 +1,146 @@ +@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 = '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_passthrough_opts = '' + +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-mac', 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_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') { + 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 + 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 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 * 60 - 15, unit: 'MINUTES') { + 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') { + 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 diff --git a/.ci/kitchen-opensuse15-py2 b/.ci/kitchen-opensuse15-py2 new file mode 100644 index 000000000000..88cef5f6b423 --- /dev/null +++ b/.ci/kitchen-opensuse15-py2 @@ -0,0 +1,159 @@ +@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 = '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_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 diff --git a/.ci/kitchen-opensuse15-py3 b/.ci/kitchen-opensuse15-py3 new file mode 100644 index 000000000000..84ff66f05c15 --- /dev/null +++ b/.ci/kitchen-opensuse15-py3 @@ -0,0 +1,159 @@ +@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 = '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_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 diff --git a/.ci/kitchen-ubuntu1604-py2 b/.ci/kitchen-ubuntu1604-py2 index 07256109ae88..9de36a87ed6b 100644 --- a/.ci/kitchen-ubuntu1604-py2 +++ b/.ci/kitchen-ubuntu1604-py2 @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1604' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-ubuntu1604-py2-tcp b/.ci/kitchen-ubuntu1604-py2-tcp index bc7a6b9c92ef..2d27d04fb533 100644 --- a/.ci/kitchen-ubuntu1604-py2-tcp +++ b/.ci/kitchen-ubuntu1604-py2-tcp @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1604' def python_version = 'py2' def test_transport = 'TCP' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-ubuntu1604-py3 b/.ci/kitchen-ubuntu1604-py3 index 0feb96855f49..2aae4c26f599 100644 --- a/.ci/kitchen-ubuntu1604-py3 +++ b/.ci/kitchen-ubuntu1604-py3 @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1604' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-ubuntu1604-py3-tcp b/.ci/kitchen-ubuntu1604-py3-tcp index 9a9ff87e0ddb..47a150ac4f32 100644 --- a/.ci/kitchen-ubuntu1604-py3-tcp +++ b/.ci/kitchen-ubuntu1604-py3-tcp @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1604' def python_version = 'py3' def test_transport = 'TCP' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-ubuntu1804-py2 b/.ci/kitchen-ubuntu1804-py2 index 66df539fd948..270bebc1c330 100644 --- a/.ci/kitchen-ubuntu1804-py2 +++ b/.ci/kitchen-ubuntu1804-py2 @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1804' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-ubuntu1804-py3 b/.ci/kitchen-ubuntu1804-py3 index 3eca715225e3..4a6bf582b44c 100644 --- a/.ci/kitchen-ubuntu1804-py3 +++ b/.ci/kitchen-ubuntu1804-py3 @@ -10,7 +10,7 @@ def distro_name = 'ubuntu' def distro_version = '1804' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--ssh-tests' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -65,7 +65,8 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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: $?"; + 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 @@ -76,74 +77,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-windows2016-py2 b/.ci/kitchen-windows2016-py2 index 99ddce189d9b..9d3c1a258451 100644 --- a/.ci/kitchen-windows2016-py2 +++ b/.ci/kitchen-windows2016-py2 @@ -10,7 +10,7 @@ def distro_name = 'windows' def distro_version = '2016' def python_version = 'py2' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--unit' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -76,74 +76,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-windows2016-py3 b/.ci/kitchen-windows2016-py3 index 550043eddd71..8cd0f6fa5659 100644 --- a/.ci/kitchen-windows2016-py3 +++ b/.ci/kitchen-windows2016-py3 @@ -10,7 +10,7 @@ def distro_name = 'windows' def distro_version = '2016' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' def nox_passthrough_opts = '--unit' @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -76,74 +76,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/kitchen-windows2019-py2 b/.ci/kitchen-windows2019-py2 new file mode 100644 index 000000000000..1337d7e81aad --- /dev/null +++ b/.ci/kitchen-windows2019-py2 @@ -0,0 +1,158 @@ +@Library('salt@1.1') _ + +// 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_passthrough_opts = '--unit' + +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 + 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 + ''' + } + } + } + } + } + } +} + +// vim: ft=groovy diff --git a/.ci/kitchen-debian8-py3 b/.ci/kitchen-windows2019-py3 similarity index 52% rename from .ci/kitchen-debian8-py3 rename to .ci/kitchen-windows2019-py3 index 43ec963b9e69..1327620ddfd0 100644 --- a/.ci/kitchen-debian8-py3 +++ b/.ci/kitchen-windows2019-py3 @@ -1,18 +1,18 @@ @Library('salt@1.1') _ // Define the maximum time, in hours, that a test run should run for -def testrun_timeout = 6 +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 = 'debian' -def distro_version = '8' +def distro_name = 'windows' +def distro_version = '2019' def python_version = 'py3' def test_transport = 'ZeroMQ' -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' def golden_images_branch = '2019.2' -def nox_passthrough_opts = '--ssh-tests' +def nox_passthrough_opts = '--unit' properties([ buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')), @@ -42,7 +42,7 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { "SALT_TARGET_BRANCH=${salt_target_branch}", "GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}", "CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}", - 'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin', + '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}", @@ -76,74 +76,77 @@ wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') { 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 + ''' } - sshagent(credentials: ['jenkins-testing-ssh-key']) { - sh 'ssh-add ~/.ssh/kitchen.pem' - try { - timeout(time: testrun_timeout, unit: 'HOURS') { - stage('Converge VM') { - sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_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 { + 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}-verify.log" + 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-verify.log" + mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.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 - """ + } + stage('Run Tests') { + withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) { + sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";' } - 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') { + } + } + } 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 destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"; + bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0 ''' } - 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 - ''' - } + 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 + ''' } } } diff --git a/.ci/lint b/.ci/lint index dee263e46ac2..fd61de5b8814 100644 --- a/.ci/lint +++ b/.ci/lint @@ -2,7 +2,7 @@ // Define the maximum time, in hours, that a test run should run for def global_timeout = 3 -def salt_target_branch = '2019.2.1' +def salt_target_branch = 'master' properties([ buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')), @@ -46,9 +46,10 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { eval "$(pyenv init -)" pyenv --version pyenv install --skip-existing 2.7.15 - pyenv shell 2.7.15 + pyenv install --skip-existing 3.6.8 + pyenv shell 3.6.8 2.7.15 python --version - pip install -U nox-py2 + pip3 install -U nox-py2 nox --version # Create the required virtualenvs in serial nox --install-only -e lint-salt @@ -69,7 +70,7 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { if (readFile('file-list-changed.log') =~ /(?i)(^|\n)(salt\/.*\.py|setup\.py)\n/) { sh shell_header + ''' eval "$(pyenv init - --no-rehash)" - pyenv shell 2.7.15 + pyenv shell 3.6.8 2.7.15 EC=254 export PYLINT_REPORT=pylint-report-salt-chg.log grep -Ei '^salt/.*\\.py$|^setup\\.py$' file-list-changed.log | xargs -r '--delimiter=\\n' nox -e lint-salt -- @@ -80,7 +81,7 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { // Always lint something so reporting doesn't fail sh shell_header + ''' eval "$(pyenv init - --no-rehash)" - pyenv shell 2.7.15 + pyenv shell 3.6.8 2.7.15 EC=254 export PYLINT_REPORT=pylint-report-salt-chg.log nox -e lint-salt -- salt/ext/__init__.py @@ -95,7 +96,7 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { if (readFile('file-list-changed.log') =~ /(?i)(^|\n)tests\/.*\.py\n/) { sh shell_header + ''' eval "$(pyenv init - --no-rehash)" - pyenv shell 2.7.15 + pyenv shell 3.6.8 2.7.15 EC=254 export PYLINT_REPORT=pylint-report-tests-chg.log grep -Ei '^tests/.*\\.py$' file-list-changed.log | xargs -r '--delimiter=\\n' nox -e lint-tests -- @@ -128,7 +129,7 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { stage('Lint Salt Full') { sh shell_header + ''' eval "$(pyenv init - --no-rehash)" - pyenv shell 2.7.15 + pyenv shell 3.6.8 2.7.15 EC=254 export PYLINT_REPORT=pylint-report-salt-full.log nox -e lint-salt @@ -141,7 +142,7 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') { stage('Lint Tests Full') { sh shell_header + ''' eval "$(pyenv init - --no-rehash)" - pyenv shell 2.7.15 + pyenv shell 3.6.8 2.7.15 EC=254 export PYLINT_REPORT=pylint-report-tests-full.log nox -e lint-salt diff --git a/Gemfile b/Gemfile index 86786e1560d5..441fd6def76e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' # Point this back at the test-kitchen package after >1.2.5 is relased gem 'test-kitchen', :git => 'https://github.com/dwoz/test-kitchen.git', :branch => 'keepalive_maxcount' -gem 'kitchen-salt', :git => 'https://github.com/s0undt3ch/kitchen-salt.git', :branch => 'features/nox' +gem 'kitchen-salt', :git => 'https://github.com/saltstack/kitchen-salt.git' gem 'kitchen-sync' gem 'git' diff --git a/doc/ref/cache/all/index.rst b/doc/ref/cache/all/index.rst index 8a9689909d62..91bd79cf82bc 100644 --- a/doc/ref/cache/all/index.rst +++ b/doc/ref/cache/all/index.rst @@ -1,7 +1,7 @@ .. _all-salt.cache: ============= -Cache Modules +cache modules ============= .. currentmodule:: salt.cache diff --git a/requirements/static/debian-10.in b/requirements/static/debian-10.in new file mode 100644 index 000000000000..4ee2f3c697b3 --- /dev/null +++ b/requirements/static/debian-10.in @@ -0,0 +1,44 @@ +# This is a compilation of requirements installed on salt-jenkins git.salt state run +ansible; python_version < '3.0' +apache-libcloud==2.0.0 +boto3 +boto>=2.46.0 +cffi +cherrypy==17.3.0 +clustershell +croniter>=0.3.0,!=0.3.22 +dnspython +docker<4.0 +futures>=2.0; python_version < '3.0' +GitPython +jsonschema<=2.6.0 +junos-eznc +jxmlease +keyring==5.7.1 +kubernetes<4.0 +mock>=2.0.0; python_version < '3.6' +more-itertools==5.0.0 +moto +msgpack-python >= 0.4.2, != 0.5.5 +paramiko==2.2.3 +psutil +# Let's install cryptodome instead of pycrypto because of pycrypto's outstanding security issues +# PyCrypto, if pulled, will be removed from the generated static requirements +pycryptodome +pygit2 +pyinotify +pylxd>=2.2.5 +pyopenssl +python-etcd>0.4.2 +python-gnupg +pyvmomi +requests +rfc3987 +salttesting==2017.6.1 +setproctitle +strict_rfc3339 +supervisor==3.3.5; python_version < '3' +timelib +tornado<5.0 +virtualenv +yamlordereddictloader diff --git a/requirements/static/py3.4/zeromq-debian-10.txt b/requirements/static/py3.4/zeromq-debian-10.txt new file mode 100644 index 000000000000..bbdd6e51bfe6 --- /dev/null +++ b/requirements/static/py3.4/zeromq-debian-10.txt @@ -0,0 +1,120 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile -o requirements/static/py3.4/zeromq-debian-10.txt -v requirements/base.txt requirements/zeromq.txt requirements/pytest.txt requirements/static/debian-10.in +# +apache-libcloud==2.0.0 +asn1crypto==0.24.0 # via cryptography +atomicwrites==1.3.0 # via pytest +attrs==19.1.0 # via pytest +aws-xray-sdk==0.95 # via moto +backports.functools-lru-cache==1.5 # via cheroot +backports.ssl-match-hostname==3.7.0.1 # via docker +bcrypt==3.1.7 # via paramiko +boto3==1.9.132 +boto==2.49.0 +botocore==1.12.132 # via boto3, moto, s3transfer +cachetools==3.1.0 # via google-auth +certifi==2019.3.9 # via kubernetes, requests +cffi==1.12.2 +chardet==3.0.4 # via requests +cheroot==6.5.4 # via cherrypy +cherrypy==17.3.0 +clustershell==1.8.1 +contextlib2==0.5.5 # via cherrypy +coverage==4.5.4 # via pytest-cov +croniter==0.3.29 +cryptography==2.6.1 # via moto, paramiko, pylxd, pyopenssl +dnspython==1.16.0 +docker-pycreds==0.4.0 # via docker +docker==3.7.2 +docutils==0.14 # via botocore +ecdsa==0.13.2 # via python-jose +future==0.17.1 # via python-jose +gitdb2==2.0.5 # via gitpython +gitpython==2.1.11 +google-auth==1.6.3 # via kubernetes +idna==2.8 # via requests +ipaddress==1.0.22 # via kubernetes +jaraco.functools==2.0 # via tempora +jinja2==2.10.1 +jmespath==0.9.4 # via boto3, botocore +jsondiff==1.1.1 # via moto +jsonpickle==1.1 # via aws-xray-sdk +jsonschema==2.6.0 +junos-eznc==2.2.0 +jxmlease==1.0.1 +keyring==5.7.1 +kubernetes==3.0.0 +lxml==4.3.3 # via junos-eznc, ncclient +markupsafe==1.1.1 +mock==2.0.0 ; python_version < "3.6" +more-itertools==5.0.0 +moto==1.3.7 +msgpack-python==0.5.6 +msgpack==0.6.1 +ncclient==0.6.4 # via junos-eznc +netaddr==0.7.19 # via junos-eznc +paramiko==2.2.3 +pathlib2==2.3.3 # via pytest +pbr==5.1.3 # via mock, pylxd +pluggy==0.11.0 # via pytest +portend==2.4 # via cherrypy +psutil==5.6.1 +py==1.8.0 # via pytest +pyaml==19.4.1 # via moto +pyasn1-modules==0.2.4 # via google-auth +pyasn1==0.4.5 # via paramiko, pyasn1-modules, rsa +pycparser==2.19 # via cffi +# Next line explicitly commented out by pip-tools-compile because of the following regex: '^pycrypto==(.*)$' +# pycrypto==2.6.1 ; sys_platform != "win32" +pycryptodome==3.8.1 +pygit2==0.28.1 +pyinotify==0.9.6 +pylxd==2.2.9 +pynacl==1.3.0 # via paramiko +pyopenssl==19.0.0 +pyserial==3.4 # via junos-eznc +pytest-cov==2.7.1 +pytest-helpers-namespace==2019.1.8 +pytest-salt-runtests-bridge==2019.1.30 +pytest-salt==2018.12.8 +pytest-tempdir==2018.8.11 +pytest-timeout==1.3.3 +pytest==4.4.2 +python-dateutil==2.8.0 # via botocore, croniter, kubernetes, moto, pylxd +python-etcd==0.4.5 +python-gnupg==0.4.4 +python-jose==2.0.2 # via moto +pytz==2019.1 # via moto, tempora +pyvmomi==6.7.1.2018.12 +pyyaml==3.13 +pyzmq==17.0.0 ; python_version == "3.4" +requests-toolbelt==0.9.1 # via pylxd +requests-unixsocket==0.1.5 # via pylxd +requests==2.21.0 +responses==0.10.6 # via moto +rfc3987==1.3.8 +rsa==4.0 # via google-auth +s3transfer==0.2.0 # via boto3 +salttesting==2017.6.1 +scandir==1.10.0 # via pathlib2 +scp==0.13.2 # via junos-eznc +selectors2==2.0.1 # via ncclient +setproctitle==1.1.10 +six==1.12.0 # via bcrypt, cheroot, cherrypy, cryptography, docker, docker-pycreds, google-auth, junos-eznc, kubernetes, mock, more-itertools, moto, ncclient, pathlib2, pygit2, pylxd, pynacl, pyopenssl, pytest, python-dateutil, python-jose, pyvmomi, responses, salttesting, tempora, websocket-client +smmap2==2.0.5 # via gitdb2 +strict-rfc3339==0.7 +tempora==1.14.1 # via portend +timelib==0.2.4 +tornado==4.5.3 ; python_version >= "3.4" +urllib3==1.24.3 # via botocore, kubernetes, python-etcd, requests, requests-unixsocket +virtualenv==16.4.3 +websocket-client==0.40.0 # via docker, kubernetes +werkzeug==0.15.2 # via moto +wrapt==1.11.1 # via aws-xray-sdk +ws4py==0.5.1 # via pylxd +xmltodict==0.12.0 # via moto +yamlordereddictloader==0.4.0 +zc.lockfile==1.4 # via cherrypy diff --git a/requirements/static/py3.5/zeromq-debian-10.txt b/requirements/static/py3.5/zeromq-debian-10.txt new file mode 100644 index 000000000000..73f64e481fa4 --- /dev/null +++ b/requirements/static/py3.5/zeromq-debian-10.txt @@ -0,0 +1,117 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile -o requirements/static/py3.5/zeromq-debian-10.txt -v requirements/base.txt requirements/zeromq.txt requirements/pytest.txt requirements/static/debian-10.in +# +apache-libcloud==2.0.0 +asn1crypto==0.24.0 # via cryptography +atomicwrites==1.3.0 # via pytest +attrs==19.1.0 # via pytest +aws-xray-sdk==0.95 # via moto +backports.functools-lru-cache==1.5 # via cheroot +bcrypt==3.1.7 # via paramiko +boto3==1.9.132 +boto==2.49.0 +botocore==1.12.132 # via boto3, moto, s3transfer +cachetools==3.1.0 # via google-auth +certifi==2019.3.9 # via kubernetes, requests +cffi==1.12.2 +chardet==3.0.4 # via requests +cheroot==6.5.4 # via cherrypy +cherrypy==17.3.0 +clustershell==1.8.1 +contextlib2==0.5.5 # via cherrypy +coverage==4.5.4 # via pytest-cov +croniter==0.3.29 +cryptography==2.6.1 # via moto, paramiko, pylxd, pyopenssl +dnspython==1.16.0 +docker-pycreds==0.4.0 # via docker +docker==3.7.2 +docutils==0.14 # via botocore +ecdsa==0.13.2 # via python-jose +future==0.17.1 # via python-jose +gitdb2==2.0.5 # via gitpython +gitpython==2.1.11 +google-auth==1.6.3 # via kubernetes +idna==2.8 # via requests +ipaddress==1.0.22 # via kubernetes +jaraco.functools==2.0 # via tempora +jinja2==2.10.1 +jmespath==0.9.4 # via boto3, botocore +jsondiff==1.1.1 # via moto +jsonpickle==1.1 # via aws-xray-sdk +jsonschema==2.6.0 +junos-eznc==2.2.0 +jxmlease==1.0.1 +keyring==5.7.1 +kubernetes==3.0.0 +lxml==4.3.3 # via junos-eznc, ncclient +markupsafe==1.1.1 +mock==2.0.0 ; python_version < "3.6" +more-itertools==5.0.0 +moto==1.3.7 +msgpack-python==0.5.6 +msgpack==0.6.1 +ncclient==0.6.4 # via junos-eznc +netaddr==0.7.19 # via junos-eznc +paramiko==2.2.3 +pathlib2==2.3.3 # via pytest +pbr==5.1.3 # via mock, pylxd +pluggy==0.11.0 # via pytest +portend==2.4 # via cherrypy +psutil==5.6.1 +py==1.8.0 # via pytest +pyaml==19.4.1 # via moto +pyasn1-modules==0.2.4 # via google-auth +pyasn1==0.4.5 # via paramiko, pyasn1-modules, rsa +pycparser==2.19 # via cffi +# Next line explicitly commented out by pip-tools-compile because of the following regex: '^pycrypto==(.*)$' +# pycrypto==2.6.1 ; sys_platform != "win32" +pycryptodome==3.8.1 +pygit2==0.28.1 +pyinotify==0.9.6 +pylxd==2.2.9 +pynacl==1.3.0 # via paramiko +pyopenssl==19.0.0 +pyserial==3.4 # via junos-eznc +pytest-cov==2.7.1 +pytest-helpers-namespace==2019.1.8 +pytest-salt-runtests-bridge==2019.1.30 +pytest-salt==2018.12.8 +pytest-tempdir==2018.8.11 +pytest-timeout==1.3.3 +pytest==4.4.2 +python-dateutil==2.8.0 # via botocore, croniter, kubernetes, moto, pylxd +python-etcd==0.4.5 +python-gnupg==0.4.4 +python-jose==2.0.2 # via moto +pytz==2019.1 # via moto, tempora +pyvmomi==6.7.1.2018.12 +pyyaml==3.13 +pyzmq==18.0.1 ; python_version != "3.4" +requests-toolbelt==0.9.1 # via pylxd +requests-unixsocket==0.1.5 # via pylxd +requests==2.21.0 +responses==0.10.6 # via moto +rfc3987==1.3.8 +rsa==4.0 # via google-auth +s3transfer==0.2.0 # via boto3 +salttesting==2017.6.1 +scp==0.13.2 # via junos-eznc +setproctitle==1.1.10 +six==1.12.0 # via bcrypt, cheroot, cherrypy, cryptography, docker, docker-pycreds, google-auth, junos-eznc, kubernetes, mock, more-itertools, moto, ncclient, pathlib2, pygit2, pylxd, pynacl, pyopenssl, pytest, python-dateutil, python-jose, pyvmomi, responses, salttesting, tempora, websocket-client +smmap2==2.0.5 # via gitdb2 +strict-rfc3339==0.7 +tempora==1.14.1 # via portend +timelib==0.2.4 +tornado==4.5.3 ; python_version >= "3.4" +urllib3==1.24.3 # via botocore, kubernetes, python-etcd, requests, requests-unixsocket +virtualenv==16.4.3 +websocket-client==0.40.0 # via docker, kubernetes +werkzeug==0.15.2 # via moto +wrapt==1.11.1 # via aws-xray-sdk +ws4py==0.5.1 # via pylxd +xmltodict==0.12.0 # via moto +yamlordereddictloader==0.4.0 +zc.lockfile==1.4 # via cherrypy diff --git a/requirements/static/py3.6/zeromq-debian-10.txt b/requirements/static/py3.6/zeromq-debian-10.txt new file mode 100644 index 000000000000..cb09cec51d3d --- /dev/null +++ b/requirements/static/py3.6/zeromq-debian-10.txt @@ -0,0 +1,116 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile -o requirements/static/py3.6/zeromq-debian-10.txt -v requirements/base.txt requirements/zeromq.txt requirements/pytest.txt requirements/static/debian-10.in +# +apache-libcloud==2.0.0 +asn1crypto==0.24.0 # via cryptography +atomicwrites==1.3.0 # via pytest +attrs==19.1.0 # via pytest +aws-xray-sdk==0.95 # via moto +backports.functools-lru-cache==1.5 # via cheroot +bcrypt==3.1.7 # via paramiko +boto3==1.9.132 +boto==2.49.0 +botocore==1.12.132 # via boto3, moto, s3transfer +cachetools==3.1.0 # via google-auth +certifi==2019.3.9 # via kubernetes, requests +cffi==1.12.2 +chardet==3.0.4 # via requests +cheroot==6.5.4 # via cherrypy +cherrypy==17.3.0 +clustershell==1.8.1 +contextlib2==0.5.5 # via cherrypy +coverage==4.5.4 # via pytest-cov +croniter==0.3.29 +cryptography==2.6.1 # via moto, paramiko, pylxd, pyopenssl +dnspython==1.16.0 +docker-pycreds==0.4.0 # via docker +docker==3.7.2 +docutils==0.14 # via botocore +ecdsa==0.13.2 # via python-jose +future==0.17.1 # via python-jose +gitdb2==2.0.5 # via gitpython +gitpython==2.1.11 +google-auth==1.6.3 # via kubernetes +idna==2.8 # via requests +ipaddress==1.0.22 # via kubernetes +jaraco.functools==2.0 # via tempora +jinja2==2.10.1 +jmespath==0.9.4 # via boto3, botocore +jsondiff==1.1.1 # via moto +jsonpickle==1.1 # via aws-xray-sdk +jsonschema==2.6.0 +junos-eznc==2.2.0 +jxmlease==1.0.1 +keyring==5.7.1 +kubernetes==3.0.0 +lxml==4.3.3 # via junos-eznc, ncclient +markupsafe==1.1.1 +mock==2.0.0 # via moto +more-itertools==5.0.0 +moto==1.3.7 +msgpack-python==0.5.6 +msgpack==0.6.1 +ncclient==0.6.4 # via junos-eznc +netaddr==0.7.19 # via junos-eznc +paramiko==2.2.3 +pbr==5.1.3 # via mock, pylxd +pluggy==0.11.0 # via pytest +portend==2.4 # via cherrypy +psutil==5.6.1 +py==1.8.0 # via pytest +pyaml==19.4.1 # via moto +pyasn1-modules==0.2.4 # via google-auth +pyasn1==0.4.5 # via paramiko, pyasn1-modules, rsa +pycparser==2.19 # via cffi +# Next line explicitly commented out by pip-tools-compile because of the following regex: '^pycrypto==(.*)$' +# pycrypto==2.6.1 ; sys_platform != "win32" +pycryptodome==3.8.1 +pygit2==0.28.1 +pyinotify==0.9.6 +pylxd==2.2.9 +pynacl==1.3.0 # via paramiko +pyopenssl==19.0.0 +pyserial==3.4 # via junos-eznc +pytest-cov==2.7.1 +pytest-helpers-namespace==2019.1.8 +pytest-salt-runtests-bridge==2019.1.30 +pytest-salt==2018.12.8 +pytest-tempdir==2018.8.11 +pytest-timeout==1.3.3 +pytest==4.4.2 +python-dateutil==2.8.0 # via botocore, croniter, kubernetes, moto, pylxd +python-etcd==0.4.5 +python-gnupg==0.4.4 +python-jose==2.0.2 # via moto +pytz==2019.1 # via moto, tempora +pyvmomi==6.7.1.2018.12 +pyyaml==3.13 +pyzmq==18.0.1 ; python_version != "3.4" +requests-toolbelt==0.9.1 # via pylxd +requests-unixsocket==0.1.5 # via pylxd +requests==2.21.0 +responses==0.10.6 # via moto +rfc3987==1.3.8 +rsa==4.0 # via google-auth +s3transfer==0.2.0 # via boto3 +salttesting==2017.6.1 +scp==0.13.2 # via junos-eznc +setproctitle==1.1.10 +six==1.12.0 # via bcrypt, cheroot, cherrypy, cryptography, docker, docker-pycreds, google-auth, junos-eznc, kubernetes, mock, more-itertools, moto, ncclient, pygit2, pylxd, pynacl, pyopenssl, pytest, python-dateutil, python-jose, pyvmomi, responses, salttesting, tempora, websocket-client +smmap2==2.0.5 # via gitdb2 +strict-rfc3339==0.7 +tempora==1.14.1 # via portend +timelib==0.2.4 +tornado==4.5.3 ; python_version >= "3.4" +urllib3==1.24.3 # via botocore, kubernetes, python-etcd, requests, requests-unixsocket +virtualenv==16.4.3 +websocket-client==0.40.0 # via docker, kubernetes +werkzeug==0.15.2 # via moto +wrapt==1.11.1 # via aws-xray-sdk +ws4py==0.5.1 # via pylxd +xmltodict==0.12.0 # via moto +yamlordereddictloader==0.4.0 +zc.lockfile==1.4 # via cherrypy diff --git a/requirements/static/py3.7/zeromq-debian-10.txt b/requirements/static/py3.7/zeromq-debian-10.txt new file mode 100644 index 000000000000..9a322593f24a --- /dev/null +++ b/requirements/static/py3.7/zeromq-debian-10.txt @@ -0,0 +1,116 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile -o requirements/static/py3.7/zeromq-debian-10.txt -v requirements/base.txt requirements/zeromq.txt requirements/pytest.txt requirements/static/debian-10.in +# +apache-libcloud==2.0.0 +asn1crypto==0.24.0 # via cryptography +atomicwrites==1.3.0 # via pytest +attrs==19.1.0 # via pytest +aws-xray-sdk==0.95 # via moto +backports.functools-lru-cache==1.5 # via cheroot +bcrypt==3.1.7 # via paramiko +boto3==1.9.132 +boto==2.49.0 +botocore==1.12.132 # via boto3, moto, s3transfer +cachetools==3.1.0 # via google-auth +certifi==2019.3.9 # via kubernetes, requests +cffi==1.12.2 +chardet==3.0.4 # via requests +cheroot==6.5.4 # via cherrypy +cherrypy==17.3.0 +clustershell==1.8.1 +contextlib2==0.5.5 # via cherrypy +coverage==4.5.4 # via pytest-cov +croniter==0.3.29 +cryptography==2.6.1 # via moto, paramiko, pylxd, pyopenssl +dnspython==1.16.0 +docker-pycreds==0.4.0 # via docker +docker==3.7.2 +docutils==0.14 # via botocore +ecdsa==0.13.2 # via python-jose +future==0.17.1 # via python-jose +gitdb2==2.0.5 # via gitpython +gitpython==2.1.11 +google-auth==1.6.3 # via kubernetes +idna==2.8 # via requests +ipaddress==1.0.22 # via kubernetes +jaraco.functools==2.0 # via tempora +jinja2==2.10.1 +jmespath==0.9.4 # via boto3, botocore +jsondiff==1.1.1 # via moto +jsonpickle==1.1 # via aws-xray-sdk +jsonschema==2.6.0 +junos-eznc==2.2.0 +jxmlease==1.0.1 +keyring==5.7.1 +kubernetes==3.0.0 +lxml==4.3.3 # via junos-eznc, ncclient +markupsafe==1.1.1 +mock==2.0.0 # via moto +more-itertools==5.0.0 +moto==1.3.7 +msgpack-python==0.5.6 +msgpack==0.6.1 +ncclient==0.6.4 # via junos-eznc +netaddr==0.7.19 # via junos-eznc +paramiko==2.2.3 +pbr==5.1.3 # via mock, pylxd +pluggy==0.11.0 # via pytest +portend==2.4 # via cherrypy +psutil==5.6.1 +py==1.8.0 # via pytest +pyaml==19.4.1 # via moto +pyasn1-modules==0.2.4 # via google-auth +pyasn1==0.4.5 # via paramiko, pyasn1-modules, rsa +pycparser==2.19 # via cffi +# Next line explicitly commented out by pip-tools-compile because of the following regex: '^pycrypto==(.*)$' +# pycrypto==2.6.1 ; sys_platform != "win32" +pycryptodome==3.8.1 +pygit2==0.28.1 +pyinotify==0.9.6 +pylxd==2.2.9 +pynacl==1.3.0 # via paramiko +pyopenssl==19.0.0 +pyserial==3.4 # via junos-eznc +pytest-cov==2.7.1 +pytest-helpers-namespace==2019.1.8 +pytest-salt-runtests-bridge==2019.1.30 +pytest-salt==2018.12.8 +pytest-tempdir==2018.8.11 +pytest-timeout==1.3.3 +pytest==4.4.2 +python-dateutil==2.8.0 # via botocore, croniter, kubernetes, moto, pylxd +python-etcd==0.4.5 +python-gnupg==0.4.4 +python-jose==2.0.2 # via moto +pytz==2019.1 # via moto, tempora +pyvmomi==6.7.1.2018.12 +pyyaml==3.13 +pyzmq==18.0.1 ; python_version != "3.4" +requests-toolbelt==0.9.1 # via pylxd +requests-unixsocket==0.1.5 # via pylxd +requests==2.21.0 +responses==0.10.6 # via moto +rfc3987==1.3.8 +rsa==4.0 # via google-auth +s3transfer==0.2.0 # via boto3 +salttesting==2017.6.1 +scp==0.13.2 # via junos-eznc +setproctitle==1.1.10 +six==1.12.0 # via bcrypt, cheroot, cherrypy, cryptography, docker, docker-pycreds, google-auth, junos-eznc, kubernetes, mock, more-itertools, moto, ncclient, pygit2, pylxd, pynacl, pyopenssl, pytest, python-dateutil, python-jose, pyvmomi, responses, salttesting, tempora, websocket-client +smmap2==2.0.5 # via gitdb2 +strict-rfc3339==0.7 +tempora==1.14.1 # via portend +timelib==0.2.4 +tornado==4.5.3 ; python_version >= "3.4" +urllib3==1.24.3 # via botocore, kubernetes, python-etcd, requests, requests-unixsocket +virtualenv==16.4.3 +websocket-client==0.40.0 # via docker, kubernetes +werkzeug==0.15.2 # via moto +wrapt==1.11.1 # via aws-xray-sdk +ws4py==0.5.1 # via pylxd +xmltodict==0.12.0 # via moto +yamlordereddictloader==0.4.0 +zc.lockfile==1.4 # via cherrypy diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index 415531028822..187857ad8ab8 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -296,7 +296,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMaster, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -333,7 +333,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMinion, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -370,7 +370,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMinion, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -408,7 +408,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMaster, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -445,7 +445,7 @@ def start_zeromq_daemons(self): daemon_class=SaltSyndic, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -484,7 +484,7 @@ def start_zeromq_daemons(self): daemon_class=SaltProxy, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) diff --git a/tests/integration/modules/test_pkg.py b/tests/integration/modules/test_pkg.py index f09b457dc434..20099215362f 100644 --- a/tests/integration/modules/test_pkg.py +++ b/tests/integration/modules/test_pkg.py @@ -15,6 +15,7 @@ requires_system_grains) # Import Salt libs +from salt.utils import six import salt.utils.pkg import salt.utils.platform @@ -25,15 +26,16 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin): ''' @classmethod - def setUpClass(cls): + @requires_system_grains + def setUpClass(cls, grains): cls.ctx = {} - cls.pkg = 'htop' + cls.pkg = 'figlet' if salt.utils.platform.is_windows(): cls.pkg = 'putty' elif salt.utils.platform.is_darwin(): - os_release = cls.run_function('grains.get', ['osrelease']) - if int(os_release.split('.')[1]) >= 13: - cls.pkg = 'wget' + cls.pkg = 'wget' if int(grains['osmajorrelease']) >= 13 else 'htop' + elif grains['os_family'] == 'RedHat': + cls.pkg = 'units' def setUp(self): if 'refresh' not in self.ctx: @@ -174,26 +176,29 @@ def test_hold_unhold(self, grains): ''' test holding and unholding a package ''' - version_lock = None - lock_pkg = 'yum-plugin-versionlock' + ret = None + if grains['os_family'] == 'RedHat': + # get correct plugin for dnf packages following the logic in `salt.modules.yumpkg._yum` + lock_pkg = 'yum-versionlock' if grains['osmajorrelease'] == '5' else 'yum-plugin-versionlock' + if 'fedora' in grains['os'].lower() and int(grains['osrelease']) >= 22: + if int(grains['osmajorrelease']) >= 26: + lock_pkg = 'python{py}-dnf-plugin-versionlock'.format(py=3 if six.PY3 else 2) + else: + lock_pkg = 'python{py}-dnf-plugins-extras-versionlock'.format(py=3 if six.PY3 else '') + ret = self.run_state('pkg.installed', name=lock_pkg) self.run_function('pkg.install', [self.pkg]) - if grains['os_family'] == 'RedHat': - version_lock = self.run_function('pkg.version', [lock_pkg]) - if not version_lock: - self.run_function('pkg.install', [lock_pkg]) hold_ret = self.run_function('pkg.hold', [self.pkg]) + if 'versionlock is not installed' in hold_ret: + self.run_function('pkg.remove', [self.pkg]) + self.skipTest('Versionlock could not be installed on this system: {}'.format(ret)) self.assertIn(self.pkg, hold_ret) self.assertTrue(hold_ret[self.pkg]['result']) unhold_ret = self.run_function('pkg.unhold', [self.pkg]) self.assertIn(self.pkg, unhold_ret) self.assertTrue(unhold_ret[self.pkg]['result']) - - if grains['os_family'] == 'RedHat': - if not version_lock: - self.run_function('pkg.remove', [lock_pkg]) self.run_function('pkg.remove', [self.pkg]) @destructiveTest @@ -328,17 +333,7 @@ def test_pkg_latest_version(self, grains): Check that pkg.latest_version returns the latest version of the uninstalled package. The package is not installed. Only the package version is checked. ''' - remove = False - if salt.utils.platform.is_windows(): - cmd_info = self.run_function('pkg.version', [self.pkg]) - remove = cmd_info != '' - else: - cmd_info = self.run_function('pkg.info_installed', [self.pkg]) - remove = cmd_info != 'ERROR: package {0} is not installed'.format(self.pkg) - - # remove package if its installed - if remove: - self.run_function('pkg.remove', [self.pkg]) + self.run_state('pkg.removed', name=self.pkg) cmd_pkg = [] if grains['os_family'] == 'RedHat': @@ -351,5 +346,10 @@ def test_pkg_latest_version(self, grains): cmd_pkg = self.run_function('cmd.run', ['pacman -Si {0}'.format(self.pkg)]) elif grains['os_family'] == 'Suse': cmd_pkg = self.run_function('cmd.run', ['zypper info {0}'.format(self.pkg)]) + elif grains['os_family'] == 'MacOS': + self.skipTest('TODO the following command needs to be run as a non-root user') + #cmd_pkg = self.run_function('cmd.run', ['brew info {0}'.format(self.pkg)]) + else: + self.skipTest('TODO: test not configured for {}'.format(grains['os_family'])) pkg_latest = self.run_function('pkg.latest_version', [self.pkg]) self.assertIn(pkg_latest, cmd_pkg) diff --git a/tests/integration/states/test_pkg.py b/tests/integration/states/test_pkg.py index a0923235b208..c990c518dd72 100644 --- a/tests/integration/states/test_pkg.py +++ b/tests/integration/states/test_pkg.py @@ -5,6 +5,7 @@ ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals +import functools import logging import os import time @@ -27,13 +28,14 @@ # Import 3rd-party libs from salt.ext import six from salt.ext.six.moves import range # pylint: disable=import-error,redefined-builtin + try: from distro import LinuxDistribution + pre_grains = LinuxDistribution() except ImportError: pre_grains = None - log = logging.getLogger(__name__) _PKG_EPOCH_TARGETS = [] @@ -46,30 +48,48 @@ if salt.utils.platform.is_windows(): _PKG_TARGETS = ['7zip', 'putty'] -if pre_grains: - if 'arch' in pre_grains.like(): +elif salt.utils.platform.is_freebsd: + _VERSION_SPEC_SUPPORTED = False +elif pre_grains: + if any(arch in pre_grains.like() for arch in ('arch', 'archlinux')): _WILDCARDS_SUPPORTED = True elif 'debian' in pre_grains.like(): _WILDCARDS_SUPPORTED = True - elif 'freebsd' in pre_grains.like(): - _VERSION_SPEC_SUPPORTED = False elif 'rhel' in pre_grains.like(): _PKG_TARGETS = ['units', 'zsh-html'] _WILDCARDS_SUPPORTED = True if pre_grains.id() == 'centos': if pre_grains.major_version() == 5: - _PKG_32_TARGETS.append('xz-devel.i386') + _PKG_32_TARGETS = ['xz-devel.i386'] else: _PKG_32_TARGETS.append('xz-devel.i686') if pre_grains.major_version() == 5: - _PKG_DOT_TARGETS.append('python-migrate0.5') + _PKG_DOT_TARGETS = ['python-migrate0.5'] elif pre_grains.major_version() == 6: - _PKG_DOT_TARGETS.append('tomcat6-el-2.1-api') + _PKG_DOT_TARGETS = ['tomcat6-el-2.1-api'] elif pre_grains.major_version() == 7: - _PKG_DOT_TARGETS.append('tomcat-el-2.2-api') - _PKG_EPOCH_TARGETS.append('comps-extras') - elif 'sles' in pre_grains.like(): - _PKG_CAP_TARGETS.append(('perl(ZNC)', 'znc-perl')) + _PKG_DOT_TARGETS = ['tomcat-el-2.2-api'] + _PKG_EPOCH_TARGETS = ['comps-extras'] + elif pre_grains.id() in ('sles', 'opensuse'): + _PKG_TARGETS = ['figlet', 'htop'] + _PKG_CAP_TARGETS = [('perl(ZNC)', 'znc-perl')] + + +def runs_on(platforms=None, os_like=None, reason=''): + def decorator(caller): + @functools.wraps(caller) + def wrapper(cls): + if platforms: + if not any(getattr(salt.utils.platform, 'is_' + platform)() for platform in platforms): + cls.skipTest(reason if reason else 'OS not in [{}]'.format(', '.join(platforms))) + if pre_grains and os_like: + if not any(x in pre_grains.like() for x in os_like): + cls.skipTest(reason if reason else 'OS not similar to [{}]'.format(', '.join(os_like))) + return caller(cls) + + return wrapper + + return decorator @destructiveTest @@ -113,6 +133,7 @@ def setUp(self): self.run_function('pkg.refresh_db') self.ctx['refresh'] = True + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed') def test_pkg_001_installed(self): ''' This is a destructive test as it installs and then removes a package @@ -131,6 +152,7 @@ def test_pkg_001_installed(self): self.assertSaltTrueReturn(ret) @skipIf(not _VERSION_SPEC_SUPPORTED, 'Version specification not supported') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_002_installed_with_version(self): ''' This is a destructive test as it installs and then removes a package @@ -160,6 +182,7 @@ def test_pkg_002_installed_with_version(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_003_installed_multipkg(self): ''' This is a destructive test as it installs and then removes two packages @@ -183,6 +206,7 @@ def test_pkg_003_installed_multipkg(self): self.assertSaltTrueReturn(ret) @skipIf(not _VERSION_SPEC_SUPPORTED, 'Version specification not supported') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_004_installed_multipkg_with_version(self): ''' This is a destructive test as it installs and then removes two packages @@ -216,6 +240,7 @@ def test_pkg_004_installed_multipkg_with_version(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_32_TARGETS, 'No 32 bit packages have been specified for testing') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed') def test_pkg_005_installed_32bit(self): ''' This is a destructive test as it installs and then removes a package @@ -241,6 +266,7 @@ def test_pkg_005_installed_32bit(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_32_TARGETS, 'No 32 bit packages have been specified for testing') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_006_installed_32bit_with_version(self): ''' This is a destructive test as it installs and then removes a package @@ -276,6 +302,7 @@ def test_pkg_006_installed_32bit_with_version(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_DOT_TARGETS, 'No packages with "." in their name have been configured for') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_007_with_dot_in_pkgname(self=None): ''' This tests for the regression found in the following issue: @@ -297,6 +324,7 @@ def test_pkg_007_with_dot_in_pkgname(self=None): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_EPOCH_TARGETS, 'No targets have been configured with "epoch" in the version') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_008_epoch_in_version(self): ''' This tests for the regression found in the following issue: @@ -320,8 +348,8 @@ def test_pkg_008_epoch_in_version(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) - @skipIf(salt.utils.platform.is_windows(), 'minion is windows') - @requires_salt_modules('pkg.info_installed') + @requires_salt_modules('pkg.version', 'pkg.info_installed', 'pkg.installed', 'pkg.removed') + @runs_on(platforms=['linux'], reason='This test only runs on linux') def test_pkg_009_latest_with_epoch(self): ''' This tests for the following issue: @@ -340,6 +368,7 @@ def test_pkg_009_latest_with_epoch(self): ret = self.run_function('pkg.info_installed', [package]) self.assertTrue(pkgquery in six.text_type(ret)) + @requires_salt_modules('pkg.latest', 'pkg.removed') def test_pkg_010_latest(self): ''' This tests pkg.latest with a package that has no epoch (or a zero @@ -358,7 +387,8 @@ def test_pkg_010_latest(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) - @skipIf(not pre_grains or ('debian' not in pre_grains.like()), 'This test only runs on debian based distributions') + @requires_salt_modules('pkg.latest', 'pkg.list_pkgs', 'pkg.list_upgrades', 'pkg.version') + @runs_on(platforms=['linux'], os_like=['debian'], reason='This test only runs on Debian based linux distributions') def test_pkg_011_latest_only_upgrade(self): ''' WARNING: This test will pick a package with an available upgrade (if @@ -408,6 +438,7 @@ def test_pkg_011_latest_only_upgrade(self): ) @skipIf(not _WILDCARDS_SUPPORTED, 'Wildcards in pkg.install are not supported') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed') def test_pkg_012_installed_with_wildcard_version(self): ''' This is a destructive test as it installs and then removes a package @@ -456,8 +487,8 @@ def test_pkg_012_installed_with_wildcard_version(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) - @skipIf(not pre_grains or not any(x in pre_grains.like() for x in ('debian', 'redhat')), - 'Comparison operator not specially implemented') + @requires_salt_modules('pkg.version', 'pkg.latest_version', 'pkg.installed', 'pkg.removed') + @runs_on(platforms=['linux'], os_like=['debian', 'redhat'], reason='Comparison operator not specially implemented') def test_pkg_013_installed_with_comparison_operator(self): ''' This is a destructive test as it installs and then removes a package @@ -492,7 +523,8 @@ def test_pkg_013_installed_with_comparison_operator(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) - @skipIf(not pre_grains or 'redhat' not in pre_grains.like(), 'Comparison operator not specially implemented') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed') + @runs_on(platforms=['linux'], os_like=['redhat'], reason='Comparison operator not specially implemented') def test_pkg_014_installed_missing_release(self): ''' Tests that a version number missing the release portion still resolves @@ -518,8 +550,7 @@ def test_pkg_014_installed_missing_release(self): ret = self.run_state('pkg.removed', name=target) self.assertSaltTrueReturn(ret) - @skipIf(not pre_grains or not any(x in pre_grains.like() for x in ('debian', 'redhat')), 'Test is for debian/redhat') - @requires_salt_modules('pkg.hold', 'pkg.unhold') + @requires_salt_modules('pkg.hold', 'pkg.unhold', 'pkg.installed', 'pkg.removed') def test_pkg_015_installed_held(self): ''' Tests that a package can be held even when the package is already installed. @@ -578,6 +609,7 @@ def test_pkg_015_installed_held(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_CAP_TARGETS, 'Capability not provided') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed') def test_pkg_cap_001_installed(self): ''' This is a destructive test as it installs and then removes a package @@ -603,6 +635,7 @@ def test_pkg_cap_001_installed(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_CAP_TARGETS, 'Capability not available') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_cap_002_already_installed(self): ''' This is a destructive test as it installs and then removes a package @@ -636,11 +669,12 @@ def test_pkg_cap_002_already_installed(self): @skipIf(not _PKG_CAP_TARGETS, 'Capability not available') @skipIf(not _VERSION_SPEC_SUPPORTED, 'Version specification not supported') + @requires_salt_modules('pkg.installed', 'pkg.removed') def test_pkg_cap_003_installed_multipkg_with_version(self): ''' This is a destructive test as it installs and then removes two packages ''' - if pre_grains and 'arch' in pre_grains.like(): + if pre_grains and ('arch' in pre_grains.like() or 'archlinux' in pre_grains.like()): for idx in range(13): if idx == 12: raise Exception('Package database locked after 60 seconds, ' @@ -649,18 +683,18 @@ def test_pkg_cap_003_installed_multipkg_with_version(self): break time.sleep(5) - capability, realpkg = _PKG_CAP_TARGETS[0] - version = self.latest_version(capability) + target, realpkg = _PKG_CAP_TARGETS[0] + version = self.latest_version(target) realver = self.latest_version(realpkg) # If this assert fails, we need to find new targets, this test needs to # be able to test successful installation of packages, so these # packages need to not be installed before we run the states below - self.assertTrue(version) - self.assertTrue(realver) + self.assertTrue(version, 'new pkg cap targets required') + self.assertTrue(realver, 'new pkg cap targets required') try: - pkgs = [{_PKG_TARGETS[0]: version}, _PKG_TARGETS[1], {capability: realver}] + pkgs = [{_PKG_TARGETS[0]: version}, _PKG_TARGETS[1], {target: realver}] ret = self.run_state('pkg.installed', name='test_pkg_cap_003_installed_multipkg_with_version-install', pkgs=pkgs, @@ -688,6 +722,7 @@ def test_pkg_cap_003_installed_multipkg_with_version(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_CAP_TARGETS, 'Capability not available') + @requires_salt_modules('pkg.version', 'pkg.latest', 'pkg.removed') def test_pkg_cap_004_latest(self): ''' This tests pkg.latest with a package that has no epoch (or a zero @@ -717,6 +752,7 @@ def test_pkg_cap_004_latest(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_CAP_TARGETS, 'Capability not available') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed', 'pkg.downloaded') def test_pkg_cap_005_downloaded(self): ''' This is a destructive test as it installs and then removes a package @@ -741,6 +777,7 @@ def test_pkg_cap_005_downloaded(self): self.assertSaltTrueReturn(ret) @skipIf(not _PKG_CAP_TARGETS, 'Capability not available') + @requires_salt_modules('pkg.version', 'pkg.installed', 'pkg.removed', 'pkg.uptodate') def test_pkg_cap_006_uptodate(self): ''' This is a destructive test as it installs and then removes a package diff --git a/tests/integration/states/test_pkgrepo.py b/tests/integration/states/test_pkgrepo.py index 5eba0669e5c6..0101fb138c72 100644 --- a/tests/integration/states/test_pkgrepo.py +++ b/tests/integration/states/test_pkgrepo.py @@ -13,6 +13,7 @@ from tests.support.unit import skipIf from tests.support.helpers import ( destructiveTest, + requires_salt_modules, requires_system_grains, ) @@ -29,14 +30,13 @@ class PkgrepoTest(ModuleCase, SaltReturnAssertsMixin): ''' pkgrepo state tests ''' + @requires_salt_modules('pkgrepo.managed') @requires_system_grains def test_pkgrepo_01_managed(self, grains): ''' Test adding a repo ''' - os_grain = self.run_function('grains.item', ['os'])['os'] - os_release_info = tuple(self.run_function('grains.item', ['osrelease_info'])['osrelease_info']) - if os_grain == 'Ubuntu' and os_release_info >= (15, 10): + if grains['os'] == 'Ubuntu' and grains['osrelease_info'] >= (15, 10): self.skipTest( 'The PPA used for this test does not exist for Ubuntu Wily' ' (15.10) and later.' @@ -57,13 +57,13 @@ def test_pkgrepo_01_managed(self, grains): for state_id, state_result in six.iteritems(ret): self.assertSaltTrueReturn(dict([(state_id, state_result)])) - def test_pkgrepo_02_absent(self): + @requires_salt_modules('pkgrepo.absent') + @requires_system_grains + def test_pkgrepo_02_absent(self, grains): ''' Test removing the repo from the above test ''' - os_grain = self.run_function('grains.item', ['os'])['os'] - os_release_info = tuple(self.run_function('grains.item', ['osrelease_info'])['osrelease_info']) - if os_grain == 'Ubuntu' and os_release_info >= (15, 10): + if grains['os'] == 'Ubuntu' and grains['osrelease_info'] >= (15, 10): self.skipTest( 'The PPA used for this test does not exist for Ubuntu Wily' ' (15.10) and later.' @@ -77,24 +77,21 @@ def test_pkgrepo_02_absent(self): for state_id, state_result in six.iteritems(ret): self.assertSaltTrueReturn(dict([(state_id, state_result)])) + @requires_salt_modules('pkgrepo.absent', 'pkgrepo.managed') @requires_system_grains def test_pkgrepo_03_with_comments(self, grains): ''' Test adding a repo with comments ''' - os_family = grains['os_family'].lower() - - if os_family in ('redhat',): + if grains['os_family'] in ('redhat',): kwargs = { 'name': 'examplerepo', 'baseurl': 'http://example.com/repo', 'enabled': False, 'comments': ['This is a comment'] } - elif os_family in ('debian',): + elif grains['os_family'] in ('debian',): self.skipTest('Debian/Ubuntu test case needed') - else: - self.skipTest("No test case for os_family '{0}'".format(os_family)) try: # Run the state to add the repo @@ -130,6 +127,7 @@ def test_pkgrepo_03_with_comments(self, grains): # Clean up self.run_state('pkgrepo.absent', name=kwargs['name']) + @requires_salt_modules('pkgrepo.managed') @requires_system_grains def test_pkgrepo_04_apt_with_architectures(self, grains): ''' diff --git a/tests/multimaster/__init__.py b/tests/multimaster/__init__.py index 205b422030ca..9bed204f4f59 100644 --- a/tests/multimaster/__init__.py +++ b/tests/multimaster/__init__.py @@ -191,7 +191,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMaster, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -235,7 +235,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMaster, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -272,7 +272,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMinion, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM) @@ -309,7 +309,7 @@ def start_zeromq_daemons(self): daemon_class=SaltMinion, bin_dir_path=SCRIPT_DIR, fail_hard=True, - start_timeout=60) + start_timeout=120) sys.stdout.write( '\r{0}\r'.format( ' ' * getattr(self.parser.options, 'output_columns', PNUM)