From 8d53a4b0cb63708a8dbd6f84db46191c3ba7761a Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Wed, 16 Nov 2016 14:12:20 +0900 Subject: [PATCH] Add test_type option to shell cli This commit adds a test_type option to the cli. Change-Id: I7be6684bab88ff02e3d4ec80352c599388a81cb2 --- coverage2sql/db/api.py | 1 + coverage2sql/shell.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/coverage2sql/db/api.py b/coverage2sql/db/api.py index 058a023..4221cd7 100644 --- a/coverage2sql/db/api.py +++ b/coverage2sql/db/api.py @@ -81,6 +81,7 @@ def create_coverage(project_name, coverage_rate=0.0, report_time=None, :param float coverage_rate: coverage_rate defaults to 0 :param datetime.Datetime report_time: when the coverage was collected defaults to None + :param str test_type: test_type like a task name of tox e.g. py27 :param session: optional session object if one isn't provided a new session will be acquired for the duration of this operation :return: The coverage object stored in the DB diff --git a/coverage2sql/shell.py b/coverage2sql/shell.py index 9993952..bb730d1 100644 --- a/coverage2sql/shell.py +++ b/coverage2sql/shell.py @@ -30,6 +30,8 @@ SHELL_OPTS = [ help='project name of the coverage files'), cfg.StrOpt('coverage_file', positional=True, help='A coverage file to put into the database'), + cfg.StrOpt('test-type', default='py27', + help='test_type like a task name of tox e.g. py27'), ] DATABASE_OPTS = [ @@ -62,7 +64,7 @@ def parse_args(argv): def process_results(project_name=".", coverage_rate=0.0): session = api.get_session() - api.create_coverage(project_name, coverage_rate) + api.create_coverage(project_name, coverage_rate, test_type=CONF.test_type) session.close()