Add test_type option to shell cli

This commit adds a test_type option to the cli.

Change-Id: I7be6684bab88ff02e3d4ec80352c599388a81cb2
This commit is contained in:
Masayuki Igawa 2016-11-16 14:12:20 +09:00
parent 551c604e22
commit 8d53a4b0cb
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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()