Build an automatic testing framework based on TRAC (1): Install TRAC

Source: Internet
Author: User
Tags server website

There has been an idea for a long time to build an integrated automated testing framework for our product development. The goals are as follows:

  • Automatically capture code from the code library
  • Automatic Build, installation package creation, and collection of DEBUG symbols
  • Automatic release
  • Automatically installed to the target device
  • Automatically run test cases and store test results
  • Test Cases and test results

It is somewhat similar to the concept of continuous integration but not exactly the same. It takes a lot of time to develop such a system on its own. The best way is to build it using existing tools. After some research, I found that TRAC is very compliant with my requirements: free, open-source, cross-platform, lightweight, highly scalable, and so on. I like these features very much. This article records some of my experience in installing and configuring a TRAC-based integration framework. I have been familiar with Python and TRAC for a short time and have limited understanding. If not, please point it out.

1. Install TRAC

I am new to open-source development tools such as Python, TRAC, Apache, and SVN. To reduce the difficulty, I didn't plan to install them in Linux from the very beginning, but I still had a lot of detours. At the beginning, I tried to use collabnet svn server + Python + TRAC + Apache. During integration with TRAC, I gave up because the svn library versions of Python and Apache were inconsistent. Later, visual svn server + trac was used, which is much more convenient. Visual SVN server is easy to install, integrates SVN and Apache, and has a GUI-based management interface.

  • Install visual SVN server. The latest version can be downloaded here. I use 1.6.3 and integrate Apache 2.2.9 and SVN 1.1.5. The installation is very simple. Make some choices on the custom Setup page, and the rest will be next. My options are:
    • Installation path: Default
    • Code repository path: D: "Repos
    • The Service port is HTTPS 8443.
    • Verification Method: SVN Verification
  • After installation is complete, start the visual SVN Server Management Interface and create a user name and code repository for the project:
    • Right-click "create new repository..." on repositories, enter the project name vmcepc, and check "create default structure ".
    • On users, right-click "create user..." and create the User Name Admin.

Now the svn server has been set up. Use a web browser to test whether it is successful. In the address bar, enter https: // localhost: 8443/SVN /. Note that the last slash is necessary. In addition, forefox 3.0.x seems to have a bug and cannot "add exception" for self-made certificates. Therefore, if the svn server enables https, it cannot be connected normally in Firefox 3.0.x. IE and Firefox 3.1 are all correct.

  • Install TRAC 0.11. Because python is not installed, the installation method described on the TRAC homepage is not applicable. Fortunately, the visual SVN server website provides a work around und. For detailed steps, see here:
    • Download TRAC 0.11 for visual SVN Server
    • Pressurize the TRAC directory in the installation package to c: \ Program Files \ visualsvn Server \
    • Create Directory D: \ TRAC
    • Initialize the trac environment for the vmcepc project. Except for "path to repository", you can specify all the other settings by default. You can change these settings later. Run the following command in the DOS window:
"C: \ Program Files \ visualsvn Server \ TRAC \ trac-admin.bat" D: \ TRAC \ vmcepc initenv
      • Project name: vmcepc
      • Path to Repository: D: \ repos \ vmcepc
    • Add Admin to TRAC admin and run the following command in the DOS window:
"C: \ Program Files \ visualsvn Server \ TRAC \ trac-admin.bat" D: \ TRAC \ vmcepc permission Add Admin trac_admin
    • Edit c: \ Program Files \ visualsvn Server \ httpd-wrapper.bat and add a line at the beginning of the file: Set pythonhome = % ~ Dp0 \ TRAC \ Python
    • Add these settings to the C: \ Program Files \ visualsvn Server \ conf \ httpd-custom.conf:
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>

 

In this way, the TRAC server is ready. Enter the address: https: // localhost: 8443/TRAC/in the browser /. If "available projects" is listed, it indicates that the operation is successful. If an error occurs, open event viewer in Windows to view the log information of the visualsvn server.

In addition, if you want to configure TRAC for multiple projects, you can create a general configuration file TRAC. INI, put it in D: \ TRAC. INI, and then in the TRAC. reference it in the INI file:

#-*-Coding: UTF-8 -*-

[Inherit]
Plugins_dir = D: \ TRAC. ini

[Project]
Descr = Windows CE for VMware
Name = vmcepc

[TRAC]
Repository_dir = D: \ repos \ vmcepc

 


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 c: \ TRAC
Pythonoption tracuriroot/TRAC
Authname "trac"
Authtype basic
Authbasicprovider File
Authuserfile "C:/repositories/htpasswd"
Require valid-user
</Location>

Or this text if you use Windows Authentication:

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 c: \ TRAC
Pythonoption tracuriroot/TRAC

Authname "trac"
Authtype basic
Authbasicprovider visualsvn
Require valid-user
</Location>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.