[4/4] Write test/README.md to help working with tests

Message ID 20200229000242.GA1596653@tsubame.mg0.fr
State New
Headers show
Series [1/4] TESTING: Step for installing the Python package | expand

Commit Message

Frédéric Mangano-Tarumi Feb. 29, 2020, 12:02 a.m. UTC
---
 test/README.md | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 test/README.md

Comments

Lukas Fleischer Feb. 29, 2020, 1:59 p.m. UTC | #1
On Sat, 29 Feb 2020 at 01:02:42, Frédéric Mangano-Tarumi wrote:
> ---
>  test/README.md | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>  create mode 100644 test/README.md

Merged with some minor modifications. Thanks!

Patch

diff --git a/test/README.md b/test/README.md
new file mode 100644
index 00000000..c48001d8
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,38 @@ 
+Running tests
+-------------
+
+To run all the tests, you may run `make check` under `test/`.
+
+For more control, you may use the `prove` command, which receives a directory or
+a list of files to run, and produces a report.
+
+Each test script is standalone, so you may run them individually. Some tests may
+receive command-line options to help debugging. See for example sharness’s
+documentation for shell test scripts:
+https://github.com/chriscool/sharness/blob/master/README.git
+
+### Dependencies
+
+For all the test to run, the following Arch packages should be installed:
+
+- pyalpm
+- python-alembic
+- python-bleach
+- python-markdown
+- python-pygit2
+- python-sqlalchemy
+- python-srcinfo
+
+
+Writing tests
+-------------
+
+Test scripts must follow the Test Anything Protocol specification:
+http://testanything.org/tap-specification.html
+
+Tests must support being run from any directory. They may use $0 to determine
+their location. Python scripts should expect aurweb to be installed and
+importable without toying with os.path or PYTHONPATH.
+
+Tests written in shell should use sharness. In general, new tests should be
+consistent with existing tests unless they have a good reason not to.