From 743018ee671b1576b5bf2292d159fcb9849e70c8 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Fri, 1 Nov 2024 11:28:46 -0400 Subject: [PATCH 1/7] add kokoro scripts --- .kokoro/conformance.sh | 7 +++++++ testproxy/known_failures.txt | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 testproxy/known_failures.txt diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 777cc4aef..3fdda019e 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -40,6 +40,13 @@ popd cd cloud-bigtable-clients-test/tests eval "go test -v -proxy_addr=:9999" RETURN_CODE=$? +popd + +# Stop the proxy +kill $proxyPID + +# fix output location of logs +bash .kokoro/coerce_logs.sh echo "exiting with ${RETURN_CODE}" exit ${RETURN_CODE} \ No newline at end of file diff --git a/testproxy/known_failures.txt b/testproxy/known_failures.txt new file mode 100644 index 000000000..47c95b2fb --- /dev/null +++ b/testproxy/known_failures.txt @@ -0,0 +1,17 @@ +TestMutateRow_Generic_Headers, +TestMutateRow_Generic_DeadlineExceeded, +TestMutateRows_Generic_CloseClient, +TestMutateRows_Retry_WithRoutingCookie, +TestReadModifyWriteRow_Generic_Headers, +TestReadModifyWriteRow_NoRetry_TransientError, +TestReadModifyWriteRow_Generic_DeadlineExceeded, +TestReadRow_Generic_DeadlineExceeded, +TestReadRow_Retry_WithRoutingCookie, +TestReadRow_Retry_WithRetryInfo, +TestReadRows_ReverseScans_FeatureFlag_Enabled, +TestReadRows_NoRetry_OutOfOrderError_Reverse, +TestReadRows_Retry_PausedScan, +TestReadRows_Retry_LastScannedRow, +TestReadRows_Retry_LastScannedRow_Reverse, +TestCheckAndMutateRow_NoRetry_TransientError, +TestCheckAndMutateRow_Generic_DeadlineExceeded, \ No newline at end of file From 8bc51cd10aae6539fbb98debd6eb5a0216262e06 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Fri, 1 Nov 2024 11:39:55 -0400 Subject: [PATCH 2/7] fix kokoro script and clean up failure logs --- .kokoro/conformance.sh | 4 ---- testproxy/known_failures.txt | 18 +----------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 3fdda019e..6763daa45 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -40,10 +40,6 @@ popd cd cloud-bigtable-clients-test/tests eval "go test -v -proxy_addr=:9999" RETURN_CODE=$? -popd - -# Stop the proxy -kill $proxyPID # fix output location of logs bash .kokoro/coerce_logs.sh diff --git a/testproxy/known_failures.txt b/testproxy/known_failures.txt index 47c95b2fb..cce1bd7fa 100644 --- a/testproxy/known_failures.txt +++ b/testproxy/known_failures.txt @@ -1,17 +1 @@ -TestMutateRow_Generic_Headers, -TestMutateRow_Generic_DeadlineExceeded, -TestMutateRows_Generic_CloseClient, -TestMutateRows_Retry_WithRoutingCookie, -TestReadModifyWriteRow_Generic_Headers, -TestReadModifyWriteRow_NoRetry_TransientError, -TestReadModifyWriteRow_Generic_DeadlineExceeded, -TestReadRow_Generic_DeadlineExceeded, -TestReadRow_Retry_WithRoutingCookie, -TestReadRow_Retry_WithRetryInfo, -TestReadRows_ReverseScans_FeatureFlag_Enabled, -TestReadRows_NoRetry_OutOfOrderError_Reverse, -TestReadRows_Retry_PausedScan, -TestReadRows_Retry_LastScannedRow, -TestReadRows_Retry_LastScannedRow_Reverse, -TestCheckAndMutateRow_NoRetry_TransientError, -TestCheckAndMutateRow_Generic_DeadlineExceeded, \ No newline at end of file +TestMutateRow_Generic_Headers\|TestMutateRow_Generic_DeadlineExceeded|TestMutateRows_Generic_CloseClient\|TestMutateRows_Retry_WithRoutingCookie\|TestReadModifyWriteRow_Generic_Headers\|TestReadModifyWriteRow_NoRetry_TransientError\|TestReadModifyWriteRow_Generic_DeadlineExceeded\|TestReadRow_Generic_DeadlineExceeded\|TestReadRow_Retry_WithRoutingCookie\|TestReadRow_Retry_WithRetryInfo\|TestReadRows_ReverseScans_FeatureFlag_Enabled\|TestReadRows_NoRetry_OutOfOrderError_Reverse\|TestReadRows_Retry_PausedScan\|TestReadRows_Retry_LastScannedRow\|TestReadRows_Retry_LastScannedRow_Reverse\|TestCheckAndMutateRow_NoRetry_TransientError\|TestCheckAndMutateRow_Generic_DeadlineExceeded \ No newline at end of file From fc08cd29dae25984eb2081e0a870eb9e64759132 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Fri, 1 Nov 2024 11:58:08 -0400 Subject: [PATCH 3/7] add coerce logs script --- .kokoro/coerce_logs.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .kokoro/coerce_logs.sh diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100644 index 000000000..883ee0faa --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2024 Google LLC +# +# 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. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done \ No newline at end of file From 05c12ccb33bf00094aaf7e8130010542af334376 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Mon, 4 Nov 2024 10:22:34 -0500 Subject: [PATCH 4/7] auto adds test failures to testproxy known failures log --- .kokoro/conformance.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 6763daa45..be6a1ddbf 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -38,10 +38,13 @@ popd # Run the conformance test cd cloud-bigtable-clients-test/tests -eval "go test -v -proxy_addr=:9999" +eval "go test -v -proxy_addr=:9999 > test.log" RETURN_CODE=$? -# fix output location of logs +# Updates the known failures tests. +grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' >> .kokoro/testproxy/known_failures.txt + +# Fix output location of logs bash .kokoro/coerce_logs.sh echo "exiting with ${RETURN_CODE}" From ff7c1d29bce5be23db16ee5a724c78bdb1842388 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Mon, 4 Nov 2024 10:33:44 -0500 Subject: [PATCH 5/7] fix bash script --- .kokoro/conformance.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index be6a1ddbf..0d6653124 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -41,8 +41,8 @@ cd cloud-bigtable-clients-test/tests eval "go test -v -proxy_addr=:9999 > test.log" RETURN_CODE=$? -# Updates the known failures tests. -grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' >> .kokoro/testproxy/known_failures.txt +# Prints out the known failure tests into the format for update +grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' # Fix output location of logs bash .kokoro/coerce_logs.sh From a0e5703ab7020e2f109172ddfd2a606f49caed95 Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Mon, 4 Nov 2024 10:40:06 -0500 Subject: [PATCH 6/7] automate updating textproxy file --- .kokoro/conformance.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 0d6653124..45b0c0b6b 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -42,7 +42,10 @@ eval "go test -v -proxy_addr=:9999 > test.log" RETURN_CODE=$? # Prints out the known failure tests into the format for update -grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' +grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' >> .kokoro/testproxy/known_failures.txt +git add .kokoro/testproxy/known_failures.txt +git commit -m "Update known failures" +git push origin main # Fix output location of logs bash .kokoro/coerce_logs.sh From 673e995a089ced60617d8c48ecd43aa2cd6593ec Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Mon, 4 Nov 2024 10:50:55 -0500 Subject: [PATCH 7/7] print out test failures --- .kokoro/conformance.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 45b0c0b6b..02c5cc612 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -42,10 +42,8 @@ eval "go test -v -proxy_addr=:9999 > test.log" RETURN_CODE=$? # Prints out the known failure tests into the format for update -grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' >> .kokoro/testproxy/known_failures.txt -git add .kokoro/testproxy/known_failures.txt -git commit -m "Update known failures" -git push origin main +eval "grep "FAIL:" test.log | awk '{print $3}' | sed 's/$/\\|/' | tr -d '\n' | sed 's/\\|$//' >> .kokoro/testproxy/known_failures.txt" +echo "${cat .kokoro/testproxy/known_failures.txt}" # Fix output location of logs bash .kokoro/coerce_logs.sh