From 3bb1a577003c283ce8c1b29c58ad33302237d1c9 Mon Sep 17 00:00:00 2001 From: Medya Ghazizadeh Date: Thu, 13 Feb 2020 11:27:32 -0700 Subject: [PATCH] upload "per commit" logs for integration test (#6609) * make set logs URLs per commit * add logs per commit to commit status * logs per commit * add per commit logs for windows too * fix windows test script virtualbox * fix windows script * forget about windows for now it errors * fix pending script * fix typo pending script --- hack/jenkins/common.sh | 4 +++- hack/jenkins/minikube_set_pending.sh | 3 ++- hack/jenkins/windows_integration_test_hyperv.ps1 | 2 ++ hack/jenkins/windows_integration_test_virtualbox.ps1 | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index 4a3431e398..2570c4cfc7 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -308,7 +308,8 @@ min=$(($elapsed/60)) sec=$(tail -c 3 <<< $((${elapsed}00/60))) elapsed=$min.$sec -JOB_GCS_BUCKET="minikube-builds/logs/${MINIKUBE_LOCATION}/${JOB_NAME}" +SHORT_COMMIT=${COMMIT:0:7} +JOB_GCS_BUCKET="minikube-builds/logs/${MINIKUBE_LOCATION}/${SHORT_COMMIT}/${JOB_NAME}" echo ">> Copying ${TEST_OUT} to gs://${JOB_GCS_BUCKET}out.txt" gsutil -qm cp "${TEST_OUT}" "gs://${JOB_GCS_BUCKET}out.txt" @@ -345,6 +346,7 @@ gsutil -qm cp "${JSON_OUT}" "gs://${JOB_GCS_BUCKET}.json" || true echo ">> uploading ${HTML_OUT}" gsutil -qm cp "${HTML_OUT}" "gs://${JOB_GCS_BUCKET}.html" || true + public_log_url="https://storage.googleapis.com/${JOB_GCS_BUCKET}.txt" if grep -q html "$HTML_OUT"; then public_log_url="https://storage.googleapis.com/${JOB_GCS_BUCKET}.html" diff --git a/hack/jenkins/minikube_set_pending.sh b/hack/jenkins/minikube_set_pending.sh index 4d7a2bedef..2c2c394668 100755 --- a/hack/jenkins/minikube_set_pending.sh +++ b/hack/jenkins/minikube_set_pending.sh @@ -78,8 +78,9 @@ function retry_github_status() { done } +SHORT_COMMIT=${ghprbActualCommit:0:7} for j in ${jobs[@]}; do retry_github_status "${ghprbActualCommit}" "${j}" "pending" "${access_token}" \ - "https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${j}.pending" + "https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${SHORT_COMMIT}/${j}.pending" done diff --git a/hack/jenkins/windows_integration_test_hyperv.ps1 b/hack/jenkins/windows_integration_test_hyperv.ps1 index a829786eb6..4c8835d0cf 100644 --- a/hack/jenkins/windows_integration_test_hyperv.ps1 +++ b/hack/jenkins/windows_integration_test_hyperv.ps1 @@ -25,6 +25,8 @@ $env:result=$lastexitcode If($env:result -eq 0){$env:status="success"} Else {$env:status="failure"} +# $env:SHORT_COMMIT=$env:COMMIT.substring(0, 7) +# to be used later to implement https://github.com/kubernetes/minikube/issues/6593 $env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/Hyper-V_Windows.txt" $json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"Hyper-V_Windows`"}" Invoke-WebRequest -Uri "https://api.github.com/repos/kubernetes/minikube/statuses/$env:COMMIT`?access_token=$env:access_token" -Body $json -ContentType "application/json" -Method Post -usebasicparsing diff --git a/hack/jenkins/windows_integration_test_virtualbox.ps1 b/hack/jenkins/windows_integration_test_virtualbox.ps1 index 8e4d0ae48a..5cc4e157b1 100644 --- a/hack/jenkins/windows_integration_test_virtualbox.ps1 +++ b/hack/jenkins/windows_integration_test_virtualbox.ps1 @@ -25,6 +25,8 @@ $env:result=$lastexitcode If($env:result -eq 0){$env:status="success"} Else {$env:status="failure"} +# $env:SHORT_COMMIT=$env:COMMIT.substring(0, 7) +# to be used later $env:target_url="https://storage.googleapis.com/minikube-builds/logs/$env:MINIKUBE_LOCATION/VirtualBox_Windows.txt" $json = "{`"state`": `"$env:status`", `"description`": `"Jenkins`", `"target_url`": `"$env:target_url`", `"context`": `"VirtualBox_Windows`"}" Invoke-WebRequest -Uri "https://api.github.com/repos/kubernetes/minikube/statuses/$env:COMMIT`?access_token=$env:access_token" -Body $json -ContentType "application/json" -Method Post -usebasicparsing