Skip to content

Commit 318a754

Browse files
authored
Merge branch 'master' into port-52126
2 parents 9803a43 + ae6ca7e commit 318a754

File tree

324 files changed

+8216
-19562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+8216
-19562
lines changed

.ci/docs

+22-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
// Define the maximum time, in hours, that a test run should run for
44
def global_timeout = 2
5-
def salt_target_branch = 'master'
65

76
properties([
87
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
98
])
109

11-
// Be sure to cancel any previously running builds
12-
def buildNumber = env.BUILD_NUMBER as int
13-
if (buildNumber > 1) {
14-
// This will cancel the previous build which also defined a matching milestone
15-
milestone(buildNumber - 1)
10+
// Only set milestones on PR builds
11+
if (env.CHANGE_ID) {
12+
// Be sure to cancel any previously running builds
13+
def buildNumber = env.BUILD_NUMBER as int
14+
if (buildNumber > 1) {
15+
// This will cancel the previous build which also defined a matching milestone
16+
milestone(buildNumber - 1)
17+
}
18+
// Define a milestone for this build so that, if another build starts, this one will be aborted
19+
milestone(buildNumber)
1620
}
17-
// Define a milestone for this build so that, if another build starts, this one will be aborted
18-
milestone(buildNumber)
1921

2022
def shell_header
2123

@@ -41,13 +43,22 @@ wrappedNode('docs', global_timeout, '#jenkins-prod-pr') {
4143
'''
4244
}
4345

44-
stage('Build') {
46+
stage('Build HTML Docs') {
47+
sh shell_header + '''
48+
eval "$(pyenv init -)"
49+
pyenv shell 3.6.8
50+
nox -e 'docs-html(compress=True)'
51+
'''
52+
archiveArtifacts artifacts: 'doc/html-archive.tar.gz'
53+
}
54+
55+
stage('Build Man Pages') {
4556
sh shell_header + '''
4657
eval "$(pyenv init -)"
4758
pyenv shell 3.6.8
48-
nox -e docs
59+
nox -e 'docs-man(compress=True, update=False)'
4960
'''
50-
archiveArtifacts artifacts: 'doc/doc-archive.tar.gz'
61+
archiveArtifacts artifacts: 'doc/man-archive.tar.gz'
5162
}
5263
}
5364

.ci/kitchen-amazon1-py2

+29-140
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,48 @@
1-
@Library('salt@1.1') _
1+
@Library('salt@master-1.3') _
22

33
// Define the maximum time, in hours, that a test run should run for
44
def testrun_timeout = 6
5-
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
6-
// hour to allow for artifacts to be downloaded, if possible.
7-
def global_timeout = testrun_timeout + 1;
85

96
def distro_name = 'amazon'
107
def distro_version = '1'
118
def python_version = 'py2'
12-
def test_transport = 'ZeroMQ'
13-
def salt_target_branch = 'master'
14-
def golden_images_branch = '2019.2'
9+
def nox_env_name = 'runtests-zeromq'
10+
def golden_images_branch = 'master'
1511
def nox_passthrough_opts = '--ssh-tests'
12+
def concurrent_builds = 1
13+
def use_spot_instances = true
14+
def jenkins_slave_label = 'kitchen-slave'
1615

1716
properties([
18-
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
17+
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
1918
parameters([
2019
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
2120
])
2221
])
2322

24-
// Be sure to cancel any previously running builds
25-
def buildNumber = env.BUILD_NUMBER as int
26-
if (buildNumber > 1) {
27-
// This will cancel the previous build which also defined a matching milestone
28-
milestone(buildNumber - 1)
29-
}
30-
// Define a milestone for this build so that, if another build starts, this one will be aborted
31-
milestone(buildNumber)
32-
33-
34-
wrappedNode('kitchen-slave', global_timeout, '#jenkins-prod-pr') {
35-
withEnv([
36-
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/nox-platforms.yml',
37-
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/nox-verifier.yml',
38-
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
39-
"NOX_ENV_NAME=runtests-${test_transport.toLowerCase()}",
40-
'NOX_ENABLE_FROM_FILENAMES=true',
41-
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
42-
"SALT_TARGET_BRANCH=${salt_target_branch}",
43-
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
44-
"CODECOV_FLAGS=${distro_name}${distro_version},${python_version},${test_transport.toLowerCase()}",
45-
'PATH=~/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin',
46-
'RBENV_VERSION=2.6.3',
47-
"TEST_SUITE=${python_version}",
48-
"TEST_PLATFORM=${distro_name}-${distro_version}",
49-
"TEST_TRANSPORT=${test_transport}",
50-
"FORCE_FULL=${params.runFull}",
51-
]) {
52-
// Checkout the repo
53-
stage('Clone') {
54-
cleanWs notFailBuild: true
55-
checkout scm
56-
sh 'git fetch --no-tags https://github.com/saltstack/salt.git +refs/heads/${SALT_TARGET_BRANCH}:refs/remotes/origin/${SALT_TARGET_BRANCH}'
57-
}
58-
59-
// Setup the kitchen required bundle
60-
stage('Setup') {
61-
sh 'bundle install --with ec2 windows --without docker macos opennebula vagrant'
62-
}
63-
64-
stage('Create VM') {
65-
retry(3) {
66-
sh '''
67-
t=$(shuf -i 30-120 -n 1); echo "Sleeping $t seconds"; sleep $t
68-
cp -f ~/workspace/spot.yml .kitchen.local.yml
69-
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: $?";
70-
'''
71-
sh """
72-
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
73-
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-create.log"
74-
fi
75-
if [ -s ".kitchen/logs/kitchen.log" ]; then
76-
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
77-
fi
78-
"""
79-
}
80-
sh '''
81-
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'image_id:'
82-
bundle exec kitchen diagnose $TEST_SUITE-$TEST_PLATFORM | grep 'instance_type:' -A5
83-
'''
84-
}
85-
86-
try {
87-
timeout(time: testrun_timeout * 60 - 15, unit: 'MINUTES') {
88-
stage('Converge VM') {
89-
sh '''
90-
ssh-agent /bin/bash -c 'ssh-add ~/.ssh/kitchen.pem; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
91-
'''
92-
sh """
93-
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
94-
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-converge.log"
95-
fi
96-
if [ -s ".kitchen/logs/kitchen.log" ]; then
97-
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
98-
fi
99-
"""
100-
}
101-
stage('Run Tests') {
102-
withEnv(["DONT_DOWNLOAD_ARTEFACTS=1"]) {
103-
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
104-
}
105-
}
106-
}
107-
} finally {
108-
try {
109-
sh """
110-
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
111-
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-verify.log"
112-
fi
113-
if [ -s ".kitchen/logs/kitchen.log" ]; then
114-
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
115-
fi
116-
"""
117-
stage('Download Artefacts') {
118-
withEnv(["ONLY_DOWNLOAD_ARTEFACTS=1"]){
119-
sh '''
120-
bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM || exit 0
121-
'''
122-
}
123-
sh """
124-
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
125-
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-download.log"
126-
fi
127-
if [ -s ".kitchen/logs/kitchen.log" ]; then
128-
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-download.log"
129-
fi
130-
"""
131-
}
132-
archiveArtifacts(
133-
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
134-
allowEmptyArchive: true
135-
)
136-
junit 'artifacts/xml-unittests-output/*.xml'
137-
} finally {
138-
stage('Cleanup') {
139-
sh '''
140-
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
141-
'''
142-
}
143-
stage('Upload Coverage') {
144-
script {
145-
withCredentials([[$class: 'StringBinding', credentialsId: 'codecov-upload-token-salt', variable: 'CODECOV_TOKEN']]) {
146-
sh '''
147-
if [ -n "${FORCE_FULL}" -a "${FORCE_FULL}" = "true" -a -f artifacts/coverage/coverage.xml ]; then
148-
(curl -L https://codecov.io/bash | /bin/sh -s -- -R $(pwd) -s artifacts/coverage/ -F "${CODECOV_FLAGS}") || true
149-
fi
150-
'''
151-
}
152-
}
153-
}
154-
}
155-
}
23+
// Only set milestones on PR builds
24+
if (env.CHANGE_ID) {
25+
// Be sure to cancel any previously running builds
26+
def buildNumber = env.BUILD_NUMBER as int
27+
if (buildNumber > concurrent_builds) {
28+
// This will cancel the previous build which also defined a matching milestone
29+
milestone(buildNumber - concurrent_builds)
15630
}
31+
// Define a milestone for this build so that, if another build starts, this one will be aborted
32+
milestone(buildNumber)
15733
}
15834

35+
runTests(
36+
env: env,
37+
distro_name: distro_name,
38+
distro_version: distro_version,
39+
python_version: python_version,
40+
golden_images_branch: golden_images_branch,
41+
nox_env_name: nox_env_name,
42+
nox_passthrough_opts: nox_passthrough_opts,
43+
testrun_timeout: testrun_timeout,
44+
run_full: params.runFull,
45+
use_spot_instances: use_spot_instances,
46+
jenkins_slave_label: jenkins_slave_label)
47+
15948
// vim: ft=groovy

0 commit comments

Comments
 (0)