Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
tests: add logic to not fail when trying to send the logs to s3 (#2855)
Browse files Browse the repository at this point in the history
* tests: add logic to not fail when trying to send the logs to s3

* tests: change the aws key random name
  • Loading branch information
cpanato authored Jan 30, 2018
1 parent 0327326 commit b6b3195
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
31 changes: 23 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pipeline {
agent none
environment {
KUBE_CONFORMANCE_IMAGE = 'quay.io/coreos/kube-conformance:v1.8.4_coreos.0'
LOGSTASH_BUCKET= "log-analyzer-tectonic-installer"
}
options {
// Individual steps have stricter timeouts. 360 minutes should be never reached.
Expand Down Expand Up @@ -415,7 +416,6 @@ pipeline {
script {
try {
sh """#!/bin/bash -xe
export LOGSTASH_BUCKET='log-analyzer-tectonic-installer'
export BUILD_RESULT=${currentBuild.currentResult}
./tests/jenkins-jobs/scripts/log-analyzer-copy.sh jenkins-logs
"""
Expand Down Expand Up @@ -486,12 +486,19 @@ def runRSpecTest(testFilePath, dockerArgs, credentials) {
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/**/logs/**'
withDockerContainer(params.builder_image) {
withCredentials(creds) {
sh """#!/bin/bash -xe
./tests/jenkins-jobs/scripts/log-analyzer-copy.sh smoke-test-logs ${testFilePath}
"""
script {
try {
sh """#!/bin/bash -xe
./tests/jenkins-jobs/scripts/log-analyzer-copy.sh smoke-test-logs ${testFilePath}
"""
} catch (Exception e) {
notifyBuildSlack(true)
} finally {
cleanWs notFailBuild: true
}
}
}
}

cleanWs notFailBuild: true
}

Expand Down Expand Up @@ -529,9 +536,17 @@ def runRSpecTestBareMetal(testFilePath, credentials) {
reportStatusToGithub((err == null) ? 'success' : 'failure', testFilePath, originalCommitId)
archiveArtifacts allowEmptyArchive: true, artifacts: 'build/**/logs/**'
withCredentials(credentials) {
sh """#!/bin/bash -xe
./tests/jenkins-jobs/scripts/log-analyzer-copy.sh smoke-test-logs ${testFilePath}
"""
script {
try {
sh """#!/bin/bash -xe
./tests/jenkins-jobs/scripts/log-analyzer-copy.sh smoke-test-logs ${testFilePath}
"""
} catch (Exception e) {
notifyBuildSlack(true)
} finally {
cleanWs notFailBuild: true
}
}
}
cleanWs notFailBuild: true
}
Expand Down
2 changes: 1 addition & 1 deletion tests/rspec/lib/name_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ def self.generate_fake_email
end

def self.generate_short_name
"rspec-#{Faker::Internet.user_name(5..8)}-#{Time.now.to_i}"
"rspec-#{Faker::Internet.user_name(5..8)}-#{SecureRandom.hex[0...RANDOM_HASH_LENGTH]}"
end
end

0 comments on commit b6b3195

Please sign in to comment.