Module: Kaya::Results
- Defined in:
- lib/kaya/results/result.rb,
lib/kaya/results/results.rb
Defined Under Namespace
Classes: Result
Class Method Summary collapse
- .all_results ⇒ Object
- .all_results_for(suite_id) ⇒ Object
- .all_results_for_ip(ip_address) ⇒ Object
- .all_results_ids ⇒ Object
- .find_all_for_key(key) ⇒ Object
- .find_for(key) ⇒ Object
- .find_for_status(status) ⇒ Object
-
.reset_defuncts ⇒ Object
Resets all results with running status.
- .results_for_suite_id_and_ip(suite_id, ip) ⇒ Object
- .results_ids_for(suite_id) ⇒ Object
- .running_for_suite_id_and_ip?(suite_id, ip) ⇒ Boolean
Class Method Details
.all_results ⇒ Object
26 27 28 |
# File 'lib/kaya/results/results.rb', line 26 def self.all_results Kaya::Database::MongoConnector.all_results end |
.all_results_for(suite_id) ⇒ Object
4 5 6 |
# File 'lib/kaya/results/results.rb', line 4 def self.all_results_for suite_id Kaya::Database::MongoConnector.results_for suite_id end |
.all_results_for_ip(ip_address) ⇒ Object
34 35 36 |
# File 'lib/kaya/results/results.rb', line 34 def self.all_results_for_ip ip_address Kaya::Database::MongoConnector.find_results_for_ip ip_address end |
.all_results_ids ⇒ Object
14 15 16 |
# File 'lib/kaya/results/results.rb', line 14 def self.all_results_ids Kaya::Database::MongoConnector.all_results_ids end |
.find_all_for_key(key) ⇒ Object
30 31 32 |
# File 'lib/kaya/results/results.rb', line 30 def self.find_all_for_key key Kaya::Database::MongoConnector.find_results_for_key key end |
.find_for(key) ⇒ Object
18 19 20 |
# File 'lib/kaya/results/results.rb', line 18 def self.find_for key Kaya::Database::MongoConnector.find_results_for_key key end |
.find_for_status(status) ⇒ Object
22 23 24 |
# File 'lib/kaya/results/results.rb', line 22 def self.find_for_status status Kaya::Database::MongoConnector.find_results_for_status status end |
.reset_defuncts ⇒ Object
Resets all results with running status
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/kaya/results/results.rb', line 50 def self.reset_defuncts Kaya::Database::MongoConnector.all_results.select do |result| ["started","running"].include? result["status"] end.each do |result| Kaya::Support::Processes.kill_by_result_id(result["_id"]) end.each do |result| result = Kaya::Results::Result.get(result["_id"]) result.reset! end end |
.results_for_suite_id_and_ip(suite_id, ip) ⇒ Object
38 39 40 |
# File 'lib/kaya/results/results.rb', line 38 def self.results_for_suite_id_and_ip suite_id, ip Kaya::Database::MongoConnector.results_for_suite_id_and_ip suite_id, ip end |
.results_ids_for(suite_id) ⇒ Object
8 9 10 11 12 |
# File 'lib/kaya/results/results.rb', line 8 def self.results_ids_for suite_id all_results_for(suite_id).map do |result| result["_id"] end end |
.running_for_suite_id_and_ip?(suite_id, ip) ⇒ Boolean
42 43 44 45 46 47 |
# File 'lib/kaya/results/results.rb', line 42 def self.running_for_suite_id_and_ip? suite_id, ip results = self.results_for_suite_id_and_ip suite_id, ip not results.select do |res| res["status"]=="running" end.empty? end |