If there is a running web service that needs to be tested and
creating a test loader with
either inconvenient or overkill it is possible to run YAML test
files directly from the command line with the console-script
gabbi-run. It accepts YAML on
stdin or as multiple file
arguments, and generates and runs tests and outputs a summary of
gabbi-run [host[:port]] < /my/test.yaml
gabbi-run http://host:port < /my/test.yaml
To test with one or more files the following command syntax may be used:
gabbi-run http://host:port -- /my/test.yaml /my/other.yaml
The filename arguments must come after a
-- and all
other arguments (host, port, prefix, failfast) must come
If files are provided, test output will use names including the name of the file. If any single file includes an error, the name of the file will be included in a summary of failed files at the end of the test report.
To facilitate using the same tests against the same application mounted
in different locations in a WSGI server, a
prefix may be provided
as a second argument:
gabbi-run host[:port] [prefix] < /my/test.yaml
or in the target URL:
gabbi-run http://host:port/prefix < /my/test.yaml
The value of prefix will be prepended to the path portion of URLs that are not fully qualified.
Anywhere host is used, if it is a raw IPV6 address it should be
https is used in the target, then the tests in the provided
YAML will default to
--failfast argument is provided then
exit after the first test failure.
--verbose with a value of
to turn on verbosity for all tests being run.