Merge "fix archive artifacts"
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index edfabbc..3e44bfa 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -501,14 +501,43 @@
//
// Test
//
+ def artifacts_dir = '_artifacts/'
if (common.checkContains('TEST', 'k8s')) {
stage('Run k8s bootstrap tests') {
- orchestrate.runConformanceTests(saltMaster, K8S_API_SERVER, 'tomkukral/k8s-scripts')
+ def image = 'tomkukral/k8s-scripts'
+ def output_file = image.replaceAll('/', '-') + '.output'
+
+ // run image
+ test.runConformanceTests(saltMaster, K8S_API_SERVER, image)
+
+ // collect output
+ sh "mkdir -p ${artifacts_dir}"
+ file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
+ writeFile file: "${artifacts_dir}${output_file}", text: file_content
+ sh "cat ${artifacts_dir}${output_file}"
+
+ // collect artifacts
+ archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
}
stage('Run k8s conformance e2e tests') {
- orchestrate.runConformanceTests(saltMaster, K8S_API_SERVER, K8S_CONFORMANCE_IMAGE)
+ //test.runConformanceTests(saltMaster, K8S_API_SERVER, K8S_CONFORMANCE_IMAGE)
+
+ def image = K8S_CONFORMANCE_IMAGE
+ def output_file = image.replaceAll('/', '-') + '.output'
+
+ // run image
+ test.runConformanceTests(saltMaster, K8S_API_SERVER, image)
+
+ // collect output
+ sh "mkdir -p ${artifacts_dir}"
+ file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
+ writeFile file: "${artifacts_dir}${output_file}", text: file_content
+ sh "cat ${artifacts_dir}${output_file}"
+
+ // collect artifacts
+ archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
}
}
@@ -523,10 +552,12 @@
}
stage('Finalize') {
- try {
- salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
- } catch (Exception e) {
- common.warningMsg('State apply failed but we should continue to run')
+ if (INSTALL != '') {
+ try {
+ salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
+ } catch (Exception e) {
+ common.warningMsg('State apply failed but we should continue to run')
+ }
}
}
} catch (Throwable e) {