背景:
TestRail為一個(gè)測試用例管理平臺(tái)潮瓶,其功能簡單大方陶冷,但足夠滿足項(xiàng)目的測試用例庫使用。
TestRail需要LAMP環(huán)境毯辅,官網(wǎng)提供了完整的LAMP環(huán)境配置文檔埂伦,可參考:https://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel
LAMP部署精簡就是下面幾個(gè)步驟:
Install Apache
yum install httpd httpd-devel
/etc/init.d/httpd start
Install MySQL Database Server
yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql> FLUSH PRIVILEGES;
Install PHP5 Scripting Language
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd restart
后面的phpMyAdmin,Webmin不是必須的思恐,可以不安裝沾谜。
TestRail安裝步驟胀莹,參考官網(wǎng)提供的文檔:http://docs.gurock.com/testrail-admin/installation-unix
創(chuàng)建數(shù)據(jù)庫:
mysql>CREATE DATABASE testrail DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql>CREATE USER 'testrail'@'127.0.0.1' IDENTIFIED BY 'zyLC021';
mysql>GRANT ALL ON testrail.* TO 'testrail'@'127.0.0.1';
mysql>FLUSH PRIVIGELES;
備注:
127.0.0.1 不能用 localhost 代替基跑,否則在TestRail Setup Wizard 第二步會(huì)報(bào)錯(cuò),數(shù)據(jù)庫無法連接描焰,如下圖:
Installing TestRail
To install the actual application, just upload and extract the TestRail installation archive to your web server and copy the files to your web server'swwwdirectory (Centos: ?it's/var/www/html/testrail).
#cd /opt/
#mkdir testrail
#cd testrail
#mkdir attachments
#mkdir reports
#chmod apache:apache /opt/testrail/attachments
#chmod apache:apache /opt/testrail/reports
#mkdir /var/www/html/testrail/logs
#chmod apache:apache /var/www/html/testrail/logs
開始安裝:
Activating the TestRail background task
The last step of the TestRail installation consists of installing the background task. The background task is responsible, among other things, for sending out email notifications for test changes if this feature is enabled. The background task needs to be triggered in regular intervals to do its work and the easiest way to do this under Unix-based systems is to add acronjob. If you are using an?OS?X based server system, you might want to consider using alaunchd scriptinstead.
Before scheduling the task, you can verify that the background task can be successfully started by running it manually from the command line:
$php /var/www/html/testail/task.php
Background task on Unix/Linux
We usecronto trigger the background task on Unix/Linux systems periodically. Before scheduling the task, you can verify that it can be successfully started by running it manually from the command line:
$ php /var/www/testrail/task.php
The TestRail background task automatically detects if it's already running, so it's best to trigger the task in very short intervals (such as every minute) for best results. To do this, make sure cron is installed on your system and create a file/etc/cron.d/testrailwith the following content:
* * * * * www-data /usr/bin/php /var/www/testrail/task.php
The cron job needs the PHP command line interface, which might already be installed on your system. You can test this by executing thephp -vcommand. If it's not already installed, install thephp5-clipackage or equivalent with your platform's package manager.
Please note:Also make sure to add the above mentioned PHP extensions to thephp-cli's PHP.ini if it doesn't use the web server's PHP.ini file. E.g., on Ubuntu systems, also add theioncubeextension to/etc/php5/cli/php.ini.