From Fedora Project Wiki

Line 22: Line 22:


= Installation =
= Installation =
As of release 3.8.5-5 please refer to https://fedorahosted.org/nitrate/wiki/Installation
Here are the old instructions for installing:
How to install Nitrate on your computer, please follow this steps:
== Create a development environment ==
Nitrate is standard Django app. The deployment method is the same as [http://docs.djangoproject.com/en/dev/howto/deployment/ others].<br/>
Before you starting to installation, please prepare the requirements as following:
=== Requirements ===
*[http://www.python.org/ Python] >=2.4
*[http://www.djangoproject.com/ Django] = 1.2.3
*[http://sourceforge.net/projects/mysql-python/ Python-MySQL]
*[https://fedorahosted.org/kobo/ Kobo]
*[http://koji.fedoraproject.org/koji/packageinfo?packageID=5539 Python-kerberos]
Recommendations for development
*[https://github.com/robhudson/django-debug-toolbar Django debug toolbar]
=== Download Source Code ===
You can easy to get the latest code with git:
<pre>
# git clone git://git.fedorahosted.org/nitrate.git
</pre>
=== Generate the Configuration File ===
We recommend you to create a new settings file based on nitrate/tcms/settings.py file for develop environment or production environment. As you can see the settings.py file contains default/safest configurations, create another settings file contains the configurations you private will be more better than modify the default settings.
At this moment, I presume the file you write named 'dev_settings.py', place the file to the same path as settings.py.
You may need to modify following contents, for more, reference the settings.py:
<pre>
# Database settings
DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql',
                                # 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'dev.db'        # Or path to database file if using sqlite3.
DATABASE_USER = ''              # Not used with sqlite3.
DATABASE_PASSWORD = ''          # Not used with sqlite3.
DATABASE_HOST = ''              # Set to empty string for localhost.
                                # Not used with sqlite3.
DATABASE_PORT = ''              # Set to empty string for default.
                                # Not used with sqlite3.
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Asia/Shanghai'
# Mail settings
# Set the default send mail address
# See http://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_HOST = ''
EMAIL_PORT = 25
EMAIL_FROM = 'noreply@foo.com'
EMAIL_SUBJECT_PREFIX = '[TCMS] '
# First run - to detemine need port user or not.
FIRST_RUN = True
# The URLS will be list in footer
# Example:
#FOOTER_LINKS = (
#  ('mailto:nitrate-dev-list@example.com', 'Contact Us'),
#  ('mailto:nitrate-admin@example.com', 'Request Permission'),
#  ('http://foo.com', 'foo')
#)
FOOTER_LINKS = ()
</pre>
=== Initial database schema ===
Database is required by Nitrate(and all of Django apps). The Django ORM supports many database backends, we recommend you to use MySQL(In fact it's a bug so far).<br/>
We provided two SQL file for usage.<br/>
Empty testopia dumps file: [https://fedorahosted.org/nitrate/browser/trunk/nitrate/docs/testopia-dump-blank.sql https://fedorahosted.org/nitrate/browser/trunk/nitrate/docs/testopia-dump-blank.sql]<br/>
Nitrate upgrade dumps file: [https://fedorahosted.org/nitrate/browser/trunk/nitrate/docs/mysql_initial.sql https://fedorahosted.org/nitrate/browser/trunk/nitrate/docs/mysql_initial.sql]<br/>
First you need define the mysql database configuration in dev_settings.py file. Then download and import the database dumps files, I presume the database named 'nitrate'.
<pre>
$ mysql -u [db_username] -p nitrate < testopia-dump-blank.sql
$ mysql -u [db_username] -p nitrate < mysql_initial.sql
</pre>
Then use the django-admin.py syncdb to initial the data.
<pre>
$ export DJANGO_SETTINGS_MODULE=tcms.dev_settings
</pre>
If you are install from git source you need to define the env as following: $ export PYTHONPATH=[nitrate_download_path]/nitrate/trunk/nitrate/
<pre>
$ django-admin.py syncdb
</pre>
If you got some errrors report, just try to type upon commands and run again.
=== The data initialization ===
The initial data including the first super user, site definition, they will be needed by the server running.
==== Add the super user ====
Simple type following commands in shell should be OK
<pre>
$ django-admin.py createsuperuser
Username: [You login user name]
E-mail address: [Your email]
Password: [Your password]
Password (again): [Your password again]
Superuser created successfully.
</pre>
For more information access the [http://docs.djangoproject.com/en/dev/topics/auth/#creating-superusers User authentication in Django].
==== Add the site definition ====
Here you need some python skills, just type like following:
<pre>
$ python
>>> from django.contrib.sites.models import Site
>>> Site.objects.create(name="example.com")
</pre>
Replace the "example.com" to your web server domain name, the definition will be used in mailing system.<br/>
For more information access the [http://docs.djangoproject.com/en/dev/ref/contrib/sites/ Django site framework].
=== Start the Django app ===
After upon steps completed, now you can try to start the web server built-in Django to testing the app running.<br/>
Define the envs again if you does not completed the steps, it should confirm the envs exist in system before start the server.
<pre>
$ cd [nitrate_download_path]/nitrate/trunk/nitrate/
$ export DJANGO_SETTINGS_MODULE=tcms.dev_settings
$ export PYTHONPATH=[nitrate_download_path]/nitrate/trunk/nitrate/
$ django-admin.py runserver
</pre>
Then try to use web browser to open [http://localhost:8000/ http://localhost:8000/] to see the web service working status.
=== Basic admin works  ===
After your typed your super user user name and password in the browser, you will see the "Home page" of Nitrate, there are some configuration needed by you enter in the admin system.
==== Bug Tracker Initialization ====
Access [http://localhost:8000/admin/testcases/testcasebugsystem/ http://localhost:8000/admin/testcases/testcasebugsystem/] on your server, and add a new bug tracker URL to Nitrate, it's required by execute run feature.<br>
Click the 'Add test case bug system' link in the top of the table, type the name and description as your wish, then type the 'Url reg exp' like 'https://bugzilla.redhat.com/show_bug.cgi?id=%s', The '%s' will be replaced by bug ID.<br/>
Nitrate supported multiple bug tracker system backend, the only requirement is the bug tracker supports access the bug with bug ID.
==== User Groups Initialization ====
Access http://localhost:8000/admin/auth/group/ on your server, you need to create the group need by tester at least, apply all of add/change permissions(The permissions starts with 'auth_' also be excluded) to the group.
Then when a new memember join the system, just apply the tester group he will get the minimal permissions to create/update test plan/case/run and execute the run.
You also can create a group named 'Administrator', apply the people management permission(The permissions name starts with 'auth_') to it, allocate some trusted people to the group for the user management work.


== Deploy with Apache ==
== Deploy with Apache ==


We recommend to use the WSGI method, it saves resources and very fast. The sample is located at: https://fedorahosted.org/nitrate/browser/trunk/nitrate/contrib/conf/nitrate-httpd.conf
A workable example of installation in Red Hat Enterprise Linux 6 is supplied in the project's docmentation. Refer to [http://nitrate.readthedocs.org/en/latest/installing_in_rhel.html Installing nitrate on RHEL6 with Apache and MySQL]
 
Take care the config file enabled mod_auth_kerb authentication, you may need to comment the settings starts with 'Auth' and 'Krb' at first.
 
Then place the file to /etc/httpd/conf.d/ and modify the files path from default to you specific should be OK.
 
=== Deploy with mod_auth_kerb ===
 
First you need to request the keytab file and a /etc/krb5.conf from your KDC administrators at first, place the keytab file to /etc/httpd/conf/httpd.keytab and place the krb5.conf file into /etc.
 
Then modify the Nitrate product settings file. I recommend you to create another settings file inherit from dev_settings.py to disable DEBUG options and other configuration settings you need in production environment, I presume new settings file named 'product_settings.py' here.
 
Then modify the authentication backends settings in the file as following:
<pre>
# Authentication backends
 
AUTHENTICATION_BACKENDS = (
    'tcms.core.contrib.auth.backends.ModAuthKerbBackend',
)
</pre>
Then restart the web server should be done.


== Deploy with Nginx ==
== Deploy with Nginx ==
Line 211: Line 31:
With benchmark, we found Nginx + FCGI is faster than Apache + Mod_python, To use the Nginix to deploy the Nitrate will be a good idea for production environment.
With benchmark, we found Nginx + FCGI is faster than Apache + Mod_python, To use the Nginix to deploy the Nitrate will be a good idea for production environment.


The configuration sample located at: https://fedorahosted.org/nitrate/browser/trunk/nitrate/contrib/conf/nitrate-nginx.conf
The configuration sample located at: https://github.com/Nitrate/Nitrate/blob/develop/contrib/conf/nitrate-nginx.conf


The file is very initial, and patches are welcome.
The file is very initial and probably out-dated. Patches are welcome.


= Contact us =
= Contact us =

Revision as of 09:32, 20 December 2014

Nitrate

Nitrate a new test case management system, it's written in Python and uses the Django web framework.

The TCMS provides:

  • Managers with a source of information on planning, cases and execution status.
  • Reproducibility across planning, cases and execution.
  • Audit traceability.
  • Increased productivity - Associates are able to identify and work on gaps in product coverage.
  • Fully functional XML-RPC interface.
  • Multiple authentication backends.

"If it is not in the TCMS then we do not do it", and the converse: "If we do it then it is in the TCMS".
That motto has been the paradigm driving the development of the TCMS. The development team has created a canonical source of information about testing that is useful to both managers and QE Associates.

Source Code

We are using "git" to manage our source code. An excellent tutorial on the use of git can be found at Git-Scm.

The source code is hosted in Github.

Installation

Deploy with Apache

A workable example of installation in Red Hat Enterprise Linux 6 is supplied in the project's docmentation. Refer to Installing nitrate on RHEL6 with Apache and MySQL

Deploy with Nginx

With benchmark, we found Nginx + FCGI is faster than Apache + Mod_python, To use the Nginix to deploy the Nitrate will be a good idea for production environment.

The configuration sample located at: https://github.com/Nitrate/Nitrate/blob/develop/contrib/conf/nitrate-nginx.conf

The file is very initial and probably out-dated. Patches are welcome.

Contact us