comparison doc/developers.txt @ 8569:4006ddad6b8a

docs: add test/requirements.txt and doc same in developers.txt Help devs get test environment set up. Also document ruff as option with pylint and flake8.
author John Rouillard <rouilj@ieee.org>
date Mon, 13 Apr 2026 12:55:03 -0400
parents d913db0ab498
children ae1d77e99ad6
comparison
equal deleted inserted replaced
8568:052f4536fb85 8569:4006ddad6b8a
64 roundup-dev. If nothing else, this makes sure there's no 64 roundup-dev. If nothing else, this makes sure there's no
65 rude shocks. 65 rude shocks.
66 - write unit tests for changes you make (where possible), 66 - write unit tests for changes you make (where possible),
67 and ensure that all unit tests run before committing 67 and ensure that all unit tests run before committing
68 changes. 68 changes.
69 - run flake8_ or pylint_ over changed code. 69 - run ruff_, flake8_ or pylint_ over changed code.
70 - if you have direct commit access to the repository, 70 - if you have direct commit access to the repository,
71 subscribe to roundup-checkins to receive checkin 71 subscribe to roundup-checkins to receive checkin
72 notifications from the other developers with write access 72 notifications from the other developers with write access
73 to the source-code repository. 73 to the source-code repository.
74 74
75 The goal is to have no flake8 issues. Current code has 75 The goal is to have no ruff/flake8 issues. Current code has
76 complex functions, some long lines and use of mutable 76 complex functions, some long lines and use of mutable
77 objects in function signatures. Some third party code 77 objects in function signatures. Some third party code
78 (e.g. ZPT) vendored into the codebase has more issues. 78 (e.g. ZPT) vendored into the codebase has more issues.
79 79
80 The administrators of the project reserve the right to boot 80 The administrators of the project reserve the right to boot
226 html``. 226 html``.
227 227
228 Testing Notes 228 Testing Notes
229 ------------- 229 -------------
230 230
231 Use ``python -m pip install -r test/requirements.txt` to get the
232 minimal packages needed to run tests.
233
234 With the requirements installed, run the test suite using ``python -m
235 pytest test`` from the top level directory. This can take a while. In
236 CI it takes 15 minutes. On a 15 year old laptop it can take over an
237 hour and a half testing only anydbm and sqlite backends (not
238 including mysql/postgres).
239
231 Create tests for your changes. Also run the tests in reverse to try to 240 Create tests for your changes. Also run the tests in reverse to try to
232 identify test dependencies. You can do this by creating a 241 identify test dependencies. You can do this by creating a
233 ``conftest.py`` in the top of the source tree and include the 242 ``conftest.py`` in the top of the source tree and include the
234 following contents:: 243 following contents::
235 244
246 255
247 python3 -m pytest -v --testmon test 256 python3 -m pytest -v --testmon test
248 257
249 once over the whole test suite. Then subsequent calls will analyze the 258 once over the whole test suite. Then subsequent calls will analyze the
250 changed files/functions and run tests that cover those changes. 259 changed files/functions and run tests that cover those changes.
251
252 To run some tests (test_liveserver.py, test_indexer.py, ...) you need
253 to have some additional modules installed. These include:
254
255 * requests
256 * mock
257
258 If you are working with a docker container that is set up to execute
259 Python application and not for development, you will need to install
260 pytest.
261 260
262 Internationalization Notes 261 Internationalization Notes
263 -------------------------- 262 --------------------------
264 263
265 How stuff works: 264 How stuff works:
679 .. _Roundup source distribution: 678 .. _Roundup source distribution:
680 .. _Roundup binary distribution: 679 .. _Roundup binary distribution:
681 https://sourceforge.net/projects/roundup/files/ 680 https://sourceforge.net/projects/roundup/files/
682 .. _roundup-devel mailing list: 681 .. _roundup-devel mailing list:
683 https://sourceforge.net/projects/roundup/lists/roundup-devel 682 https://sourceforge.net/projects/roundup/lists/roundup-devel
683 .. _ruff: https://docs.astral.sh/ruff/installation/
684 .. _StarterTicket on https://issues.roundup-tracker.org: 684 .. _StarterTicket on https://issues.roundup-tracker.org:
685 https://issues.roundup-tracker.org/issue?@columns=title,id,activity,status&@sort=activity&@filter=status,keywords&status=-1,1,2&keywords=15&@dispname=Starter%20tickets 685 https://issues.roundup-tracker.org/issue?@columns=title,id,activity,status&@sort=activity&@filter=status,keywords&status=-1,1,2&keywords=15&@dispname=Starter%20tickets
686 .. _TAL: 686 .. _TAL:
687 .. _Template Attribute Language: 687 .. _Template Attribute Language:
688 https://pagetemplates.readthedocs.io/en/latest/history/TALSpecification14.html 688 https://pagetemplates.readthedocs.io/en/latest/history/TALSpecification14.html

Roundup Issue Tracker: http://roundup-tracker.org/