17
17
18
18
class Base (Plugin ):
19
19
"""
20
- The base_plugin includes the following variables for nosetest runs:
21
- self.env -- The environment for the tests to use (Usage: --env=ENV)
22
- self.data -- Any extra data to pass to the tests (Usage: --data=DATA)
23
- self.log_path -- The directory where log files get saved to
24
- (Usage: --log_path=LOG_PATH)
25
- self.report -- The option to create a fancy report after tests complete
26
- (Usage: --report)
27
- self.show_report -- If self.report is turned on, then the report will
28
- display immediately after tests complete their run.
29
- Only use this when running tests locally, as this will
30
- pause the test run until the report window is closed.
31
- (Usage: --show_report)
20
+ The base_plugin includes the following command-line options for nosetests:
21
+ --env=ENV (Set a test environment. Use "self.env" to access env in tests.)
22
+ --data=DATA (Extra data to pass to tests. Use "self.data" in tests.)
23
+ --log_path=LOG_PATH (The directory where log files get saved to.)
24
+ --archive_logs (Archive old log files instead of deleting them.)
25
+ --report (The option to create a fancy report after tests complete.)
26
+ --show_report If self.report is turned on, then the report will
27
+ display immediately after tests complete their run.
28
+ Only use this when running tests locally, as this will
29
+ pause the test run until the report window is closed.
32
30
"""
33
- name = 'testing_base' # Usage: --with-testing_base
31
+ name = 'testing_base' # Usage: --with-testing_base (Enabled by default)
34
32
35
33
def options (self , parser , env ):
36
34
super (Base , self ).options (parser , env = env )
@@ -55,6 +53,11 @@ def options(self, parser, env):
55
53
'--log_path' , dest = 'log_path' ,
56
54
default = 'latest_logs/' ,
57
55
help = 'Where the log files are saved.' )
56
+ parser .add_option (
57
+ '--archive_logs' , action = "store_true" ,
58
+ dest = 'archive_logs' ,
59
+ default = False ,
60
+ help = "Archive old log files instead of deleting them." )
58
61
parser .add_option (
59
62
'--report' , action = "store_true" , dest = 'report' ,
60
63
default = False ,
@@ -89,7 +92,8 @@ def configure(self, options, conf):
89
92
self .test_count = 0
90
93
self .import_error = False
91
94
log_path = options .log_path
92
- log_helper .log_folder_setup (log_path )
95
+ archive_logs = options .archive_logs
96
+ log_helper .log_folder_setup (log_path , archive_logs )
93
97
if self .report_on :
94
98
report_helper .clear_out_old_report_logs (archive_past_runs = False )
95
99
0 commit comments