是否可以在 Hudson 运行 GAE 测试?
我有一套使用 nose 调用的 App Engine 测试。当我从终端运行它们时,每个测试都会成功完成,并生成所有报告,例如覆盖率。
但是,如果我尝试从 Hudson 调用相同的命令,我会从覆盖范围中得到以下失败信息:
nose.failure.Failure.runTest (from Failure)
Parent module 'coverage' not loaded
-------------------- >> begin captured logging << --------------------
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/NoseGAE-0.1.7-py2.5.egg', '')
root: WARNING: Could not read datastore data from /tmp/nosegae.datastore
root: WARNING: Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named Image
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/gaetestbed-0.12dev_r30-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/WebTest-1.2.1-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/WebOb-0.9.8-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/PyYAML-3.09-py2.5-linux-x86_64.egg', '')
root: DEBUG: Could not import "strop": Disallowed C-extension or built-in module
--------------------- >> end captured logging << ---------------------
但是,如果我删除对覆盖范围的调用,我的测试仍然会失败。
我已成功使用 Hudson 运行 Python 项目。 GAE 有什么细微差别让我困惑吗?
I have a suite of App Engine tests that are called using nose. When I run them from a terminal, every test completes successfully and all reports, like coverage, are generated.
However, if I try to call the same command from Hudson, I get the following failure from coverage:
nose.failure.Failure.runTest (from Failure)
Parent module 'coverage' not loaded
-------------------- >> begin captured logging << --------------------
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/NoseGAE-0.1.7-py2.5.egg', '')
root: WARNING: Could not read datastore data from /tmp/nosegae.datastore
root: WARNING: Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: No module named Image
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/gaetestbed-0.12dev_r30-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/WebTest-1.2.1-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/WebOb-0.9.8-py2.5.egg', '')
root: INFO: zipimporter('/home/wraith/dev/projects/myapp/lib/python2.5/site-packages/PyYAML-3.09-py2.5-linux-x86_64.egg', '')
root: DEBUG: Could not import "strop": Disallowed C-extension or built-in module
--------------------- >> end captured logging << ---------------------
However, if I remove the call to coverage, my tests still fail.
I've succesfully run Python projects with Hudson. Is there a GAE nuance that's tripping me up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将手动运行它时的环境与使用 hudson 运行它时的环境进行比较。
我怀疑初始化发生在 .profile 文件内。当 Hudson 生成 shell 时不会调用它。因此,要么将此初始化放入环境初始化中,要么在受影响的构建步骤中手动调用 .profile 文件。
Compare the environments when you run it manually to when you run it using hudson.
I suspect that the initialization happens within the .profile file. That is not called when Hudson spawns a shell. So either you put this initialization into the environment initialization or you call the .profile file manually within the effected build steps.