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

Run google-cloud-python system tests against new runtime images. #39

Merged
merged 13 commits into from
Nov 3, 2016
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ tests:
.PHONY: benchmarks
benchmarks:
make -C tests benchmarks

.PHONY: google-cloud-system-tests
google-cloud-system-tests:
make -C system_tests
2 changes: 2 additions & 0 deletions system_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data/
secrets.tar
22 changes: 22 additions & 0 deletions system_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM google/python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this assume you've just built an image called "google/python" locally?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to make this an invalid image name then. If you forgot to build your image or built it with a different name this would give you false positives, since google/python does exist on Dockerhub, but isn't updated at all IIRC.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's file a bug and fix that separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as #38


# Inject secrets
ADD data/ data/
ENV GOOGLE_APPLICATION_CREDENTIALS /app/data/cloud-python-runtime-qa-credentials.json
ENV GCLOUD_PROJECT cloud-python-runtime-qa

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you file an issue to figure out how to not hardcode these? (I'm thinking just passing them to docker run, but we can address it later).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as #42


# Get the source.
RUN git clone https://github.com/GoogleCloudPlatform/google-cloud-python.git
WORKDIR google-cloud-python

# Install tox for running the system tests
RUN pip install --upgrade tox

# List of system tests to run. Ideally would be all of them. But
# some of them get permission or other errors that are probably
# related to incomplete test setup.
ENV MODULES="datastore storage speech bigquery pubsub language translate monitoring bigtable"

# Run Python 2.7, 3.4 system tests
RUN GOOGLE_CLOUD_TESTS_API_KEY=$(cat /app/data/cloud-python-runtime-qa-api-key.txt) \
tox -e system-tests,system-tests3 -- ${MODULES}
7 changes: 7 additions & 0 deletions system_tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Use no-cache to prevent layer caching because there is a layer that does
# a `git clone` which can not be cached.
CACHE ?= --no-cache

.PHONY: all
all:
docker build $(CACHE) .
3 changes: 0 additions & 3 deletions tests/google-cloud-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ RUN pip install --upgrade tox
RUN git clone https://github.com/GoogleCloudPlatform/google-cloud-python.git
WORKDIR google-cloud-python

# Checkout the latest release.
RUN git checkout $(git describe --tags)

# Run Python 2.7 unit tests
RUN python2.7 scripts/run_unit_tests.py

Expand Down