Browse Source

Add test_type option to shell cli

This commit adds a test_type option to the cli.

Change-Id: I7be6684bab88ff02e3d4ec80352c599388a81cb2
Masayuki Igawa 2 years ago
parent
commit
8d53a4b0cb
2 changed files with 4 additions and 1 deletions
  1. 1
    0
      coverage2sql/db/api.py
  2. 3
    1
      coverage2sql/shell.py

+ 1
- 0
coverage2sql/db/api.py View File

@@ -81,6 +81,7 @@ def create_coverage(project_name, coverage_rate=0.0, report_time=None,
81 81
     :param float coverage_rate: coverage_rate defaults to 0
82 82
     :param datetime.Datetime report_time: when the coverage was collected
83 83
                                           defaults to None
84
+    :param str test_type: test_type like a task name of tox e.g. py27
84 85
     :param session: optional session object if one isn't provided a new session
85 86
                     will be acquired for the duration of this operation
86 87
     :return: The coverage object stored in the DB

+ 3
- 1
coverage2sql/shell.py View File

@@ -30,6 +30,8 @@ SHELL_OPTS = [
30 30
                help='project name of the coverage files'),
31 31
     cfg.StrOpt('coverage_file', positional=True,
32 32
                help='A coverage file to put into the database'),
33
+    cfg.StrOpt('test-type', default='py27',
34
+               help='test_type like a task name of tox e.g. py27'),
33 35
 ]
34 36
 
35 37
 DATABASE_OPTS = [
@@ -62,7 +64,7 @@ def parse_args(argv):
62 64
 
63 65
 def process_results(project_name=".", coverage_rate=0.0):
64 66
     session = api.get_session()
65
-    api.create_coverage(project_name, coverage_rate)
67
+    api.create_coverage(project_name, coverage_rate, test_type=CONF.test_type)
66 68
     session.close()
67 69
 
68 70
 

Loading…
Cancel
Save