lslatr
lslatr

Reputation: 31

error when running nosetests --with-gae with google cloudsdk installed

nosetests --with-gae fails when running under the new cloud sdk. It's looking for dev_appserver.py but looks like it's been renamed to old_dev_appserver.py. I can hack a fix but is there an existing solution? Don't see one on the internets...

$ nosetests --with-gae --gae-lib-root=~/google-cloud-sdk/platform/google_appengine
Traceback (most recent call last):
  File "/Users/edahl/src/gmj/bin/nosetests", line 9, in <module>
    load_entry_point('nose==1.3.4', 'console_scripts', 'nosetests')()
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/core.py", line 145, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/config.py", line 346, in configure
    self.plugins.configure(options, self)
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/plugins/manager.py", line 284, in configure
    cfg(options, config)
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/Users/edahl/src/gmj/lib/python2.7/site-packages/nosegae.py", line 80, in configure
    from dev_appserver import fix_sys_path
ImportError: No module named dev_appserver

Here's what I see in my google_appengine directory...

$ ls ~/google-cloud-sdk/platform/google_appengine/
BUGS            api_server.py       godoc           php
LICENSE         backends_conversion.py  gofmt           php_cli.py
README          bulkload_client.py  google          remote_api_shell.py
RELEASE_NOTES       bulkloader.py       google_sql.py       run_tests.py
RELEASE_NOTES.go_sdk    demos           goroot          tools
VERSION         download_appstats.py    lib         wrapper_util.py
_php_runtime.py     gen_protorpc.py     new_project_template    wrapper_util.pyc
_python_runtime.py  goapp           old_dev_appserver.py

The old /usr/local/google_appengine directory seems to be deprecated... but if I use it I can get things working.

[update]

a manual unittest setup using old_dev_appserver like this does work:

def main(sdk_path, test_path):
    sys.path.insert(0, sdk_path)
    import old_dev_appserver
    old_dev_appserver.fix_sys_path()
    suite = unittest.loader.TestLoader().discover(test_path)
    unittest.TextTestRunner(verbosity=2).run(suite)

Upvotes: 1

Views: 1065

Answers (4)

naturallyfoster
naturallyfoster

Reputation: 411

According to the NoseGAE docs the default location it checks for the google-cloud-sdk is in /usr/local/google_appengine.

Moving the google-cloud-sdk folder to /usr/local/google_appengine/google-cloud-sdk/ fixed this issue for me.

http://farmdev.com/projects/nosegae/

Upvotes: 0

lslatr
lslatr

Reputation: 31

In the end this was pretty silly... needed to expand the user path that's passed to --gae-lib-root

nosetests --with-gae --gae-lib-root=/Users/USERNAME/google-cloud-sdk/platform/google_appengine

Upvotes: 2

minou
minou

Reputation: 16563

On my mac, I get this same error:

  1. After an app engine update
  2. But before I've run the GoogleAppEngineLauncher app since the update

The easy solution is just launch GoogleAppEngineLauncher. This updates the sym links that nosetests needs.

Hopefully that works for you.

Upvotes: 1

Bardia D.
Bardia D.

Reputation: 693

You might need to set your path to the lib folder under that directory:

--gae-lib-root=~/google-cloud-sdk/platform/google_appengine/lib

But you might also need to set your PATH variable so it includes the /bin as well:

export PATH=$PATH:~/google-cloud-sdk/platform/google_appengine/bin

If neither of those work for you, try adding the without sandbox switch:

nosetests -s -v --with-gae --without-sandbox 

Upvotes: 0

Related Questions