Class: KnapsackPro::Adapters::BaseAdapter
- Inherits:
-
Object
- Object
- KnapsackPro::Adapters::BaseAdapter
show all
- Defined in:
- lib/knapsack_pro/adapters/base_adapter.rb
Constant Summary
collapse
- TEST_DIR_PATTERN =
Just example, please overwrite constant in subclass
'test/**{,/*/**}/*_test.rb'
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.adapter_bind_method_called_file ⇒ Object
.bind ⇒ Object
30
31
32
33
34
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 30
def self.bind
adapter = new
adapter.bind
adapter
end
|
.slow_test_file?(adapter_class, test_file_path) ⇒ Boolean
.verify_bind_method_called ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 36
def self.verify_bind_method_called
::Kernel.at_exit do
if File.exist?(adapter_bind_method_called_file)
File.delete(adapter_bind_method_called_file)
else
puts "\n\n"
KnapsackPro.logger.error('-'*10 + ' Configuration error ' + '-'*50)
KnapsackPro.logger.error("You forgot to call #{self}.bind method in your test runner configuration file. It is needed to record test files time execution. Please follow the installation guide to configure your project properly #{KnapsackPro::Urls::INSTALLATION_GUIDE}")
KnapsackPro.logger.error("If you already have #{self}.bind method added and you still see this error then one of your tests must have deleted the .knapsack_pro directory from the disk accidentally. Please ensure you do not remove the .knapsack_pro directory: #{KnapsackPro::Urls::DASHBOARD__ZEROISH_TEST_EXECUTION_TIMES}")
Kernel.exit(1)
end
end
end
|
Instance Method Details
#bind_before_queue_hook ⇒ Object
74
75
76
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 74
def bind_before_queue_hook
raise NotImplementedError
end
|
#bind_queue_mode ⇒ Object
78
79
80
81
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 78
def bind_queue_mode
bind_before_queue_hook
bind_time_tracker
end
|
#bind_save_report ⇒ Object
70
71
72
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 70
def bind_save_report
raise NotImplementedError
end
|
#bind_time_tracker ⇒ Object
66
67
68
|
# File 'lib/knapsack_pro/adapters/base_adapter.rb', line 66
def bind_time_tracker
raise NotImplementedError
end
|