fastlane-plugin-android_testlab_script_swit 0.1.917 → 0.1.918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331eea0ed093eb1b8975cde6b903a52cc91ba23fd4c3d8303283be032ca4d615
|
4
|
+
data.tar.gz: a4c16f84e8d45e98a2efdc0ee540e0b5335f5d323914f1ef67dd49d03b97d7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '02490e83460058c6c3bb140cdd80bf0f2f9d0aac861ed177e5e15645041bf9baf59bd00aeb77381cc4ecfe21dd345ea4b48ac25b3439f58de758edfa2edd66be'
|
7
|
+
data.tar.gz: 01ff2a28cafa1df4179da0c1c502c83f20cfcac5bbc423d971fc5ccaa7c2f836bd6835dd2a5dd4b7d65b999b0eb041c448f9a7091494855414c1eaa379d2409f
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -13,6 +13,16 @@ module Fastlane
|
|
13
13
|
UI.message("********************************")
|
14
14
|
UI.message("Start Action")
|
15
15
|
UI.message("********************************")
|
16
|
+
|
17
|
+
def measure_time
|
18
|
+
start_time = Time.now
|
19
|
+
yield
|
20
|
+
end_time = Time.now
|
21
|
+
duration_sec_total = (end_time - start_time).round(1)
|
22
|
+
duration_min = (duration_sec_total / 60).round(1)
|
23
|
+
duration_sec = duration_sec_total % 60
|
24
|
+
return "#{duration_min}분 소요시간 자동화"
|
25
|
+
end
|
16
26
|
|
17
27
|
# Result Bucket & Dir
|
18
28
|
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
@@ -27,12 +37,6 @@ module Fastlane
|
|
27
37
|
# RoboScriptOption
|
28
38
|
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
29
39
|
|
30
|
-
# Swit Result PayLoad
|
31
|
-
swit_device_payload = ""
|
32
|
-
|
33
|
-
# Swit Send PayLoad
|
34
|
-
swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
|
35
|
-
|
36
40
|
# Run Firebase Test Lab
|
37
41
|
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
38
42
|
"--app #{params[:app_apk]} "\
|
@@ -46,51 +50,38 @@ module Fastlane
|
|
46
50
|
"#{robo_script_option}"\
|
47
51
|
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
48
52
|
)
|
49
|
-
|
53
|
+
|
54
|
+
# Swit Result PayLoad
|
55
|
+
swit_device_payload = ""
|
56
|
+
|
57
|
+
# Swit Send PayLoad - 테스트 시간 추가
|
58
|
+
swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
|
59
|
+
swit_webhook_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"테스트 시간 : #{test_time}\"}]},"
|
60
|
+
|
50
61
|
# Firebase Test Lab Result Json
|
51
62
|
resultJson = JSON.parse(File.read(params[:console_log_file_name]))
|
52
63
|
|
53
64
|
swit_device_payload = resultJson.map.with_index do |item, device_index|
|
54
65
|
axis_value_parts = item["axis_value"].split('-')
|
55
66
|
outcome = item["outcome"]
|
56
|
-
|
67
|
+
|
68
|
+
model = axis_value_parts[0]
|
69
|
+
version = axis_value_parts[1]
|
70
|
+
locale = axis_value_parts[2]
|
71
|
+
orientation = axis_value_parts[3]
|
72
|
+
|
57
73
|
parts_payload = axis_value_parts.map do |part|
|
58
74
|
"{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{part}\"}]}"
|
59
75
|
end.join(',')
|
60
76
|
|
61
|
-
device_payload = "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{device_index + 1}\"}]}
|
62
|
-
|
77
|
+
device_payload = "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{device_index + 1}\"}]},{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"model: #{model}\"},{\"type\":\"rt_text\",\"content\":\"version: #{version}\"},{\"type\":\"rt_text\",\"content\":\"locale: #{locale}\"},{\"type\":\"rt_text\",\"content\":\"orientation: #{orientation}\"},{\"type\":\"rt_text\",\"content\": \"Outcome: #{outcome.to_json}}]}"
|
78
|
+
end.join(',')
|
63
79
|
|
64
80
|
swit_device_payload.chomp!(',')
|
65
|
-
|
66
|
-
|
67
|
-
|
68
81
|
|
69
|
-
# 각 JSON 객체에 대해 반복
|
70
|
-
# resultJson.each do |item|
|
71
|
-
# # 정보 추출하기
|
72
|
-
# axis_value = item["axis_value"]
|
73
|
-
# outcome = item["outcome"]
|
74
|
-
# test_details = item["test_details"]
|
75
|
-
#
|
76
|
-
# # 'axis_value' 분리하기
|
77
|
-
# parts = axis_value.split('-')
|
78
|
-
#
|
79
|
-
# parts.each_with_index do |part, index|
|
80
|
-
# swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
|
81
|
-
# {\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{parts[index]}\"}]},
|
82
|
-
# {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content":"Result : #{outcome}\"}]}"
|
83
|
-
#
|
84
|
-
# swit_device_payload += "," unless index == parts.length - 1
|
85
|
-
# end
|
86
|
-
# end
|
87
|
-
|
88
|
-
|
89
82
|
|
90
|
-
|
91
83
|
|
92
|
-
|
93
|
-
UI.message(swit_device_payload)
|
84
|
+
|
94
85
|
|
95
86
|
# Fetch results
|
96
87
|
download_dir = params[:download_dir]
|