Trac系统本身是一个专注于软件项目开发过程的管理系统,但我感兴趣的是自动集成测试。要把它打造成自动测试系统还需要一些Trac插件的配合。最重要的当然是bitten。Trac的插件都是标准的Python模块。Trac插件有两种安装方式:全局安装或者针对特定项目安装。针对特定项目安装trac插件可以在管理界面的plugins下操作,插件模块被安装到d:\trac\vmcepc\plugins目录下,只在该项目里加载。全局安装的方法跟标准的安装Python模块的方法相同,但是我这里由于没有通过正常方法安装Python,常用的"setup.py install"之类不能直接用。work around是你可以在另外一台机器上安装python,在它上面装trac插件,然后把相关目录拷贝到trac server的C:\Program Files\VisualSVN Server\trac\python\Lib\site-packages目录下,并在easy-install.pth中添加相应路径。如果你下载的trac插件是egg文件则更简单,直接把egg文件拷贝到C:\Program Files\VisualSVN Server\trac\python\Lib\site-packages目录,在easy-install.pth中添加相应路径即可。当然绝大部分trac插件还需要在trac.ini中做些配置才能工作。
- 安装bitten插件。bitten是Continuous Integration Server的核心,分为Build Slave和Build Master。Build Master做为Trac的插件和Trac系统集成,Build Slave做为Python模块安装在Build Machine上,可以从Trac Server上下载编译脚本(build receipt)自动进行Build。
- 下载地址:http://bitten.edgewall.org/
- 在Build Machine上安装Python 2.5,下载bitten并解压,进入bitten目录,运行"setup.py install"安装bitten,然后把C:\Program Files\VisualSVN Server\trac\python\Lib\site-packages\Bitten-0.6dev_r571-py2.5.egg(我目前用的版本)拷贝到Trac Server的C:\Program Files\VisualSVN Server\trac\python\Lib\site-packages目录,编辑easy-install.pth添加bitt模块路径:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
- 在d:\trac\vmcepc\conf\trac.ini中添加
bitten.* = enabled
- 在DOS下运行trac-admin更新配置:
现在Bitten插件安装好了,以admin身份登录Trac界面应该能看到导航栏多了"Build Status"一项。在Admin-->Permission中可以给用户设置权限。给anonymous加上BUILD_VIEW权限,这样匿名用户也能看到Build状态,另外可以给Build Engineer添加BUILD_ADMIN权限。
还有其它一些Trac插件也很有用:比如AccountManager可以通过web管理trac用户;TracDownloader可以发布软件;Discussion可以创建项目讨论组。
- 安装AccountManager插件。
- 下载地址:http://trac-hacks.org/wiki/AccountManagerPlugin。安装方法类似bitten。装完后编辑trac.ini:
- 在components节添加:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
- 配置account manager,用户密码管理使用HtPasswdStore,好处是整个Trac Server使用同一套用户/密码数据库:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
- 启用AccountManager插件后,要禁止掉缺省的http验证方式,同时由于bitten只支持http验证方式,因此要给它保留http验证方式。编辑C:\Program Files\VisualSVN Server\conf\httpd-custom.conf如下:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
- 运行trac-admin更新配置,并重启Visual SVN Server。
- 安装TracDownloader插件。
- 下载地址:http://trac-hacks.org/wiki/TracDownloaderPlugin。
- Downloader插件需要PyCaptcha和PIL和Clear Silver三个Python模块支持。得先安装这三个模块。
- 编辑trac.ini,在components节添加:
tracdownloader.admin.downloaderadminpage = enabled
tracdownloader.web_ui.downloadermodule = enabled
- 创建文件上传目录:d:\trac\vmcepc\download
- 配置Downloader,:
captcha_font_border = 2
captcha_font_size = 35
captcha_num_of_letters = 4
files_dir = d:\trac\vmcepc\download
no_captcha = true
no_quest = true
- 注意目前的Downloader插件在Trac 0.11上有点bug。要自己改一下代码,具体可参考这个Ticket。如果你装的是egg,把egg后缀改为zip,解压可得到源代码。编辑C:\Program Files\VisualSVN Server\trac\python\Lib\site-packages\TracDownloader-0.1-trac-0.11.egg\tracdownloader\web_ui.py。
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
- 运行trac-admin更新配置,并重启Visual SVN Server。
- 安装Discussion插件。 没有特别的地方,照着指南做就行。
- 下载地址:http://trac-hacks.org/wiki/DiscussionPlugin。
- 运行trac-admin更新配置。