The TRAC system itself is a management system that focuses on the software project development process, but I am interested in automated integration testing. To create an automatic testing system, you also need some Trac plug-ins. The most important thing is bitten. TRAC plug-ins are standard Python modules. The TRAC plug-in can be installed globally or in a specific project. You can install the TRAC plug-in for a specific project under plugins on the management interface. The plug-in module is installed under the Directory D: \ TRAC \ vmcepc \ plugins and is only loaded in this project. The global installation method is the same as the standard Python module installation method. However, because I have not installed Python through the normal method, the commonly used "setup. py install" and so on cannot be directly used. Work around und: you can install python on another machine, install the TRAC plug-in on it, and copy the related directories to the C: \ Program Files \ visualsvn Server \ TRAC \ Python \ Lib \ Site-packages directory, and add the corresponding path to the easy-install.pth. If the TRAC plug-in you downloaded is an egg file, it is simpler to directly copy the egg file to the C: \ Program Files \ visualsvn Server \ TRAC \ Python \ Lib \ Site-packages directory, add a path to the easy-install.pth. Of course, most TRAC plug-ins still need to be configured in TRAC. ini to work.
- Install the bitten plugin. Bitten is the core of the continuous integration server and can be divided into build slave and build master. Build master is used as a plug-in for TRAC integration with the TRAC system. Build slave is installed on the build machine as a python module. You can download the build receipt script from the TRAC server to automatically build the program.
- : Http://bitten.edgewall.org/
- Install Python 2.5 On the build machine, download bitten, decompress it, go to the bitten directory, and run "setup. PY install "Install bitten, then put c: \ Program Files \ visualsvn Server \ TRAC \ Python \ Lib \ Site-packages \ Bitten-0.6dev_r571-py2.5.egg (my current version) copy the c: \ Program Files \ visualsvn Server \ TRAC \ Python \ Lib \ Site-packages directory to TRAC server and edit the easy-install.pth to add the bitt module path:
Import sys; SYS. _ Plen = Len (SYS. Path)
/Setuptools-0.6c8-py2.5.egg
/Genshi-0.5.1-py2.5-win32.egg
/Trac-0.11-py2.5.egg
/Bitten-0.6dev_r571-py2.5.egg
Import sys; new = sys. path [sys. _ Plen:]; del sys. path [sys. _ Plen:]; P = getattr (sys, '_ egginsert', 0); sys. path [P: p] = new; sys. _ egginsert = P + Len (new)
[Components]
Bitten. * = Enabled
- Run trac-admin in DOS to update the Configuration:
"C: \ Program Files \ visualsvn Server \ TRAC \ trac-admin.bat" D: \ TRAC \ vmcepc upgrade
Now that the bitten plug-in is installed, log on to the TRAC interface as admin and you will be able to see the "build status" option in the navigation bar. In admin --> permission, you can set permissions for users. Add the build_view permission to anonymous so that anonymous users can see the build status. In addition, you can add the build_admin permission to build engineer.
Other TRAC plug-ins are also useful: for example, accountmanager can manage TRAC users through the web; tracdownloader can publish software; discussion can create project discussion groups.
- Install the accountmanager plug-in.
- : Http://trac-hacks.org/wiki/accountmanagerplugin. The installation method is similar to bitten. Edit TRAC. ini after installation:
- In the components section, add:
[Components]
Acct_mgr.admin. * = Enabled
Acct_mgr.api. * = Enabled
Acct_mgr.db. * = Enabled
Acct_mgr.htfile. * = Enabled
Acct_mgr.http. * = Enabled
Acct_mgr.notification. * = Enabled
Acct_mgr.pwhash. * = Enabled
Acct_mgr.svnserve. * = Enabled
Acct_mgr.web_ui. * = Enabled
Trac. Web. Auth. loginmodule = disabled
- Configure account manager and use htpasswdstore for user password management. The advantage is that the entire TRAC server uses the same user/password database:
[Account-manager]
Authentication_url =
Force_passwd_change = true
Hash_method = htdigesthashmethod
Htdigest_realm =
Password_file = D: \ repos \ htpasswd
Password_store = htpasswdstore
- After the accountmanager plug-in is enabled, you must disable the default HTTP authentication method. bitten only supports HTTP authentication, so you must retain the HTTP authentication method for it. Edit c: \ Program Files \ visualsvn Server \ conf \ httpd-custom.conf as follows:
Loadmodule python_module "Trac/Python/mod_python_so.pyd"
Loadmodule authz_user_module bin/mod_authz_user.so
<Location/TRAC>
Sethandler mod_python
Pythoninterpreter main_interpreter
Pythonhandler TRAC. Web. modpython_frontend
Pythonoption tracenvparentdir D: \ TRAC
Pythonoption tracuriroot/TRAC
# Authname "trac"
# Authtype basic
# Authbasicprovider File
# Authuserfile "D:/repos/htpasswd"
# Require valid-user
</Location>
<Locationmatch "/TRAC/[^/] +/builds">
Authname "trac"
Authtype basic
Authbasicprovider File
Authuserfile "D:/repos/htpasswd"
Require valid-user
</Locationmatch>
- Run trac-Admin to update the configuration and restart visual SVN server.
- Install the tracdownloader plug-in.
- : Http://trac-hacks.org/wiki/tracdownloaderplugin.
- The downloader plug-in must be supported by Python modules pycaptcha, Pil, and clear silver. Install these three modules first.
- Edit TRAC. ini and add the following in the components section:
[Components]
Tracdownloader. admin. downloaderadminpage = Enabled
Tracdownloader. web_ui.downloadermodule = Enabled
- Create a file upload Directory: D: \ TRAC \ vmcepc \ Download
- Configure downloader ,:
[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
- Note that the current downloader plug-in has a bug in TRAC 0.11. Modify the code by yourself. For more information, see ticket. If you have installed egg, change the egg suffix to zip to decompress the file to obtain the source code. Edit c: \ Program Files \ visualsvn Server \ TRAC \ Python \ Lib \ Site-packages \ TracDownloader-0.1-trac-0.11.egg \ tracdownloader \ web_ui.py.
From trac.util.html import html
#
Def get_navigation_items (self, req ):
"Downloader isinstance visible if user hasattr got permission """
If Req. Perm. has_permission ('downloader _ download '):
Yield 'mainnav', 'downloader', HTML. A ('downloader', href = Req. href. downloader ())
# Yield 'mainnav', 'downloader', markup ('<a href = "% s"> downloader </a> ',
# Self. Env. href. downloader ())
- Run trac-Admin to update the configuration and restart visual SVN server.
- Install the discussion plug-in. Nothing special. Just follow the instructions.
- : Http://trac-hacks.org/wiki/discussionplugin.
- Run trac-Admin to update the configuration.