aurweb/test
Kevin Morris 6d08789ac1 add test_popupdate.py
We had no coverage over aurweb.scripts.popupdate. This test covers
all of its functionality.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-05 19:49:19 -07:00
..
scripts Makefile: run pytest units 2021-06-05 19:49:19 -07:00
Makefile Makefile: run pytest units 2021-06-05 19:49:19 -07:00
README.md Write test/README.md to help working with tests 2020-02-29 14:57:46 +01:00
setup.sh Makefile: run pytest units 2021-06-05 19:49:19 -07:00
sharness.sh Upgrade Sharness to 1.1.0 2019-11-23 12:25:23 -05:00
t1100-git-auth.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t1200-git-serve.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t1300-git-update.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2100-mkpkglists.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2200-tuvotereminder.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2300-pkgmaint.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2400-aurblup.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2500-notify.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2600-rendercomment.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
t2700-usermaint.t Makefile: run pytest units 2021-06-05 19:49:19 -07:00
test_exceptions.py add test_exceptions.py 2021-06-05 19:49:19 -07:00
test_popupdate.py add test_popupdate.py 2021-06-05 19:49:19 -07:00

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.