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 +4 -4
- data/Gemfile.lock +1 -1
- data/cucumber.out +10 -15
- data/ds_test.gemspec +1 -1
- data/features/methods/PAMFailedBookings_actions.rb +26 -22
- data/features/methods/RMbundleStatus.rb +5 -2
- data/features/methods/RMgroupRecordsCostsOrder.rb +1 -2
- data/out.henry +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58d19b9b6bd045fcc498cc4f6a4e2793ddec65d1
|
4
|
+
data.tar.gz: 4e39820242a7ff9c49ab53a23480e0cc62bdc1ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a79b29e99c38e44be83ccf02478c73ddb58e05c35432fb419d08c50f690379c44dd2a979009d55f31272572caf2c19a75e0a56afd5131a673a96abf0c053e356
|
7
|
+
data.tar.gz: 5babd1e30e99d2d2e0dad3c84999278c2a5d4d7597ee770d689da0fba3cdf2808572f857b2af03a8b2537bc9f9deab456e39ff7f5dead42af541a6f1087248ad
|
data/Gemfile.lock
CHANGED
data/cucumber.out
CHANGED
@@ -1,18 +1,13 @@
|
|
1
1
|
#language: es
|
2
|
-
[36m@
|
3
|
-
Característica: Consultar el servicio de
|
2
|
+
[36m@pam_failed_bookings[0m
|
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
|
6
|
-
[
|
7
|
-
[
|
8
|
-
[
|
9
|
-
[
|
10
|
-
[31m features/RMgroupRecordsCostsOrder.feature:9:in `Dado que invoco al servicio de Grupos de Fichas de RM'[0m
|
11
|
-
[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[90m # features/step_definitions/RMgroupRecordsCostsOrder.rb:7[0m[0m
|
5
|
+
Escenario: Invocar el servicio de bookings fallidos de PAM validando que existan o no entradas.[90m # features/PAMFailedBookings.feature:7[0m
|
6
|
+
[32mDado que invoco al servicio de bookings fallidos de PAM[90m # features/step_definitions/PAMFailedBookings_steps.rb:3[0m[0m
|
7
|
+
[32mEntonces checkeo si hay bookings fallidos[90m # features/step_definitions/PAMFailedBookings_steps.rb:7[0m[0m
|
8
|
+
[36mHay 8 reserva(s) fallidas en PAM[0m
|
9
|
+
[36m[127779208, 121865108, 124150208, 129322308, 121864608, 113878107, 113470907, 127780208][0m
|
12
10
|
|
13
|
-
[
|
14
|
-
[
|
15
|
-
|
16
|
-
1 scenario ([31m1 failed[0m)
|
17
|
-
2 steps ([31m1 failed[0m, [36m1 skipped[0m)
|
18
|
-
2m7.339s
|
11
|
+
1 scenario ([32m1 passed[0m)
|
12
|
+
2 steps ([32m2 passed[0m)
|
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.
|
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
|
-
|
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 '
|
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
|
-
|
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
|
-
|
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
|
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
|
data/out.henry
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"summary":{"total":1,"breakdownByStatusCode":{"OK":
|
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.
|
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-
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|