fastlane-plugin-android_testlab_script_swit 0.1.84 → 0.1.85
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1352613dbb39bee54616826260d3b3539331d8a0c2869af61506237cacf8be3
|
4
|
+
data.tar.gz: d8bf3cfc2416b40b5fc45cbc1a66b6e8ed58bf49a2b1e617c0925308752141a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdc04110c9b572ea43925c146095f5fd0d8c4a51b960b513604bc60ead5eee64e5ff7c551ecd8bb372d44152bf2999c36a2b5106e0179ba8ce9b680ea861c72f
|
7
|
+
data.tar.gz: b26b408cc9fa0fdb96753d90f31c33250b4e88dee8f2cb2450400cc87d1483828af6c51d14bc9fb28c1f800e52886eadf72ca64b8be1d161041ffaa49872f9fd
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -23,94 +23,71 @@ module Fastlane
|
|
23
23
|
|
24
24
|
# RoboScriptOption Add
|
25
25
|
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
26
|
+
|
27
|
+
#
|
28
|
+
new_payload = ""
|
26
29
|
|
27
30
|
UI.message(params[:gcloud_components_channel])
|
28
31
|
|
29
32
|
# Run Firebase Test Lab
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
33
|
+
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
34
|
+
"--app #{params[:app_apk]} "\
|
35
|
+
"#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
|
36
|
+
"#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
|
37
|
+
"#{params[:devices].map { |d| "--device model=#{d[:model]},version=#{d[:version]},locale=#{d[:locale]},orientation=#{d[:orientation]} " }.join}"\
|
38
|
+
"--timeout #{params[:timeout]} "\
|
39
|
+
"--results-bucket #{results_bucket} "\
|
40
|
+
"--results-dir #{results_dir} "\
|
41
|
+
"#{params[:extra_options]} "\
|
42
|
+
"#{robo_script_option}"\
|
43
|
+
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
44
|
+
)
|
45
|
+
|
46
|
+
json = JSON.parse(File.read(params[:console_log_file_name]))
|
47
|
+
UI.message("Test status: #{json}")
|
45
48
|
|
46
49
|
|
47
50
|
# 각 JSON 객체에 대해 반복
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
# end
|
75
|
-
|
76
|
-
# params[:devices].each_with_index do |device, index|
|
77
|
-
# new_payload = "[{\"type\": \"rt_section\", \"indent\": 1, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Device#{index + 1}\"}]},
|
78
|
-
# {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"model : #{device[:model]}\"}]},
|
79
|
-
# {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"OS Version : #{device[:version]}\"}]},
|
80
|
-
# {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"locale : #{device[:locale]}\"}]},
|
81
|
-
# {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"orientation : #{device[:orientation]}\"}]},
|
82
|
-
# {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Result : #{outcome}\"}]}]"
|
83
|
-
# end
|
84
|
-
|
85
|
-
new_payload = ""
|
86
|
-
|
87
|
-
params[:devices].each_with_index do |device, index|
|
88
|
-
new_payload += "{\"type\": \"rt_section\", \"indent\": 1, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Device#{index + 1}\"}]},
|
89
|
-
{\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"model : #{device[:model]}\"}]},
|
90
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{device[:version]}\"}]},
|
91
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{device[:locale]}\"}]},
|
92
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{device[:orientation]}\"}]}"
|
93
|
-
|
94
|
-
new_payload += "," unless index == params[:devices].length - 1
|
51
|
+
json.each do |item|
|
52
|
+
# 정보 추출하기
|
53
|
+
axis_value = item["axis_value"]
|
54
|
+
outcome = item["outcome"]
|
55
|
+
test_details = item["test_details"]
|
56
|
+
|
57
|
+
# 'axis_value' 분리하기
|
58
|
+
parts = axis_value.split('-')
|
59
|
+
|
60
|
+
# 출력하기
|
61
|
+
UI.message("Outcome: #{outcome}, Test Details: #{test_details}")
|
62
|
+
|
63
|
+
parts.each_with_index do |part, index|
|
64
|
+
UI.message("Part #{index + 1}: #{part}")
|
65
|
+
end
|
66
|
+
|
67
|
+
params[:devices].each_with_index do |device, index|
|
68
|
+
new_payload += "{\"type\": \"rt_section\", \"indent\": 1, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Device#{index + 1}\"}]},
|
69
|
+
{\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"model : #{device[:model]}\"}]},
|
70
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{device[:version]}\"}]},
|
71
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{device[:locale]}\"}]},
|
72
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{device[:orientation]}\"}]},
|
73
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Result : #{outcome}\"}]},"
|
74
|
+
|
75
|
+
new_payload += "," unless index == params[:devices].length - 1
|
76
|
+
end
|
95
77
|
end
|
96
78
|
|
97
79
|
# Fetch results
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
# 원래 하던 행위
|
111
|
-
# payload_string = params[:swit_webhook_payload]
|
80
|
+
download_dir = params[:download_dir]
|
81
|
+
if download_dir
|
82
|
+
UI.message("Fetch results from Firebase Test Lab results bucket")
|
83
|
+
json.each do |status|
|
84
|
+
axis = status["axis_value"]
|
85
|
+
Helper.if_need_dir("#{download_dir}/#{axis}")
|
86
|
+
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
87
|
+
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
88
|
+
end
|
89
|
+
end
|
112
90
|
|
113
|
-
|
114
91
|
# Remove the closing square bracket from the original payload and add a comma
|
115
92
|
swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
|
116
93
|
|