-
Notifications
You must be signed in to change notification settings - Fork 441
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
feat(tests): [Bigtable] add conformance tests and proxy #7959
Open
bshaffer
wants to merge
28
commits into
main
Choose a base branch
from
bigtable-conformance-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,322
−7
Open
Changes from 25 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c0a02e0
feat(tests): [Bigtable] add conformance tests and proxy
bshaffer 57b960a
exclude gencode in cs
bshaffer 9d7998f
add proxy github action for testing
bshaffer c23ff7c
add workflow dispatch
bshaffer 5c1ecd8
install roadrunner in conformance actions
bshaffer 201aee7
fix rr version
bshaffer cf39afe
fix rr version (again)
bshaffer 3f30159
add sudo
bshaffer 9d41929
cleanup imports, use InseureCredentials
bshaffer af657c9
add logic for CheckAndMutateRows
bshaffer 80deb87
fix timeout, fix numworkers
bshaffer afdd928
fix timeout error
bshaffer 1ec7bce
fix call to checkAndMutateRow
bshaffer 03e201b
use InsecureCredentialsWrapper
bshaffer 6bda3c6
set hasEmulator to true to use http instead of https
bshaffer 9680d64
add back insecure credentials wrapper
bshaffer 970aca9
enable grpc in github actions
bshaffer c704936
more work on the proxy
bshaffer f5d63f5
add support for ReadModifyWriteRow
bshaffer 8b09085
add skip_tests
bshaffer 8dcb87c
remove index
bshaffer 0fbcd8d
WIP
bshaffer 8ddd126
fixes NonTransientErrors test, moves conformance.sh
bshaffer 5a63eae
Merge branch 'main' into bigtable-conformance-tests
bshaffer 6a111cd
checkout to proxy v0.0.3, remove ping.php
bshaffer 3f8596c
Merge branch 'main' into bigtable-conformance-tests
bshaffer 2a8b523
Merge branch 'bigtable-conformance-tests' of github.com:googleapis/go…
bshaffer 6cc26cb
update protos, add ExecuteQuery rpc
bshaffer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
.github/workflows/conformance-tests-bigtable-emulator.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright 2025 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 | ||
paths: | ||
- 'Bigtable/**' | ||
- '.github/workflows/conformance-tests-bigtable-emulator.yaml' | ||
pull_request: | ||
paths: | ||
- 'Bigtable/**' | ||
- '.github/workflows/conformance-tests-bigtable-emulator.yaml' | ||
workflow_dispatch: | ||
name: Run Bigtable Conformance Tests With Emulator | ||
jobs: | ||
conformance: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
extensions: grpc | ||
|
||
- name: Checkout Bigtable conformance tests | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: googleapis/cloud-bigtable-clients-test | ||
ref: main | ||
path: cloud-bigtable-clients-test | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '>=1.20.2' | ||
|
||
- name: Install Road Runner PHP | ||
run: | | ||
wget https://github.com/roadrunner-server/roadrunner/releases/download/v2024.3.1/roadrunner-2024.3.1-linux-amd64.deb | ||
sudo dpkg -i roadrunner-2024.3.1-linux-amd64.deb | ||
|
||
- run: bash Bigtable/tests/Conformance/proxy/conformance.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3" | ||
rpc: | ||
listen: "tcp://127.0.0.1:6001" | ||
|
||
server: | ||
command: "php worker.php" | ||
relay: "pipes" | ||
relay_timeout: "20s" | ||
|
||
kv: | ||
memory-cache: | ||
driver: memory | ||
config: { } | ||
|
||
grpc: | ||
listen: "tcp://127.0.0.1:9999" | ||
proto: ["test_proxy.proto"] | ||
max_send_msg_size: 50 | ||
max_recv_msg_size: 50 | ||
max_connection_idle: 0s | ||
max_connection_age: 0s | ||
max_connection_age_grace: 0s | ||
max_concurrent_streams: 10 | ||
ping_time: 1s | ||
timeout: 200s | ||
pool: | ||
num_workers: 5 | ||
max_jobs: 0 | ||
allocate_timeout: 60s | ||
destroy_timeout: 60s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "google-testing/proxy-bigtable-server", | ||
"description": "Proxy Bigtable Server", | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "../../.." | ||
} | ||
], | ||
"require": { | ||
"google/cloud-bigtable": "*", | ||
"grpc/grpc": "^1.36", | ||
"spiral/roadrunner-cli": "^2.6", | ||
"spiral/roadrunner-grpc": "^3.4", | ||
"spiral/roadrunner-kv": "^4.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"": "src" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
# Copyright 2025 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 | ||
proxyDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) | ||
projectDir=$(realpath $proxyDir/../../../..) | ||
|
||
# Install composer dependencies in the "proxy" directory | ||
composer update -d $proxyDir | ||
|
||
set +e | ||
|
||
# declare -a configs=("default" "enable_all") | ||
declare -a configs=("default") # PHP only supports "default" feature flags for now | ||
for config in "${configs[@]}" | ||
do | ||
# Start the proxy in a separate process | ||
rr serve -w $proxyDir & | ||
proxyPID=$! | ||
|
||
pushd . | ||
cd $projectDir/cloud-bigtable-clients-test/tests | ||
|
||
skipTests=$(sed -n 'H;${x;s/\n/\\|/g;s/^\\|//;p;};d' < $proxyDir/known_failures.txt) | ||
eval "go test -v -proxy_addr=:9999 -skip ${skipTests}" | ||
returnCode=$? | ||
popd | ||
|
||
# Stop the proxy | ||
kill ${proxyPID} | ||
|
||
if [[ ${returnCode} -gt 0 ]] | ||
then | ||
echo "Conformance test failed for config: ${config}" | ||
RETURN_CODE=${returnCode} | ||
else | ||
echo "Conformance test passed for config: ${config}" | ||
fi | ||
done | ||
|
||
exit ${RETURN_CODE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_Retry_WithRoutingCookie | ||
_Retry_WithRetryInfo | ||
TestMutateRows_Generic_DeadlineExceeded | ||
TestReadRow_Generic_DeadlineExceeded | ||
TestReadRows_NoRetry_OutOfOrderError | ||
TestReadRows_Retry_StreamReset | ||
TestReadRows_Retry_PausedScan | ||
TestReadRows_Retry_LastScannedRow | ||
TestReadRows_ReverseScans_FeatureFlag_Enabled | ||
TestReadRows_Generic_DeadlineExceeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
use Google\Bigtable\Testproxy\CreateClientRequest; | ||
|
||
$client = new \ProxyClient('127.0.0.1:9999', [ | ||
'credentials' => \Grpc\ChannelCredentials::createInsecure(), | ||
]); | ||
|
||
$message = new CreateClientRequest(); | ||
|
||
[$response, $status] = $client->CreateClient($message)->wait(); | ||
|
||
echo $response->serializeToJsonString() . PHP_EOL; |
30 changes: 30 additions & 0 deletions
30
Bigtable/tests/Conformance/proxy/src/GPBMetadata/Google/Bigtable/Testproxy/TestProxy.php
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
112 changes: 112 additions & 0 deletions
112
Bigtable/tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowRequest.php
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove TestReadRows_NoRetry_OutOfOrderError, TestReadRows_Retry_StreamReset, TestReadRows_Retry_PausedScan and TestReadRows_Retry_LastScannedRow from this list? So we don't forget about them :) We don't have to mark conformance test passing as a required step for presubmit for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally rather skip these and have them passing (in order to ensure no regression) than to have them fail and ignore the failing tests going forward.
I've entered bugs to fix these failing tests, which is a better place to keep track of these issues, so I don't think we'll forget them.