Skip to content

Commit

Permalink
remove new tests from this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Nov 28, 2024
1 parent d0768d3 commit 61707ca
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 318 deletions.
2 changes: 0 additions & 2 deletions .cross_sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ Generation can be initiated using `nox -s generate_sync`
from the root of the project. This will find all classes with the `__CROSS_SYNC_OUTPUT__ = "path/to/output"`
annotation, and generate a sync version of classes marked with `@CrossSync.convert_sync` at the output path.

There is a unit test at `tests/unit/data/test_sync_up_to_date.py` that verifies that the generated code is up to date

## Architecture

CrossSync is made up of two parts:
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ jobs:
matrix:
test-version: [ "v0.0.2" ]
py-version: [ 3.8 ]
client-type: [ "async", "sync", "legacy" ]
include:
- client-type: "sync"
# sync client does not support concurrent streams
test_args: "-skip _Generic_MultiStream"
- client-type: "legacy"
# legacy client is synchtonous and does not support concurrent streams
# legacy client does not expose mutate_row. Disable those tests
test_args: "-skip _Generic_MultiStream -skip TestMutateRow_"
client-type: [ "async", "legacy" ]
fail-fast: false
name: "${{ matrix.client-type }} client / python ${{ matrix.py-version }} / test tag ${{ matrix.test-version }}"
steps:
Expand All @@ -61,6 +53,4 @@ jobs:
env:
CLIENT_TYPE: ${{ matrix.client-type }}
PYTHONUNBUFFERED: 1
TEST_ARGS: ${{ matrix.test_args }}
PROXY_PORT: 9999

10 changes: 9 additions & 1 deletion .kokoro/conformance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ set -eo pipefail
## cd to the parent directory, i.e. the root of the git repo
cd $(dirname $0)/..

PROXY_ARGS=""
TEST_ARGS=""
if [[ "${CLIENT_TYPE^^}" == "LEGACY" ]]; then
echo "Using legacy client"
# legacy client does not expose mutate_row. Disable those tests
TEST_ARGS="-skip TestMutateRow_"
fi

# Build and start the proxy in a separate process
PROXY_PORT=9999
pushd test_proxy
nohup python test_proxy.py --port $PROXY_PORT --client_type=$CLIENT_TYPE &
proxyPID=$!
Expand All @@ -33,7 +42,6 @@ function cleanup() {
trap cleanup EXIT

# Run the conformance test
echo "running tests with args: $TEST_ARGS"
pushd cloud-bigtable-clients-test/tests
eval "go test -v -proxy_addr=:$PROXY_PORT $TEST_ARGS"
RETURN_CODE=$?
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def system_emulated(session):


@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
@nox.parametrize("client_type", ["async", "sync", "legacy"])
@nox.parametrize("client_type", ["async"])
def conformance(session, client_type):
# install dependencies
constraints_path = str(
Expand Down
2 changes: 1 addition & 1 deletion test_proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ python test_proxy.py --port 8080
```

By default, the test_proxy targets the async client. You can change this by passing in the `--client_type` flag.
Valid options are `async`, `sync`, and `legacy`.
Valid options are `async`, and `legacy`.

```
python test_proxy.py --client_type=legacy
Expand Down
185 changes: 0 additions & 185 deletions test_proxy/handlers/client_handler_data_sync_autogen.py

This file was deleted.

16 changes: 2 additions & 14 deletions test_proxy/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
SCRIPT_DIR=$(realpath $(dirname "$0"))
cd $SCRIPT_DIR

export PROXY_SERVER_PORT=$(shuf -i 50000-60000 -n 1)
export PROXY_SERVER_PORT=50055

# download test suite
if [ ! -d "cloud-bigtable-clients-test" ]; then
Expand All @@ -43,19 +43,7 @@ function finish {
}
trap finish EXIT

if [[ $CLIENT_TYPE == "legacy" ]]; then
echo "Using legacy client"
# legacy client does not expose mutate_row. Disable those tests
TEST_ARGS="-skip TestMutateRow_"
fi

if [[ $CLIENT_TYPE != "async" ]]; then
echo "Using legacy client"
# sync and legacy client do not support concurrent streams
TEST_ARGS="$TEST_ARGS -skip _Generic_MultiStream "
fi

# run tests
pushd cloud-bigtable-clients-test/tests
echo "Running with $TEST_ARGS"
go test -v -proxy_addr=:$PROXY_SERVER_PORT $TEST_ARGS
go test -v -proxy_addr=:$PROXY_SERVER_PORT
5 changes: 1 addition & 4 deletions test_proxy/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ def format_dict(input_obj):
if client_type == "legacy":
import client_handler_legacy
client = client_handler_legacy.LegacyTestProxyClientHandler(**json_data)
elif client_type == "sync":
import client_handler_data_sync_autogen
client = client_handler_data_sync_autogen.TestProxyClientHandler(**json_data)
else:
client = client_handler_data_async.TestProxyClientHandlerAsync(**json_data)
client_map[client_id] = client
Expand Down Expand Up @@ -153,7 +150,7 @@ def client_handler_process(request_q, queue_pool, client_type="async"):

p = argparse.ArgumentParser()
p.add_argument("--port", dest='port', default="50055")
p.add_argument("--client_type", dest='client_type', default="async", choices=["async", "sync", "legacy"])
p.add_argument("--client_type", dest='client_type', default="async", choices=["async", "legacy"])

if __name__ == "__main__":
port = p.parse_args().port
Expand Down
Loading

0 comments on commit 61707ca

Please sign in to comment.