Friday, March 16, 2012

Unit testing Google Cloud SQL with deployed app

Hi,

I'm currently testing methods that interact with the MySQL database
locally using GAEUnit (python27 runtime). However, if I deploy the app
to App Engine and try to run the tests on the cloud, GAEUnit cannot
use the rdbms service (error below). Normal interaction with the
deployed app works fine, i.e., the deployed app can talk to the Google
Cloud SQL instance.

Any ideas on how I can get access to the Google Cloud SQL instance via
GAEUnit within a deployed app?

Thanks!
Leo

Traceback (most recent call last):
File "test/test_models.py", line 144, in test_get_company_names
models.reset_test_database()
File "/base/data/home/apps/s~hd-analytics/1-0-dev.357531219904467056/models.py",
line 408, in reset_test_database
conn = rdbms.connect(instance=_INSTANCE_NAME, database=_TEST_DB)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/rdbms.py",
line 69, in connect
password=password)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 480, in __init__
self.OpenConnection()
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 503, in OpenConnection
response = self.MakeRequest('OpenConnection', request)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 606, in MakeRequest
response = self.MakeRequestImpl(stub_method, request)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms_apiproxy.py",
line 66, in MakeRequestImpl
apiproxy_stub_map.MakeSyncCall('rdbms', stub_method, request, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
line 301, in MakeSyncCall
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "rdbms"


--
Leonardo Trabuco, Postdoctoral fellow (Russell group)
CellNetworks, University of Heidelberg, Germany
http://www.russelllab.org/people/leo/

No comments:

Post a Comment