ds_test 0.2.3 → 0.2.4

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: 464fec0b8d3e1fb54548b6ebfcbd54921e2789f4
4
- data.tar.gz: 1d6ff0be9060d495e59640f09df7248447b54c71
3
+ metadata.gz: 58d19b9b6bd045fcc498cc4f6a4e2793ddec65d1
4
+ data.tar.gz: 4e39820242a7ff9c49ab53a23480e0cc62bdc1ff
5
5
  SHA512:
6
- metadata.gz: ed9ae1f08c720a3548069e967fb4701e335df34e41b9a2dcda72731d147ba9e144563e4264fb16ea58d47a0d7b4959166f417316f536858f713fc9ea43150a17
7
- data.tar.gz: cc8814d3015a555e16e4739a31e4ea7c73756ad42a103ba77e7c5882360f07dd7279b0c5e78376c4a48d837a7d73913b477b0146f64abc6f1ad58e803fee90aa
6
+ metadata.gz: a79b29e99c38e44be83ccf02478c73ddb58e05c35432fb419d08c50f690379c44dd2a979009d55f31272572caf2c19a75e0a56afd5131a673a96abf0c053e356
7
+ data.tar.gz: 5babd1e30e99d2d2e0dad3c84999278c2a5d4d7597ee770d689da0fba3cdf2808572f857b2af03a8b2537bc9f9deab456e39ff7f5dead42af541a6f1087248ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ds_test (0.2.3)
4
+ ds_test (0.2.4)
5
5
  henry-container
6
6
  hpricot
7
7
  httparty
data/cucumber.out CHANGED
@@ -1,18 +1,13 @@
1
1
  #language: es
2
- @rm_group_records_costs_order
3
- Característica: Consultar el servicio de Grupos de Fichas de RM para ver si existe alguno que tenga orden automático, contenga al menos una actividad de PAM y que la actividad ganadora segun los costos sea de un proveedor distinto de PAM.
2
+ @pam_failed_bookings
3
+ Característica: Consultar el servicio de bookings fallidos de PAM para ver si existe alguno y generar una alarma para alertar de la situación.
4
4
 
