1717
1818class Base (Plugin ):
1919 """
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.
3230 """
33- name = 'testing_base' # Usage: --with-testing_base
31+ name = 'testing_base' # Usage: --with-testing_base (Enabled by default)
3432
3533 def options (self , parser , env ):
3634 super (Base , self ).options (parser , env = env )
@@ -55,6 +53,11 @@ def options(self, parser, env):
5553 '--log_path' , dest = 'log_path' ,
5654 default = 'latest_logs/' ,
5755 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." )
5861 parser .add_option (
5962 '--report' , action = "store_true" , dest = 'report' ,
6063 default = False ,
@@ -89,7 +92,8 @@ def configure(self, options, conf):
8992 self .test_count = 0
9093 self .import_error = False
9194 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 )
9397 if self .report_on :
9498 report_helper .clear_out_old_report_logs (archive_past_runs = False )
9599
0 commit comments