Skip to content

Commit

Permalink
Add Grinder link in job description (#1363)
Browse files Browse the repository at this point in the history
- Rerun in Grinder link only shows up for failed test build
- add check to show display Artifactory link once

Signed-off-by: lanxia <lan_xia@ca.ibm.com>
  • Loading branch information
llxia authored and Shelley Lambert committed Sep 23, 2019
1 parent 6e7caf9 commit abd7c62
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ def post(output_name) {
def pattern = "${env.WORKSPACE}/*_test_output.*"
uploadToArtifactory(pattern)
}

addGrinderLink()
}
//for performance test, archive regardless the build result
if (env.BUILD_LIST.startsWith('perf')) {
Expand Down Expand Up @@ -596,12 +598,30 @@ def uploadToArtifactory(pattern) {
def artifactoryUrl = server.getUrl()
def uploadUrl = "${artifactoryUrl}/${artifactoryUploadDir}"
echo "Test output artifactory URL:'${uploadUrl}'"
currentBuild.description += "<br><a href=${uploadUrl}>Artifacts</a>"
if (!currentBuild.description.contains(uploadUrl)) {
currentBuild.description += "<br><a href=${uploadUrl}>Artifacts</a>"
}
} else {
echo "ARTIFACTORY_SERVER is not set. Artifacts are not uploaded onto artifactory server."
}
}

def addGrinderLink() {
def customTargetOpt = params.CUSTOM_TARGET ? "&CUSTOM_TARGET=${params.CUSTOM_TARGET}" : ""
def sdkSourceOpt = params.SDK_RESOURCE ? "&SDK_RESOURCE=${params.SDK_RESOURCE}" : ""
def sdkUrlOpt = params.CUSTOMIZED_SDK_URL ? "&CUSTOMIZED_SDK_URL=${params.CUSTOMIZED_SDK_URL}" : ""
def sdkUrlCredentialOpt = params.CUSTOMIZED_SDK_URL_CREDENTIAL_ID ? "&CUSTOMIZED_SDK_URL_CREDENTIAL_ID=${params.CUSTOMIZED_SDK_URL_CREDENTIAL_ID}" : ""

def url = "${HUDSON_URL}/job/Grinder/parambuild/?" \
+ "JDK_VERSION=${params.JDK_VERSION}" \
+ "&JDK_IMPL=${params.JDK_IMPL}" \
+ "&BUILD_LIST=${params.BUILD_LIST}" \
+ "&JenkinsFile=${params.JenkinsFile}" \
+ "&TARGET=${params.TARGET}" \
+ "${sdkSourceOpt}${sdkUrlOpt}${sdkUrlCredentialOpt}${customTargetOpt}"
currentBuild.description += "<br><a href=${url}>Rerun in Grinder</a> TARGET can be changed to run only the failed test target"
}

def run_parallel_tests() {
if (params.IS_PARALLEL == true) {
stage ("Parallel Tests") {
Expand Down

0 comments on commit abd7c62

Please sign in to comment.