mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Bundle tests with applications
- For each application, add ./tests directory and __init__.py file within it. - Modify test controllers (coverage.py, runtests.py) to find the new test directories for testing and coverage analysis. - Move existing application-specific test modules (test_pagekite.py) to the newly created directories.
This commit is contained in:
parent
f91be5a4f9
commit
d64ce6cc01
0
plinth/modules/apps/tests/__init__.py
Normal file
0
plinth/modules/apps/tests/__init__.py
Normal file
0
plinth/modules/config/tests/__init__.py
Normal file
0
plinth/modules/config/tests/__init__.py
Normal file
0
plinth/modules/deluge/tests/__init__.py
Normal file
0
plinth/modules/deluge/tests/__init__.py
Normal file
0
plinth/modules/diagnostics/tests/__init__.py
Normal file
0
plinth/modules/diagnostics/tests/__init__.py
Normal file
0
plinth/modules/dynamicdns/tests/__init__.py
Normal file
0
plinth/modules/dynamicdns/tests/__init__.py
Normal file
0
plinth/modules/firewall/tests/__init__.py
Normal file
0
plinth/modules/firewall/tests/__init__.py
Normal file
0
plinth/modules/first_boot/tests/__init__.py
Normal file
0
plinth/modules/first_boot/tests/__init__.py
Normal file
0
plinth/modules/help/tests/__init__.py
Normal file
0
plinth/modules/help/tests/__init__.py
Normal file
0
plinth/modules/ikiwiki/tests/__init__.py
Normal file
0
plinth/modules/ikiwiki/tests/__init__.py
Normal file
0
plinth/modules/mumble/tests/__init__.py
Normal file
0
plinth/modules/mumble/tests/__init__.py
Normal file
0
plinth/modules/networks/tests/__init__.py
Normal file
0
plinth/modules/networks/tests/__init__.py
Normal file
0
plinth/modules/owncloud/tests/__init__.py
Normal file
0
plinth/modules/owncloud/tests/__init__.py
Normal file
0
plinth/modules/packages/tests/__init__.py
Normal file
0
plinth/modules/packages/tests/__init__.py
Normal file
0
plinth/modules/pagekite/tests/__init__.py
Normal file
0
plinth/modules/pagekite/tests/__init__.py
Normal file
0
plinth/modules/privoxy/tests/__init__.py
Normal file
0
plinth/modules/privoxy/tests/__init__.py
Normal file
0
plinth/modules/roundcube/tests/__init__.py
Normal file
0
plinth/modules/roundcube/tests/__init__.py
Normal file
0
plinth/modules/system/tests/__init__.py
Normal file
0
plinth/modules/system/tests/__init__.py
Normal file
0
plinth/modules/tor/tests/__init__.py
Normal file
0
plinth/modules/tor/tests/__init__.py
Normal file
0
plinth/modules/transmission/tests/__init__.py
Normal file
0
plinth/modules/transmission/tests/__init__.py
Normal file
0
plinth/modules/upgrades/tests/__init__.py
Normal file
0
plinth/modules/upgrades/tests/__init__.py
Normal file
0
plinth/modules/users/tests/__init__.py
Normal file
0
plinth/modules/users/tests/__init__.py
Normal file
0
plinth/modules/xmpp/tests/__init__.py
Normal file
0
plinth/modules/xmpp/tests/__init__.py
Normal file
@ -37,7 +37,10 @@ import time
|
||||
SOURCE_DIRS = ['plinth'] + glob.glob('plinth/modules/*')
|
||||
|
||||
# Files to exclude from coverage analysis and reporting
|
||||
FILES_TO_OMIT = ['plinth/tests/*.py']
|
||||
FILES_TO_OMIT = [
|
||||
'plinth/tests/*.py',
|
||||
'plinth/modules/*/tests/*.py'
|
||||
]
|
||||
|
||||
# Location of coverage HTML report files
|
||||
COVERAGE_REPORT_DIR = 'plinth/tests/coverage/report'
|
||||
|
||||
@ -37,9 +37,14 @@ def run_tests(pattern=None, return_to_caller=False):
|
||||
test_runner = TestRunner()
|
||||
|
||||
if pattern is None:
|
||||
pattern = 'plinth.tests'
|
||||
pattern_list = [
|
||||
'plinth/tests',
|
||||
'plinth/modules'
|
||||
]
|
||||
else:
|
||||
pattern_list = [pattern]
|
||||
|
||||
failures = test_runner.run_tests([pattern])
|
||||
failures = test_runner.run_tests(pattern_list)
|
||||
if failures > 0 or not return_to_caller:
|
||||
sys.exit(bool(failures))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user