From dc11031e7083cedec519ba191fc01cacae85ee68 Mon Sep 17 00:00:00 2001 From: Andriy Dzikh Date: Fri, 6 Aug 2021 09:35:08 -0700 Subject: [PATCH] Create script to handle flake rate computation Jenkins job. --- .../test-flake-chart/compute_flake_rate.sh | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 hack/jenkins/test-flake-chart/compute_flake_rate.sh diff --git a/hack/jenkins/test-flake-chart/compute_flake_rate.sh b/hack/jenkins/test-flake-chart/compute_flake_rate.sh new file mode 100644 index 0000000000..99be706449 --- /dev/null +++ b/hack/jenkins/test-flake-chart/compute_flake_rate.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2021 The Kubernetes Authors All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eux -o pipefail + +# Get directory of script. +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + +# Update html+js of flake charts. +gsutil cp "${DIR}/flake_chart.html" gs://minikube-flake-rate/flake_chart.html +gsutil cp "${DIR}/flake_chart.js" gs://minikube-flake-rate/flake_chart.js + +DATA_CSV=$(mktemp) +FLAKE_RATES_CSV=$(mktemp) +# Get raw test data. +gsutil cp gs://minikube-flake-rate/data.csv "${DATA_CSV}" +# Compute flake rates. +go run "${DIR}/compute_flake_rate.go" --data-csv="${DATA_CSV}" --date-range=15 > "${FLAKE_RATES_CSV}" +# Upload flake rates. +gsutil cp "${FLAKE_RATES_CSV}" gs://minikube-flake-rate/flake_rates.csv