From c4e23560c2fcea5f08b85902d4609bf689de8d0a Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Mon, 4 Nov 2024 09:33:57 -0500 Subject: [PATCH] test: log conformance test failures in failure logs (#1511) * add kokoro scripts * fix kokoro script and clean up failure logs * add coerce logs script --- .kokoro/coerce_logs.sh | 37 ++++++++++++++++++++++++++++++++++++ .kokoro/conformance.sh | 3 +++ testproxy/known_failures.txt | 1 + 3 files changed, 41 insertions(+) create mode 100644 .kokoro/coerce_logs.sh create mode 100644 testproxy/known_failures.txt 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 diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh index 777cc4aef..6763daa45 100755 --- a/.kokoro/conformance.sh +++ b/.kokoro/conformance.sh @@ -41,5 +41,8 @@ cd cloud-bigtable-clients-test/tests eval "go test -v -proxy_addr=:9999" RETURN_CODE=$? +# 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..cce1bd7fa --- /dev/null +++ b/testproxy/known_failures.txt @@ -0,0 +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