fastlane-plugin-android_testlab_script_swit 0.1.907 → 0.1.909

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
  SHA256:
3
- metadata.gz: 75cd650b8b82f169d37830454875b08c8a36a6853ae03cb4cdcdcf7bd79b62a2
4
- data.tar.gz: 2522dd23a350e5b30c5a29c3a647d4c457e102f947ac4dc503bc27abb5d0dd2e
3
+ metadata.gz: c9dcc9b818282c7dc465168f8cc16f6876fa9f292634b13ea444e119fafbce26
4
+ data.tar.gz: c14a885068c58fde034e23ae7d1c9cbcd1b8721fc43a146fd309110fa585d000
5
5
  SHA512:
6
- metadata.gz: ce94dd7dc7aa548f0a6a57b788b38efa700b303bebf693050b6ecc690f37b6440771f4c42273cbcd28e97f13079710314d054021998b7fb6378f19e05c988ec0
7
- data.tar.gz: 432eaa04c7310c7ef113004cc13bc4c4df083f06172e88262aea405b2a95c5a90e6d56222fad1148650c314265483bc8aa0178b762162bca9633bcaaf7f5a259
6
+ metadata.gz: 92f7f10071d24d3c6b395f97d79dda479d1c7bbc39617194851a8a7316beedf459fbce4114f8ad0ac541e090da375266f89c3e1b2fd88b53fc16bde7f7a94e5e
7
+ data.tar.gz: 978940a94fc4d1e1704ce65154508aa0c4f00d66a6abb02b39dda101bb01ff444caedb66e44deb74f507f8f3a611ddef7c6e857e7983a74376da6566cd288612
@@ -51,7 +51,26 @@ module Fastlane
51
51
  resultJson = JSON.parse(File.read(params[:console_log_file_name]))
52
52
 
53
53
  # 각 JSON 객체에 대해 반복
54
- resultJson.each do |item|
54
+ # resultJson.each do |item|
55
+ # # 정보 추출하기
56
+ # axis_value = item["axis_value"]
57
+ # outcome = item["outcome"]
58
+ # test_details = item["test_details"]
59
+ #
60
+ # # 'axis_value' 분리하기
61
+ # parts = axis_value.split('-')
62
+ #
63
+ # parts.each_with_index do |part, index|
64
+ # swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
65
+ # {\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{parts[index]}\"}]},
66
+ # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content":"Result : #{outcome}\"}]}"
67
+ #
68
+ # swit_device_payload += "," unless index == parts.length - 1
69
+ # end
70
+ # end
71
+
72
+
73
+ resultJson.each_with_index do |item, device_index|
55
74
  # 정보 추출하기
56
75
  axis_value = item["axis_value"]
57
76
  outcome = item["outcome"]
@@ -60,28 +79,32 @@ module Fastlane
60
79
  # 'axis_value' 분리하기
61
80
  parts = axis_value.split('-')
62
81
 
63
- parts.each_with_index do |part, index|
64
- swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
65
- {\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{parts[index]}\"}]},
66
- {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Result : #{outcome}\"}]}"
67
-
68
- swit_device_payload += "," unless index == parts.length - 1
69
- end
82
+ swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{device_index + 1}\"}]},"
83
+
84
+ part_names = ["Model", "Version", "Locale", "Orientation"]
70
85
 
86
+ parts.each_with_index do |part, index|
87
+ swit_device_payload += "{\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"#{part_names[index]} : #{parts[index]}\"}]},"
88
+
89
+ if index == parts.length -1
90
+ swit_device_payload += "{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content":"Result : #{outcome}\"}]}"
91
+ end
92
+
93
+ swit_device_payload += "," unless device_index == resultJson.length -1 && index == parts.length -1
94
+
95
+ end
96
+
71
97
  end
72
98
 
73
- # results.each do |result|
74
- # result[:parts].each_with_index do |part, index|
75
- # swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
76
- # {\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"model : #{part[:model]}\"}]},
77
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{part[:version]}\"}]},
78
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{part[:locale]}\"}]},
79
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{part[:orientation]}\"}]},
80
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Result : #{result[:outcome]}\"}]}"
81
- #
82
- # swit_device_payload += "," unless index == result[:parts].length - 1
83
- # end
84
- # end
99
+ # remove the last comma if it exists
100
+ swit_device_payload.chomp!(',')
101
+
102
+
103
+
104
+
105
+
106
+ # 중간 체크
107
+ UI.message(swit_device_payload)
85
108
 
86
109
  # Fetch results
87
110
  download_dir = params[:download_dir]
@@ -97,6 +120,9 @@ module Fastlane
97
120
 
98
121
  # Swit PayLoad 병합
99
122
  swit_webhook_payload += swit_device_payload + ']}]}'
123
+
124
+ # 마지막 체크
125
+ UI.message(swit_webhook_payload)
100
126
 
101
127
  # Swit WebHook
102
128
  HTTParty.post(params[:swit_webhook_url], body: { body_text: swit_webhook_payload }.to_json, headers: { 'Content-Type' => 'application/json' })
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.907"
3
+ VERSION = "0.1.909"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-android_testlab_script_swit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.907
4
+ version: 0.1.909
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이