fastlane-plugin-android_testlab_script_swit 0.1.918 → 0.1.919
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: 3abf4f751114b6fa21b861e2d83a011b51de444a3c61f86dd0b764a8d4236d2a
|
4
|
+
data.tar.gz: 4f5735bce308da7f556689e6fe52fed729f56502edd48f089fb5a151c6af4afa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc540da45ace53d8e58eef8856458f34eb0dd69542c06bbbdec125c1e92952523367a22ef6c337e5e71464d92bc9a11c7736b40e0792d91ce6cb0a773e81e82b
|
7
|
+
data.tar.gz: 59deca4098f4cd101adcfd771be2502860a39b853fb15ab7ed0ca188853b391f731a95fa82daa16b9ff5539dff3ff9891b2f662dac9ab7f5e83fd2915ed55637
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -23,40 +23,56 @@ module Fastlane
|
|
23
23
|
duration_sec = duration_sec_total % 60
|
24
24
|
return "#{duration_min}분 소요시간 자동화"
|
25
25
|
end
|
26
|
-
|
27
|
-
# Result Bucket & Dir
|
28
|
-
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
29
|
-
results_dir = params[:firebase_test_lab_results_dir] || "firebase_test_result_#{DateTime.now.strftime('%Y-%m-%d-%H:%M:%S')}"
|
30
|
-
|
31
|
-
# Set Target Project ID
|
32
|
-
Helper.config(params[:project_id])
|
33
|
-
|
34
|
-
# Activate service account
|
35
|
-
Helper.authenticate(params[:gcloud_key_file])
|
36
|
-
|
37
|
-
# RoboScriptOption
|
38
|
-
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
39
26
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
27
|
+
duration = measure_time do
|
28
|
+
|
29
|
+
# Result Bucket & Dir
|
30
|
+
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
31
|
+
results_dir = params[:firebase_test_lab_results_dir] || "firebase_test_result_#{DateTime.now.strftime('%Y-%m-%d-%H:%M:%S')}"
|
32
|
+
|
33
|
+
# Set Target Project ID
|
34
|
+
Helper.config(params[:project_id])
|
35
|
+
|
36
|
+
# Activate service account
|
37
|
+
Helper.authenticate(params[:gcloud_key_file])
|
38
|
+
|
39
|
+
# RoboScriptOption
|
40
|
+
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
41
|
+
|
42
|
+
# Run Firebase Test Lab
|
43
|
+
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
44
|
+
"--app #{params[:app_apk]} "\
|
45
|
+
"#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
|
46
|
+
"#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
|
47
|
+
"#{params[:devices].map { |d| "--device model=#{d[:model]},version=#{d[:version]},locale=#{d[:locale]},orientation=#{d[:orientation]} " }.join}"\
|
48
|
+
"--timeout #{params[:timeout]} "\
|
49
|
+
"--results-bucket #{results_bucket} "\
|
50
|
+
"--results-dir #{results_dir} "\
|
51
|
+
"#{params[:extra_options]} "\
|
52
|
+
"#{robo_script_option}"\
|
53
|
+
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
54
|
+
)
|
55
|
+
|
56
|
+
# Fetch results
|
57
|
+
download_dir = params[:download_dir]
|
58
|
+
if download_dir
|
59
|
+
UI.message("Fetch results from Firebase Test Lab results bucket")
|
60
|
+
json.each do |status|
|
61
|
+
axis = status["axis_value"]
|
62
|
+
Helper.if_need_dir("#{download_dir}/#{axis}")
|
63
|
+
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
64
|
+
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
53
69
|
|
54
70
|
# Swit Result PayLoad
|
55
71
|
swit_device_payload = ""
|
56
72
|
|
57
73
|
# Swit Send PayLoad - 테스트 시간 추가
|
58
74
|
swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
|
59
|
-
swit_webhook_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"테스트 시간 : #{
|
75
|
+
swit_webhook_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"테스트 시간 : #{duration}\"}]},"
|
60
76
|
|
61
77
|
# Firebase Test Lab Result Json
|
62
78
|
resultJson = JSON.parse(File.read(params[:console_log_file_name]))
|
@@ -78,22 +94,6 @@ module Fastlane
|
|
78
94
|
end.join(',')
|
79
95
|
|
80
96
|
swit_device_payload.chomp!(',')
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
# Fetch results
|
87
|
-
download_dir = params[:download_dir]
|
88
|
-
if download_dir
|
89
|
-
UI.message("Fetch results from Firebase Test Lab results bucket")
|
90
|
-
json.each do |status|
|
91
|
-
axis = status["axis_value"]
|
92
|
-
Helper.if_need_dir("#{download_dir}/#{axis}")
|
93
|
-
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
94
|
-
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
95
|
-
end
|
96
|
-
end
|
97
97
|
|
98
98
|
# Swit PayLoad 병합
|
99
99
|
swit_webhook_payload += swit_device_payload + ']}]}'
|