plone testswarm集成包
collective.testswarm的Python项目详细描述
在testswarm实例上运行javascript测试作业的测试层
这将使用plone.app.testing.layers.plone_zserver作为启动plone实例的基础。可以从buildout配置测试作业,也可以使用shell环境变量重写测试作业。在调度作业之后,plone实例将一直运行,直到达到超时为止。尚未从testswarm实例收集结果。
如何将项目配置为使用collective.testswarm
首先,您需要设置一个testswarm实例:https://github.com/jquery/testswarm
添加一个用户(例如tsuser)并找出该用户的auth密钥(mysql:select auth from users where name=“tsuser”;)。这是测试可用于添加测试作业的用户帐户。使用下面介绍的构建部分中的这些详细信息,或将它们作为环境变量(大写)传递给测试运行程序:
$ TS_USER=myuser ./bin/test
your.product/setup.py:
extras_require={ 'test': 'collective.testswarm' }
buildout.cfg:
[test] recipe = zc.recipe.testrunner eggs = your.product [test] environment = testswarm-instance [testswarm-instance] ts_url = http://testswarm ts_user = tsuser ts_auth = asdf1234asdf #select auth from users where name = "tsuser"; ts_job_name = Test collective.testswarm ts_urls = http://localhost:55555/plone/example-qunit-suite ts_suites = QUnit example ts_browsers = popularbeta ts_max_jobs = 1 ZSERVER_HOST = 55555 ZSERVER_PORT = localhost
如何使用collective.testswarm层
your.product/your/product/tests/layers.py:
from plone.app.testing import PloneSandboxLayer from collective.testswarm.layers import TESTSWARM_LAYER class YourProductLayer(PloneSandboxLayer): defaultBases = (TESTSWARM_LAYER, ) def setUpPloneSite(self, portal): self.applyProfile(portal, 'your.product:testswarm') YOURPRODUCT_LAYER = YourProductLayer()
your.product/your/product/tests/test_swarm.py:
import unittest2 as unittest from layers import YOURPRODUCT_LAYER class TestSwarmTestCase(unittest.TestCase): layer = YOURPRODUCT_LAYER def test_your_product_swarm(self): """ You need one test for the testrunner to sniff out """
collective.testswarm变更日志
0.3(2011-07-24)
- 在setup.py[cillian]中删除我的名字的重音
0.2(2011-07-24)
- 没什么变化,只是想推动另一个版本来避免 作者字段上的unicodeencodeerror[cillian]
0.1(2011-07-24)
- 初始版本,只用于运行自己的测试 [西莉安]
贡献者
- Cillian de Roiste(Syslab.com股份有限公司)