Skip to content
Snippets Groups Projects
README.test 2.63 KiB
Newer Older
+----------------------------------+
| Warden3 Server Test Suite README |
+----------------------------------+

Content

  A. Introduction
  B. Compatibility
  C. Dependencies
  D. Usage

-------------------------------------------------------------------------------
A. Introduction

The Warden Server Test Suite is a collection of high-level functional tests
(black-box testing), covering the most important interfaces of the Warden
Server.

-------------------------------------------------------------------------------
B. Compatibility

* The test suite, just like the Warden Server, is compatible with both Python2
  (tested on 2.7) and Python3 (tested on 3.6).
* Just like Warden Server, the test suite requires a local MySQL installation.
* It is safe to run the test suite on a production system. For testing,
  a database distinct from the default production one is used. Also, the user
  account used for accessing the testing database is set for local login only.
  To be extra safe, make sure not to name the production database `w3test`.

-------------------------------------------------------------------------------
C. Dependencies

In addition to the regular Warden Server dependencies, package `unittest2` is
required to run the test suite. It can be installed by running:
	pip install unittest2
or `pip3 install unittest2` for Python3 version
	or on Debian:
apt-get install python-unittest2
	or alternatively:
apt-get install python3-unittest2
for Python3 version.

An optional dependency is a code coverage measurement tool `Coverage.py`,
which can be installed by:
	pip install coverage
or `pip3 install coverage` for Python3 version
or on Debian:
	apt-get install python-coverage
or alternatively:
	apt-get install python3-coverage
for Python3 version.

-------------------------------------------------------------------------------
D. Usage

Before running the tests (for the first time), a DB user with required rights
must be created. An easy way to do it is:
	./test_warden_server.py --init
This will prompt for MySQL root password.

Standard usage for testing:
	./test_warden_server.py

Advanced usage:

	./test_warden_server.py --help
	usage: test_warden_server.py [-h] [-i] [-n]

	Warden3 Server Test Suite

	optional arguments:
	  -h, --help     show this help message and exit
	  -i, --init     Set up an user with rights to CREATE/DROP the
			 test database
	  -n, --nopurge  Skip the database purge after running the tests


Option -n (--nopurge) is meant for debugging purposes and test development, it
keeps the test database around for inspection after running the tests.

-------------------------------------------------------------------------------