5
- Escenario: Invocar el servicio de grupos de fichas de RM y reportar aquellos grupos con orden automático que contengan actividades de PAM que no ganen la competencia de costos. # features/RMgroupRecordsCostsOrder.feature:7
6
- Dado que invoco al servicio de Grupos de Fichas de RM # features/step_definitions/RMgroupRecordsCostsOrder.rb:3
7
-  Connection timed out - connect(2) for "10.2.7.16" port 80 (Errno::ETIMEDOUT)
8
-  ./features/methods/RMgroupRecordsCostsOrder.rb:6:in `rm_group_records'
9
-  ./features/step_definitions/RMgroupRecordsCostsOrder.rb:4:in `/^que invoco al servicio de Grupos de Fichas de RM$/'
10
-  features/RMgroupRecordsCostsOrder.feature:9:in `Dado que invoco al servicio de Grupos de Fichas de RM'
11
- Entonces checkeo aquellos grupos con orden Automatico que contengan actividades de PAM y en la competencia de costos gane alguna otra actividad de otro proveedor # features/step_definitions/RMgroupRecordsCostsOrder.rb:7
5
+ Escenario: Invocar el servicio de bookings fallidos de PAM validando que existan o no entradas. # features/PAMFailedBookings.feature:7
6
+ Dado que invoco al servicio de bookings fallidos de PAM # features/step_definitions/PAMFailedBookings_steps.rb:3
7
+ Entonces checkeo si hay bookings fallidos # features/step_definitions/PAMFailedBookings_steps.rb:7
8
+ Hay 8 reserva(s) fallidas en PAM
9
+ [127779208, 121865108, 124150208, 129322308, 121864608, 113878107, 113470907, 127780208]
12
10
 
13
- Failing Scenarios:
14
- cucumber features/RMgroupRecordsCostsOrder.feature:7 # Escenario: Invocar el servicio de grupos de fichas de RM y reportar aquellos grupos con orden automático que contengan actividades de PAM que no ganen la competencia de costos.
15
-
16
- 1 scenario (1 failed)
17
- 2 steps (1 failed, 1 skipped)
18
- 2m7.339s
11
+ 1 scenario (1 passed)
12
+ 2 steps (2 passed)
13
+ 0m10.409s
data/ds_test.gemspec CHANGED
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "ds_test"
7
- gem.version = "0.2.3"
7
+ gem.version = "0.2.4"
8
8
  gem.authors = ["DS QA"]
9
9
  gem.email = ["jdelrio@despegar.com,smendoza@despegar.com"]
10
10
  gem.description = %q{Test de Media}
@@ -45,25 +45,9 @@ def checkear_respuesta
45
45
  resultado
46
46
  end
47
47
 
48
+ def nuevos_bookings
48
49
 
49
- def enviar_alerta
50
- #Envia un email de alerta cuando se registran nuevos bookings fallidos
51
-
52
- semaphore = HTTParty.get("http://henry.despegar.com/api/monitoring/semaphores/status/55ca5f49e4b09c07e3b554cb")
53
- execution = HTTParty.get("http://henry.despegar.com/api/executions/stats/55ca5600e4b09c07e3b554c7")
54
-
55
- run_id = (execution['data']['runs'].to_a.size - 1)
56
-
57
- last_execution = execution['data']['runs'][run_id]['executionInstanceId']
58
- result = HTTParty.get("http://henry.despegar.com/api/results/#{last_execution}")
59
-
60
- last_items = result['data'][0]['result']['tasks'][0][0]['returnedData']['output'][/\[(.*?)\]/, 1]
61
-
62
- if semaphore['data']['statusHolder']['status']['status'] == 'ERROR'
63
-
64
- if last_items.length < @items.to_s[/\[(.*?)\]/, 1 ].length
65
-
66
- body_template = '<br><h2># Servicio de alerta de bookings fallidos de DS-PAM #</h2><br><b>Existen nuevas reservas fallidas / pendientes de emisión:</b><br><ul>'
50
+ body_template = '<br><h2># Servicio de alerta de bookings fallidos de DS-PAM #</h2><br><b>Existen nuevas reservas fallidas / pendientes de emisión:</b><br><ul>'
67
51
 
68
52
  @items.each do | item |
69
53
  body_template = body_template + '<li>' + item.to_s + '</li>'
@@ -71,10 +55,9 @@ def enviar_alerta
71
55
 
72
56
  body_template = body_template + '</ul>'
73
57
 
74
-
75
58
  mail = Mail.new do
76
59
  from 'ds.test.alert@gmail.com'
77
- to 'smendoza@despegar.com'
60
+ to 'ds-pam@despegar.com, nmelano@despegar.com, reservastkts@despegar.com, ddileo@despegar.com'
78
61
  subject 'Nuevas reservas fallidas de DS-PAM'
79
62
 
80
63
  html_part do
@@ -83,8 +66,29 @@ def enviar_alerta
83
66
  end
84
67
  end
85
68
 
86
- mail.deliver!
69
+ mail.deliver!
70
+ end
71
+
72
+ def enviar_alerta
73
+ #Envia un email de alerta cuando se registran nuevos bookings fallidos
74
+
75
+ semaphore = HTTParty.get("http://backend-cross.despexds.net/henry-prod-service/monitoring/semaphores/status/55ca5f49e4b09c07e3b554cb")
76
+ execution = HTTParty.get("http://backend-cross.despexds.net/henry-prod-service/executions/stats/55ca5600e4b09c07e3b554c7")
77
+
78
+ run_id = (execution['data']['runs'].to_a.size - 1)
79
+
80
+ last_execution = execution['data']['runs'][run_id]['executionInstanceId']
81
+ result = HTTParty.get("http://backend-cross.despexds.net/henry-prod-service/results/#{last_execution}")
82
+
83
+ last_items = result['data'][0]['result']['tasks'][0][0]['returnedData']['output'][/\[(.*?)\]/, 1]
84
+
85
+ if semaphore['data']['statusHolder']['status']['status'] == 'ERROR'
86
+
87
+ if last_items.length < @items.to_s[/\[(.*?)\]/, 1 ].length
88
+
89
+ nuevos_bookings
87
90
  end
91
+ else
92
+ nuevos_bookings
88
93
  end
89
- false
90
94
  end
@@ -16,6 +16,7 @@ def checkear_bundles
16
16
  end
17
17
 
18
18
  bundle_info = []
19
+ to_print = []
19
20
 
20
21
  if !@bundles.empty?
21
22
 
@@ -40,6 +41,7 @@ def checkear_bundles
40
41
  bundle_title = check['title']['es']
41
42
  bundle_oid = check['oid']
42
43
  bundle_info << bundle_title + ' | oid: ' + bundle_oid + '<br>' + rambo_ref
44
+ to_print << bundle_title + ' | oid: ' + bundle_oid
43
45
  end
44
46
  else
45
47
  i = 2
@@ -52,7 +54,8 @@ def checkear_bundles
52
54
  if !bundle_info.empty?
53
55
 
54
56
  @output = bundle_info.uniq
55
- puts @output
57
+ to_print = to_print.uniq
58
+ puts to_print
56
59
  false
57
60
  else
58
61
 
@@ -80,7 +83,7 @@ def alerta_bundles
80
83
 
81
84
  mail = Mail.new do
82
85
  from 'ds.test.alert@gmail.com'
83
- to 'smendoza@despegar.com' #, ds-shopping@despegar.com, dssales-product@despegar.com, nicolas.sacheri@despegar.com, santiago.iribarne@despegar.com'
86
+ to 'smendoza@despegar.com, ds-shopping@despegar.com, dssales-product@despegar.com, nicolas.sacheri@despegar.com, santiago.iribarne@despegar.com'
84
87
  subject '[Alerta] Bundles con items sin disponibilidad - DS Automation'
85
88
 
86
89
  html_part do
@@ -131,5 +131,4 @@ def alerta_group_records
131
131
  end
132
132
  end
133
133
  mail.deliver!
134
- end
135
-
134
+ end
data/out.henry CHANGED
@@ -1 +1 @@
1
- {"summary":{"total":1,"breakdownByStatusCode":{"OK":0,"ERROR":1,"WARNING":0}},"tasks":[[{"name":"rm_group_records_costs_order","code":"ERROR","message":"exit","returnedData":{"output":"#language: es\n\u001b[36m@rm_group_records_costs_order\u001b[0m\nCaracterística: Consultar el servicio de Grupos de Fichas de RM para ver si existe alguno que tenga orden automático, contenga al menos una actividad de PAM y que la actividad ganadora segun los costos sea de un proveedor distinto de PAM.\n\n Escenario: Invocar el servicio de grupos de fichas de RM y reportar aquellos grupos con orden automático que contengan actividades de PAM que no ganen la competencia de costos.\u001b[90m # features/RMgroupRecordsCostsOrder.feature:7\u001b[0m\n \u001b[31mDado que invoco al servicio de Grupos de Fichas de RM\u001b[90m # features/step_definitions/RMgroupRecordsCostsOrder.rb:3\u001b[0m\u001b[0m\n\u001b[31m Connection timed out - connect(2) for \"10.2.7.16\" port 80 (Errno::ETIMEDOUT)\u001b[0m\n\u001b[31m ./features/methods/RMgroupRecordsCostsOrder.rb:6:in `rm_group_records'\u001b[0m\n\u001b[31m ./features/step_definitions/RMgroupRecordsCostsOrder.rb:4:in `/^que invoco al servicio de Grupos de Fichas de RM$/'\u001b[0m\n\u001b[31m features/RMgroupRecordsCostsOrder.feature:9:in `Dado que invoco al servicio de Grupos de Fichas de RM'\u001b[0m\n \u001b[36mEntonces checkeo aquellos grupos con orden Automatico que contengan actividades de PAM y en la competencia de costos gane alguna otra actividad de otro proveedor\u001b[90m # features/step_definitions/RMgroupRecordsCostsOrder.rb:7\u001b[0m\u001b[0m\n\n\u001b[31mFailing Scenarios:\u001b[0m\n\u001b[31mcucumber features/RMgroupRecordsCostsOrder.feature:7\u001b[0m\u001b[90m # Escenario: Invocar el servicio de grupos de fichas de RM y reportar aquellos grupos con orden automático que contengan actividades de PAM que no ganen la competencia de costos.\u001b[0m\n\n1 scenario (\u001b[31m1 failed\u001b[0m)\n2 steps (\u001b[31m1 failed\u001b[0m, \u001b[36m1 skipped\u001b[0m)\n2m7.339s\n","backtrace":["/home/smendoza/.rvm/gems/ruby-2.2.2/gems/cucumber-2.0.2/lib/cucumber/rake/task.rb:94:in `exit'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/cucumber-2.0.2/lib/cucumber/rake/task.rb:94:in `block in run'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/file_utils.rb:57:in `call'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/file_utils.rb:57:in `sh'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/file_utils_ext.rb:37:in `sh'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/cucumber-2.0.2/lib/cucumber/rake/task.rb:92:in `run'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/cucumber-2.0.2/lib/cucumber/rake/task.rb:143:in `block in define_task'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `call'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `each'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in `execute'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'","/home/smendoza/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/task/rake_task.rb:23:in `execute'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:35:in `block (2 levels) in execute'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:28:in `each'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:28:in `block in execute'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:25:in `each'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:25:in `each_with_index'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/lib/henry/container.rb:25:in `execute'","/home/smendoza/.rvm/gems/ruby-2.2.2/gems/henry-container-0.1.14/bin/henry-ruby-container:28:in `<top (required)>'","/home/smendoza/.rvm/gems/ruby-2.2.2/bin/henry-ruby-container:23:in `load'","/home/smendoza/.rvm/gems/ruby-2.2.2/bin/henry-ruby-container:23:in `<main>'","/home/smendoza/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'","/home/smendoza/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'"]},"log":{},"worker":"smendoza-ThinkPad-Edge","parameters":{"env":"rc"}}]]}
1
+ {"summary":{"total":1,"breakdownByStatusCode":{"OK":1,"ERROR":0,"WARNING":0}},"tasks":[[{"name":"pam_failed_bookings","code":"OK","message":"OK","returnedData":{"output":"#language: es\n\u001b[36m@pam_failed_bookings\u001b[0m\nCaracterística: Consultar el servicio de bookings fallidos de PAM para ver si existe alguno y generar una alarma para alertar de la situación.\n\n Escenario: Invocar el servicio de bookings fallidos de PAM validando que existan o no entradas.\u001b[90m # features/PAMFailedBookings.feature:7\u001b[0m\n \u001b[32mDado que invoco al servicio de bookings fallidos de PAM\u001b[90m # features/step_definitions/PAMFailedBookings_steps.rb:3\u001b[0m\u001b[0m\n \u001b[32mEntonces checkeo si hay bookings fallidos\u001b[90m # features/step_definitions/PAMFailedBookings_steps.rb:7\u001b[0m\u001b[0m\n \u001b[36mHay 8 reserva(s) fallidas en PAM\u001b[0m\n \u001b[36m[127779208, 121865108, 124150208, 129322308, 121864608, 113878107, 113470907, 127780208]\u001b[0m\n\n1 scenario (\u001b[32m1 passed\u001b[0m)\n2 steps (\u001b[32m2 passed\u001b[0m)\n0m10.409s\n","backtrace":null},"log":{},"worker":"smendoza-ThinkPad-Edge","parameters":{"env":"rc"}}]]}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ds_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DS QA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-19 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug