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: don't use Django fork for testing #527

Closed
wants to merge 13 commits into from
7 changes: 6 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ set -eo pipefail

cd github/python-spanner-django

python3.6 -m venv env
source env/bin/activate

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

Expand All @@ -36,6 +39,8 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version

python3.6 -m pip install --upgrade requests

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
Expand All @@ -57,7 +62,7 @@ pip3 install .
# Create a unique DJANGO_TESTS_DIR per worker to avoid
# any clashes with configured tests by other workers.
export DJANGO_TESTS_DIR="django_tests_$DJANGO_WORKER_INDEX"
mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch spanner-2.2.x https://github.com/timgraham/django.git $DJANGO_TESTS_DIR/django
mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch stable/2.2.x https://github.com/django/django.git $DJANGO_TESTS_DIR/django

# Install dependencies for Django tests.
sudo apt-get update
Expand Down
2 changes: 0 additions & 2 deletions django_spanner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
from .expressions import register_expressions
from .functions import register_functions
from .lookups import register_lookups
from .utils import check_django_compatability

__version__ = pkg_resources.get_distribution("django-google-spanner").version

check_django_compatability()
register_expressions()
register_functions()
register_lookups()
Expand Down
2 changes: 1 addition & 1 deletion django_test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e
# so that we can have multiple tests running without
# conflicting which changes and constraints. We'll always
# cleanup the created database.
TEST_DBNAME=${SPANNER_TEST_DB:-$(python3 -c 'import os, time; print(chr(ord("a") + time.time_ns() % 26)+os.urandom(10).hex())')}
TEST_DBNAME=${SPANNER_TEST_DB:-$(python3 -c 'import os, time; print(chr(ord("a") + time.time() % 26)+os.urandom(10).hex())')}
TEST_DBNAME_OTHER="$TEST_DBNAME-ot"
TEST_APPS=${DJANGO_TEST_APPS:-basic}
INSTANCE=${SPANNER_TEST_INSTANCE:-django-tests}
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 3 - Alpha"
dependencies = ["sqlparse >= 0.3.0", "google-cloud-spanner >= 1.8.0"]
dependencies = [
"sqlparse >= 0.3.0",
"google-cloud-spanner >= 1.8.0",
"requests >= 2.22.0",
]
extras = {}

BASE_DIR = os.path.dirname(__file__)
Expand Down