NAME
OpenResty::Spec::TestSuite - Introduction to the OpenResty test suite
SYNOPSIS
$ make test -f dev.mk
# OR
$ prove -Ilib -r t
DESCRIPTION
OpenResty comes with a relatively big test suite.
Most of the test suite is organized by the Test::Base. The main test scaffold is in the t/OpenResty.pm file.
There's various different ways to run the suite.
The backend.type
option in the config file (i.e., etc/site_openresty.conf) determines which backend the server is using. Possible values are Pg
, PgFarm
, and PgMocked
. The default value is PgMocked
, which is a mocked-up version of the Pg
backend, so that users without a proper Pg setup (like CPAN testers) can still run the whole test suite. Please see OpenResty::Backend::PgMocked for more information.
The test_suite.use_http
option in the config file determines whether or not the test scaffold should use HTTP to test the server. When it is set to 1, the test harness will use LWP::UserAgent
to test the server specified by the test_suite.server
and test_suite.server2
options. If set to 0, the test suite will run directly in the same process of the OpenResty server by using a mocked-up CGI environment provided by WWW::OpenResty::Embedded.
Note that when test_suite.use_http
is set to 1, it's possible to test a remote OpenResty server.
AUTHOR
Agent Zhang (agentzh) <agentzh@yahoo.cn>