Browse Source

Merge "Add test_type option to shell cli"

Jenkins 2 years ago
parent
commit
cc9bd26949
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

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