2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 10:05:39 +00:00

Add test command (#3372)

* integrate test loading as task - use with gitpod

* ignore test data with git
This commit is contained in:
Matthias Mair
2022-07-21 03:41:42 +02:00
committed by GitHub
parent 09987ad79b
commit 864d69d968
3 changed files with 18 additions and 12 deletions

View File

@ -511,6 +511,19 @@ def test(c, database=None):
manage(c, 'test', pty=True)
@task(pre=[update])
def setup_test(c):
"""Setup a testing enviroment."""
# Remove old data directory
c.run('rm inventree-data -r')
# Get test data
c.run('git clone https://github.com/inventree/demo-dataset inventree-data')
# Load data
import_records(c, filename='inventree-data/inventree_data.json', clear=True)
@task
def coverage(c):
"""Run code-coverage of the InvenTree codebase, using the 'coverage' code-analysis tools.