Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(fix): add conformance test to the CI pipeline (redo of PR#1698). #1699

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2023 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.
# Github action job to test core java library features on
# downstream client libraries before they are released.
on:
push:
branches:
- main
pull_request:
name: conformance
jobs:
conformance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
kolea2 marked this conversation as resolved.
Show resolved Hide resolved
with:
repository: googleapis/cloud-bigtable-clients-test
ref: main
path: cloud-bigtable-clients-test
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- uses: actions/setup-go@v3
with:
go-version: '>=1.20.2'
- run: java -version
- run: go version
- run: .kokoro/conformance.sh
65 changes: 65 additions & 0 deletions .kokoro/conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
# Copyright 2023 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.

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}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Maven & Java version
mvn -version
echo ${JOB_TYPE}

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

RETURN_CODE=0
set +e

# Build and start the proxy in a separate process
pushd .
cd test-proxy
mvn clean install -DskipTests
nohup java -Dport=9999 -jar target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar &
proxyPID=$!
popd

# Run the conformance test
pushd .
cd cloud-bigtable-clients-test/tests
eval "go test -v -skip `cat ../../test-proxy/known_failures.txt` -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}
1 change: 1 addition & 0 deletions test-proxy/known_failures.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TestMutateRow_Generic_DeadlineExceeded\|TestMutateRows_Retry_ExponentialBackoff\|TestSampleRowKeys_Generic_DeadlineExceeded