mutx 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dfe4f2fc2a3e4483eed44f8f91cf7d594cfa159
4
- data.tar.gz: 8851b5805e2d265f9122a6d0ee8097db28fce6fb
3
+ metadata.gz: 8be5dba99d94b6af03b1d5d8c2beb96e3ab997cf
4
+ data.tar.gz: 1edc577db14cb4e968ae1f678fc7cb824bb574fe
5
5
  SHA512:
6
- metadata.gz: 90e2586de24dbf381ab1886b9970b4e4f446c6341e5a7f08096cc1d17ddc9e75fc9a8f04bbce3b7d350a69e3d54ac7a71e965bdaa7dd34580ee6e4a504d1d44a
7
- data.tar.gz: be8292794e05d09019d7bbf98ae6316646905b761f61a5f7689b61be79f050c91d28a165e9eab62011eae1e65e8301a93d83013904456f546b97b7c70f28c1bb
6
+ metadata.gz: 0a0e248b5d40d2089a33337be0d8857a42fec91172f43534e499973ae7d302b14708a6fe261aa7a917b2d3a8e823d86a329f3b68aabea0ac9a57807139b70d15
7
+ data.tar.gz: c82b259b5f14667755e837419102ea1f6077e0c9265e2d52b91b1246ab28421b59b616600b7443213372c1370a00725774a70186ac6615cde11fbdd7d4a706df
@@ -49,8 +49,6 @@ module Mutx
49
49
 
50
50
  task.push_exec execution_id
51
51
 
52
- task.set_running!
53
-
54
52
  task.save!
55
53
 
56
54
  Mutx::Support::Log.debug "Task #{task_name} setted as running" if Mutx::Support::Log
@@ -111,7 +109,6 @@ module Mutx
111
109
  if result.pid
112
110
  Mutx::Support::Processes.kill_p(result.pid)
113
111
  killed = true
114
- task.set_ready!
115
112
  Mutx::Support::Log.debug "Execution (id=#{result.id}) killed"
116
113
  end
117
114
  rescue => e
@@ -131,7 +128,6 @@ module Mutx
131
128
  result.show_as = "pending"
132
129
  result.save!
133
130
 
134
- # task.set_ready! if Mutx::Results.is_there_running_executions_for? task.name
135
131
  if killed
136
132
  message = "Execution: Stopped (forced) "
137
133
  message += " Files: Cleanned" if cleanned
@@ -50,9 +50,7 @@ module Mutx
50
50
 
51
51
  mail.add_file "result.html"
52
52
 
53
- html_part.body "\nA continuacion se adjunta el resutado de la ejecucion solicitada"
54
- html_part.body ""
55
- html_part.body "\n-.Equipo [MuTX].-"
53
+ html_part.body "\nA continuacion se adjunta el resutado de la ejecucion solicitada. -.Equipo [MuTX].-"
56
54
 
57
55
  puts "ENVIANDO RESULTADO VIA MAIL"
58
56
 
@@ -65,11 +65,6 @@ module Mutx
65
65
  Mutx::Support::FilesCleanner.clear_sidekiq_log
66
66
  Mutx::Support::Log.debug "Sidekiq log file cleanned" if Mutx::Support::Log
67
67
 
68
- # To prevent showing tasks as runnnig when service started recently reset all tasks
69
- Mutx::Support::Log.debug "Reseting tasks statuses" if Mutx::Support::Log
70
- Mutx::Tasks.reset!
71
- Mutx::Support::Log.debug "Tasks statuses reseted" if Mutx::Support::Log
72
- puts "\n* Tasks Status: Reseted"
73
68
 
74
69
  # Force results to reset or finished status
75
70
  Mutx::Support::Log.debug "Reseting defunct executions" if Mutx::Support::Log
@@ -142,18 +142,6 @@ module Mutx
142
142
  ["tasks","results","custom_params","commit","configuration"]
143
143
  end
144
144
 
145
- # Drops all mutx collections
146
- # def self.drop_collections hard=false
147
- # db = self.mutx_db
148
- # collections_to_drop = collections
149
- # unless hard
150
- # ["custom_params","tasks"].each{|col| collections_to_drop.delete(col)}
151
- # end
152
- # collections_to_drop.each do |collection|
153
- # db.drop_collection(collection) if collection != "documentation"
154
- # end
155
- # end
156
-
157
145
  def self.drop_collections hard=false
158
146
  collections_to_drop = self.collections
159
147
  ["custom_params","tasks"].each{|col| collections_to_drop.delete(col)} unless hard
@@ -162,10 +150,7 @@ module Mutx
162
150
  end
163
151
  end
164
152
 
165
- # def self.mutx_db
166
- # MongoClient.new().db(@@db_name)
167
- # end
168
-
153
+
169
154
 
170
155
  ##################################
171
156
  # COMMITS
@@ -271,12 +256,14 @@ module Mutx
271
256
 
272
257
  def self.running type
273
258
  Mutx::Support::Log.debug "Getting db running tasks" if Mutx::Support::Log
274
- @@tasks.find({"status" => "RUNNING", "type" => type}).to_a
259
+ @@results.find({"status" => /started|running/, "task.type" => type}).to_a.map do |result|
260
+ self.task_data_for result["task"]["id"]
261
+ end.uniq
275
262
  end
276
263
 
277
264
  def self.running_for_task task_name
278
265
  Mutx::Support::Log.debug "Getting db running for task name #{task_name}" if Mutx::Support::Log
279
- @@tasks.find({"name" => task_name, "status" => "RUNNING"}).to_a
266
+ @@results.find({"status" => /started|running/, "task.name" => task_name}).to_a
280
267
  end
281
268
 
282
269
  def self.active_tasks
@@ -451,7 +451,7 @@ module Mutx
451
451
  end
452
452
 
453
453
  def is_running?
454
- @status =~ /running|stated/i
454
+ @status =~ /running|started/i
455
455
  end
456
456
 
457
457
 
@@ -3,7 +3,6 @@ module Mutx
3
3
  module Support
4
4
  module Clean
5
5
  def self.start
6
- Mutx::Tasks.reset!
7
6
  Mutx::Results.reset!
8
7
  Mutx::Support::FilesCleanner.delete_all_mutx_reports
9
8
  Mutx::Support::FilesCleanner.delete_all_console_output_files
@@ -111,13 +111,11 @@ module Mutx
111
111
  # Returns the ids for running tasks
112
112
  # @return [Array] of task ids
113
113
  def self.running_tasks
114
- # Obtener el listado completo de tasks y luego filtrar las que tienen results running
115
- # Mutx::Database::MongoConnector.running_tasks
114
+ Mutx::Database::MongoConnector.running_tasks
116
115
  end
117
116
 
118
117
  def self.running_tests
119
- # Obtener el listado completo de tasks y luego filtrar las que tienen results running
120
- # Mutx::Database::MongoConnector.running_tests
118
+ Mutx::Database::MongoConnector.running_tests
121
119
  end
122
120
 
123
121
  def self.exist_task? task_id
@@ -148,13 +146,5 @@ module Mutx
148
146
  {success:success, message:message}
149
147
  end
150
148
 
151
- # Resets all Tasks
152
- def self.reset!
153
- Mutx::Support::Log.debug "Resetting tasks status" if Mutx::Support::Log
154
- self.running_tasks.each do |task|
155
- Mutx::Tasks::Task.get(task["_id"]).set_ready!
156
- end
157
- end
158
-
159
149
  end
160
150
  end
data/lib/mutx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mutx
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Rodriguez