diff --git a/.gitignore b/.gitignore index 0e9dea3..b1a322d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ __pycache__ cloud-spanner-emulator* emulator_main gateway_main +.spanner_emulator/** diff --git a/spanner_emulator/.keep b/spanner_emulator/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..67f2a4d --- /dev/null +++ b/tox.ini @@ -0,0 +1,28 @@ +# tox (https://tox.readthedocs.io/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py36, py37, py38 + +[testenv] +deps = + absl-py + google-api-core + google-cloud-spanner >= 1.17.1 + frozendict + portpicker + pytest +allowlist_externals = + wget + tar + chmod +setenv = + SPANNER_EMULATOR_VERSION=1.2.0 + SPANNER_EMULATOR_BINARY_PATH=.spanner_emulator/emulator_main +commands = + wget https://storage.googleapis.com/cloud-spanner-emulator/releases/{env:SPANNER_EMULATOR_VERSION}/cloud-spanner-emulator_linux_amd64-{env:SPANNER_EMULATOR_VERSION}.tar.gz -P .spanner_emulator/ + tar zxvf .spanner_emulator/cloud-spanner-emulator_linux_amd64-{env:SPANNER_EMULATOR_VERSION}.tar.gz -C .spanner_emulator/ + chmod u+x .spanner_emulator/gateway_main .spanner_emulator/emulator_main + pytest