ds_test 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bashrc +5 -0
- data/Gemfile.lock +1 -1
- data/cucumber.out +5 -10
- data/ds_test.gemspec +1 -1
- data/features/methods/PAMFailedBookings_actions.rb +7 -9
- data/features/methods/RMbundleStatus.rb +9 -7
- data/features/step_definitions/PAMFailedBookings_steps.rb +3 -3
- data/henry-context.yml +10 -0
- data/hints.henry.rmbundlestatus +1 -1
- 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: b50423d84bad44837cf3ac7309ec9106eca71966
|
4
|
+
data.tar.gz: 18d582aa297560f230f310e02027bfcbca6d3fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f48fa0ea39cdc01bd171f8bdf40c4fc1ddc9b03b39317b9090b3ce5ec378a96582bd137127f6d77f4a8e6fcde3aac076cd2204f2a6bdcaf1bab30abe5f6b3e1
|
7
|
+
data.tar.gz: 8bfad00b1febebf576efb9824a1f4285c8a05ef9d286dc5bcf826820cdf746e34cb3e7b3535da652ab5e811a4e83d9a2387c3cef6b06fd62b1f28109d225f2c8
|
data/.bashrc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
1
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
2
2
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
3
3
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
4
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
5
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
6
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
7
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
8
|
+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
data/Gemfile.lock
CHANGED
data/cucumber.out
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
#language: es
|
2
|
-
[36m@
|
3
|
-
Característica: Consultar el servicio de
|
2
|
+
[36m@rm_group_records_costs_order[0m
|
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.
|
4
4
|
|
5
|
-
Escenario: Invocar el servicio de
|
6
|
-
[32mDado que invoco al servicio de
|
7
|
-
|
8
|
-
[36mTodos los bundles cargados tienen disponibilidad.[0m
|
9
|
-
|
10
|
-
1 scenario ([32m1 passed[0m)
|
11
|
-
2 steps ([32m2 passed[0m)
|
12
|
-
0m51.061s
|
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.[90m # features/RMgroupRecordsCostsOrder.feature:7[0m
|
6
|
+
[32mDado que invoco al servicio de Grupos de Fichas de RM[90m # features/step_definitions/RMgroupRecordsCostsOrder.rb:3[0m[0m
|
7
|
+
[36mHay 782 grupos para la consulta[0m
|
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.
|
7
|
+
gem.version = "0.2.0"
|
8
8
|
gem.authors = ["DS QA"]
|
9
9
|
gem.email = ["jdelrio@despegar.com,smendoza@despegar.com"]
|
10
10
|
gem.description = %q{Test de Media}
|
@@ -3,7 +3,7 @@ def pam_failed_bookings
|
|
3
3
|
# PROD: 10.2.7.16
|
4
4
|
# RC: 10.254.168.100
|
5
5
|
|
6
|
-
@service = HTTParty.get("http://10.2.7.16/ds-pam/service/failedBooking/findAll")
|
6
|
+
@service = HTTParty.get("http://10.2.7.16/ds-pam/service/failedBooking/findAll", :headers =>{'X-UOW' => 'GUIDO-BOT'})
|
7
7
|
end
|
8
8
|
|
9
9
|
|
@@ -24,7 +24,6 @@ def checkear_respuesta
|
|
24
24
|
@service['data'].each do | item |
|
25
25
|
|
26
26
|
items << item['crmId']
|
27
|
-
|
28
27
|
end
|
29
28
|
|
30
29
|
items = items.uniq
|
@@ -36,17 +35,17 @@ def checkear_respuesta
|
|
36
35
|
@items = items
|
37
36
|
|
38
37
|
resultado = false
|
39
|
-
|
40
38
|
else
|
41
39
|
|
42
|
-
|
40
|
+
resultado = true
|
43
41
|
|
42
|
+
puts 'No hay reservas fallidas en PAM'
|
44
43
|
end
|
45
44
|
|
46
45
|
resultado
|
47
|
-
|
48
46
|
end
|
49
47
|
|
48
|
+
|
50
49
|
def enviar_alerta
|
51
50
|
#Envia un email de alerta cuando se registran nuevos bookings fallidos
|
52
51
|
|
@@ -58,7 +57,7 @@ def enviar_alerta
|
|
58
57
|
last_execution = execution['data']['runs'][run_id]['executionInstanceId']
|
59
58
|
result = HTTParty.get("http://henry.despegar.com/api/results/#{last_execution}")
|
60
59
|
|
61
|
-
last_items = result['data'][0]['result']['tasks'][0][0]['returnedData']['output'][/\[(.*?)\]/, 1
|
60
|
+
last_items = result['data'][0]['result']['tasks'][0][0]['returnedData']['output'][/\[(.*?)\]/, 1]
|
62
61
|
|
63
62
|
if semaphore['data']['statusHolder']['status']['status'] == 'ERROR'
|
64
63
|
|
@@ -75,7 +74,7 @@ def enviar_alerta
|
|
75
74
|
|
76
75
|
mail = Mail.new do
|
77
76
|
from 'ds.test.alert@gmail.com'
|
78
|
-
to 'smendoza@despegar.com
|
77
|
+
to 'smendoza@despegar.com'
|
79
78
|
subject 'Nuevas reservas fallidas de DS-PAM'
|
80
79
|
|
81
80
|
html_part do
|
@@ -88,5 +87,4 @@ def enviar_alerta
|
|
88
87
|
end
|
89
88
|
end
|
90
89
|
false
|
91
|
-
end
|
92
|
-
|
90
|
+
end
|
@@ -3,11 +3,10 @@ def rm_bundle_list
|
|
3
3
|
# PROD: 10.2.7.16
|
4
4
|
# RC: 10.254.168.100
|
5
5
|
|
6
|
-
@bundles = HTTParty.get("http://10.2.7.16/ds-rm/service/bundles
|
6
|
+
@bundles = HTTParty.get("http://10.2.7.16/ds-rm/service/bundles", :headers =>{'X-UOW' => 'GUIDO-BOT'})
|
7
7
|
end
|
8
8
|
|
9
9
|
|
10
|
-
|
11
10
|
def checkear_bundles
|
12
11
|
#Checkea la disponibilidad de cada uno de los items que componen los bundles cargados.
|
13
12
|
|
@@ -24,19 +23,23 @@ def checkear_bundles
|
|
24
23
|
|
25
24
|
check['items'].each do | availability |
|
26
25
|
|
27
|
-
tracking_id = availability['trackingId']
|
26
|
+
tracking_id = availability['trackingId'].gsub ' ', '%20'
|
27
|
+
|
28
28
|
i = 0
|
29
29
|
for i in 0..1 do
|
30
30
|
|
31
|
-
record = HTTParty.get("http://10.2.7.16/ds-rm/service/provider-records?tracking_id=#{tracking_id}")
|
31
|
+
record = HTTParty.get("http://10.2.7.16/ds-rm/service/provider-records?tracking_id=#{tracking_id}", :headers =>{'X-UOW' => 'GUIDO-BOT'})
|
32
32
|
|
33
33
|
if record.nil? or record.empty? or record.include? 'errors'
|
34
34
|
|
35
35
|
i = i + 1
|
36
36
|
if i == 2
|
37
|
+
|
38
|
+
rambo_ref = '<A HREF="http://backoffice.despegar.com/ds-rambo/#!/bundle/edition/' + check['oid'] + '">Editar en RAMBO</A><br><br>'
|
39
|
+
|
37
40
|
bundle_title = check['title']['es']
|
38
41
|
bundle_oid = check['oid']
|
39
|
-
bundle_info << bundle_title + ' | oid: ' + bundle_oid
|
42
|
+
bundle_info << bundle_title + ' | oid: ' + bundle_oid + '<br>' + rambo_ref
|
40
43
|
end
|
41
44
|
else
|
42
45
|
i = 2
|
@@ -77,7 +80,7 @@ def alerta_bundles
|
|
77
80
|
|
78
81
|
mail = Mail.new do
|
79
82
|
from 'ds.test.alert@gmail.com'
|
80
|
-
to
|
83
|
+
to 'smendoza@despegar.com, ds-shopping@despegar.com, dssales-product@despegar.com, nicolas.sacheri@despegar.com, santiago.iribarne@despegar.com'
|
81
84
|
subject '[Alerta] Bundles con items sin disponibilidad - DS Automation'
|
82
85
|
|
83
86
|
html_part do
|
@@ -87,5 +90,4 @@ def alerta_bundles
|
|
87
90
|
end
|
88
91
|
|
89
92
|
mail.deliver!
|
90
|
-
|
91
93
|
end
|
@@ -2,10 +2,10 @@
|
|
2
2
|
#language: es
|
3
3
|
Dado(/^que invoco al servicio de bookings fallidos de PAM$/) do
|
4
4
|
pam_failed_bookings
|
5
|
-
|
5
|
+
end
|
6
6
|
|
7
7
|
Entonces(/^checkeo si hay bookings fallidos$/) do
|
8
|
-
if !checkear_respuesta
|
8
|
+
if !checkear_respuesta
|
9
9
|
enviar_alerta
|
10
|
-
|
10
|
+
end
|
11
11
|
end
|
data/henry-context.yml
CHANGED
@@ -27,5 +27,15 @@ tasks:
|
|
27
27
|
- rm_bundle_status
|
28
28
|
expand: true
|
29
29
|
reports:
|
30
|
+
- format: html
|
31
|
+
name: ${DATE}_${TASK_NAME}.html
|
32
|
+
|
33
|
+
- name: rm_group_records_costs_order
|
34
|
+
class_name: Henry::Task::CucumberTask
|
35
|
+
options:
|
36
|
+
tags:
|
37
|
+
- rm_group_records_costs_order
|
38
|
+
expand: true
|
39
|
+
reports:
|
30
40
|
- format: html
|
31
41
|
name: ${DATE}_${TASK_NAME}.html
|
data/hints.henry.rmbundlestatus
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"tasks":["rm_bundle_status"]}
|
1
|
+
{"tasks":["rm_bundle_status"]}
|
data/out.henry
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"summary":{"total":1,"breakdownByStatusCode":{"OK":1,"ERROR":0,"WARNING":0}},"tasks":[[{"name":"
|
1
|
+
{"summary":{"total":1,"breakdownByStatusCode":{"OK":1,"ERROR":0,"WARNING":0}},"tasks":[[{"name":"rm_group_records_costs_order","code":"OK","message":"OK","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[32mDado que invoco al servicio de Grupos de Fichas de RM\u001b[90m # features/step_definitions/RMgroupRecordsCostsOrder.rb:3\u001b[0m\u001b[0m\n \u001b[36mHay 7 grupos para la consulta\u001b[0m\n \u001b[32mEntonces 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 \u001b[36m\u001b[0;39;41mHubo un error al consultar el servicio de Fichas de RM con el ID: HB_BUE_RENTBIKE4H\u001b[0m\u001b[0m\n \u001b[36m\u001b[0;39;41mHubo un error al consultar el servicio de Fichas de RM con el ID: PAM_ROM_2159\u001b[0m\u001b[0m\n \u001b[36m\u001b[0;39;41mHubo un error al consultar el servicio de Fichas de RM con el ID: GL_ROM_1825\u001b[0m\u001b[0m\n \u001b[36m\u001b[0;39;41mHubo un error al consultar el servicio de Fichas de RM con el ID: PAM_LAS_5679\u001b[0m\u001b[0m\n \u001b[36m\u001b[0;39;41mHubo un error al consultar el servicio de Fichas de RM con el ID: VIA_LAS_6473SP\u001b[0m\u001b[0m\n\n1 scenario (\u001b[32m1 passed\u001b[0m)\n2 steps (\u001b[32m2 passed\u001b[0m)\n0m0.403s\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.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|