安装funkload、运行测试和生成报告变得非常简单
项目描述
collective.recipe.funkload 是一个简单易用的食谱,允许轻松运行 funkload 测试并生成相关报告。运行 ./bin/funkload bench 将在 buildout 中运行所有 funkload 测试,并自动生成它们的 html 报告。报告生成需要 gnuplot,目前还没有干净地禁用此功能的方法。报告和相关 xml 存储在您 part 中 location 指定的路径(默认为 ./var/funkload)。您还可以使用 report_destination 在不同的目录中生成报告。
示例用法
为了使其发挥魔力,您需要为要运行的测试设置一个基本 URL,您的 buildout part 将类似于以下内容
>>> write('buildout.cfg', ... """ ... [buildout] ... parts = test1 ... index = http://pypi.python.org/simple ... [test1] ... recipe = collective.recipe.funkload ... url = 127.0.0.1:8080 ... """)
运行该 buildout 会给我们一个 funkload 脚本
>>> print 'start\n', system(buildout) start ... Generated script '/sample-buildout/bin/funkload'.
该脚本将主机传递到食谱中的子命令处理器
>>> import os >>> script = os.path.join(sample_buildout,'bin','funkload') >>> print open(script,'r').read() #!...url="127.0.0.1:8080"...
如果您没有指定 URL,buildout 将会失败
>>> write('buildout.cfg', ... """ ... [buildout] ... parts = test1 ... index = http://pypi.python.org/simple ... [test1] ... recipe = collective.recipe.funkload ... """)>>> print 'start\n', system(buildout) start ... KeyError: 'You must specify an address to test'
记录
从版本 0.3 开始,您现在可以使用 record 更快地创建 funkload 测试
>>> print system('bin/funkload') Usage: bench: Launch a FunkLoad unit test as load test. record: Launch a TCPWatch proxy and record activities, then output a FunkLoad script or generates a FunkLoad unit test if test_name is specified. report: Generate a report from the most recent bench result test: Launch a FunkLoad unit test. <BLANKLINE>
变更历史
HISTORY
0.3.1 - 2010-04-19
为 PloneFLTestCase 添加示例用法 [amleczko]
将 collective.funkload 锁定到版本>0.2 [amleczko]
0.3 - 2009-11-23
启用 funkload 的测试记录器 [amleczko]
更新 doctests [amleczko]
0.2 - 2009-11-01
启用 funkload bench 以在已发布的 eggs 中运行测试 [toutpt]
0.1 - 2009-08-09
初始发布
添加 funkload 脚本 [evilbungle]
添加自动报告生成 [evilbungle]
贡献者
Alan Hoey, [evilbungle] Tom Lazar, [tomster] Sasha Vincic, [sashav] JeanMichel FRANCOIS [toutpt] Andrew Mleczko, [amleczko]
下载
项目详情
collective.recipe.funkload-0.3.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c187c6bce9d28cb14d240a4700bd981bb94bdd4fcc9355316d6739dfe466c2d7 |
|
MD5 | 75155a6ffeb758e2fbbdcb90e7c666ce |
|
BLAKE2b-256 | 7c49db48d585a9d858a2efb980ec0377189877a510ac94f0ec67039bc30a722a |