fastlane-plugin-android_testlab_script_swit 0.1.932 → 0.1.934
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: 579b713c5bf62659dff113faaa2b1600e0e287a60df2769201118c67daba9387
|
4
|
+
data.tar.gz: b638242e6863d0577879d93408cff3721c06e09a9a24f7fa99c58d3a640f317b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be110cfae9d3e8345bd1322f34b6672b0ea5d651c072b07d7121fa0fdd5a76b31a96064a5cc652f1f890f126c5d87d523c54338de75e35e44cc17e9db337ca55
|
7
|
+
data.tar.gz: 5f18864b2b3f364b935bd21acb246e53a703fd488013a82f8e4a9859e37bda1c1ee1c205c6b1080db88a233b1905ef04efb3c929cea31148c8d0c55796c8ecab
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -7,16 +7,6 @@ require 'httparty'
|
|
7
7
|
module Fastlane
|
8
8
|
module Actions
|
9
9
|
class AndroidTestlabScriptSwitAction < Action
|
10
|
-
|
11
|
-
def self.measure_time
|
12
|
-
start_time = Time.now
|
13
|
-
yield
|
14
|
-
end_time = Time.now
|
15
|
-
duration_sec_total = (end_time - start_time).round(1)
|
16
|
-
duration_min = (duration_sec_total / 60).round(1)
|
17
|
-
duration_sec = duration_sec_total % 60
|
18
|
-
return "총 #{duration_min}분 테스트"
|
19
|
-
end
|
20
10
|
|
21
11
|
# actions run
|
22
12
|
def self.run(params)
|
@@ -24,99 +14,44 @@ module Fastlane
|
|
24
14
|
UI.message("Start Action")
|
25
15
|
UI.message("********************************")
|
26
16
|
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
# Result Bucket & Dir
|
31
|
-
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
32
|
-
results_dir = params[:firebase_test_lab_results_dir] || "firebase_test_result_#{DateTime.now.strftime('%Y-%m-%d-%H:%M:%S')}"
|
17
|
+
# Result Bucket & Dir
|
18
|
+
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
19
|
+
results_dir = params[:firebase_test_lab_results_dir] || "firebase_test_result_#{DateTime.now.strftime('%Y-%m-%d-%H:%M:%S')}"
|
33
20
|
|
34
|
-
|
35
|
-
|
21
|
+
# Set Target Project ID
|
22
|
+
Helper.config(params[:project_id])
|
36
23
|
|
37
|
-
|
38
|
-
|
24
|
+
# Activate service account
|
25
|
+
Helper.authenticate(params[:gcloud_key_file])
|
39
26
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
# Run Firebase Test Lab
|
44
|
-
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
45
|
-
"--app #{params[:app_apk]} "\
|
46
|
-
"#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
|
47
|
-
"#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
|
48
|
-
"#{params[:devices].map { |d| "--device model=#{d[:model]},version=#{d[:version]},locale=#{d[:locale]},orientation=#{d[:orientation]} " }.join}"\
|
49
|
-
"--timeout #{params[:timeout]} "\
|
50
|
-
"--results-bucket #{results_bucket} "\
|
51
|
-
"--results-dir #{results_dir} "\
|
52
|
-
"#{params[:extra_options]} "\
|
53
|
-
"#{robo_script_option}"\
|
54
|
-
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
55
|
-
)
|
56
|
-
|
57
|
-
# Fetch results
|
58
|
-
download_dir = params[:download_dir]
|
59
|
-
if download_dir
|
60
|
-
UI.message("Fetch results from Firebase Test Lab results bucket")
|
61
|
-
json.each do |status|
|
62
|
-
axis = status["axis_value"]
|
63
|
-
Helper.if_need_dir("#{download_dir}/#{axis}")
|
64
|
-
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
65
|
-
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
27
|
+
# RoboScriptOption
|
28
|
+
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
70
29
|
|
71
|
-
#
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
model = axis_value_parts[0]
|
86
|
-
version = axis_value_parts[1]
|
87
|
-
locale = axis_value_parts[2]
|
88
|
-
orientation = axis_value_parts[3]
|
89
|
-
|
90
|
-
# 디바이스 정보
|
91
|
-
device_payload =
|
92
|
-
"[{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"#{model}\"}]}, " +
|
93
|
-
"{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\", \"content\": \"OS: #{version} / Locale: #{locale} / Orientation: #{orientation}\"}]}, "
|
94
|
-
|
95
|
-
# 성공 여부
|
96
|
-
if outcome == 'passed'
|
97
|
-
device_payload +=
|
98
|
-
"{\"type\":\"rt_section\",\"elements\":[{\"type\":\"rt_text\",\"content\":\"결과 : \"},{\"type\":\"rt_emoji\",\"name\":\":tada:\"},{\"type\":\"rt_text\",\"content\":\" Passed \"},{\"type\":\"rt_emoji\",\"name\":\":tada:\"}]}"
|
99
|
-
elsif outcome == 'failed'
|
100
|
-
device_payload +=
|
101
|
-
"{\"type\":\"rt_section\",\"elements\":[{\"type\":\"rt_text\",\"content\":\"결과 : \"},{\"type\":\"rt_emoji\",\"name\":\":interrobang:\"},{\"type\":\"rt_text\",\"content\":\" Failed \"},{\"type\":\"rt_emoji\",\"name\": \":interrobang:\"}]}"
|
102
|
-
else # Skip or other outcomes
|
103
|
-
device_payload +=
|
104
|
-
"{\"type\":\"rt_section\",\"elements\":[{\"type\":{\"name\": \":bulb:\"}},{\"text\":{\"content\": \" Skipped or other outcomes \"}}, {\"emoji\":{\"name\": \":bulb:\"}}]}"
|
105
|
-
end
|
106
|
-
|
107
|
-
device_payload += "]"
|
108
|
-
|
109
|
-
end.join(',')
|
110
|
-
|
111
|
-
swit_device_payload.chomp!(',')
|
112
|
-
|
113
|
-
# Swit PayLoad 병합
|
114
|
-
swit_webhook_payload += swit_device_payload + ']}]}'
|
30
|
+
# Run Firebase Test Lab
|
31
|
+
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
32
|
+
"--app #{params[:app_apk]} "\
|
33
|
+
"#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
|
34
|
+
"#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
|
35
|
+
"#{params[:devices].map { |d| "--device model=#{d[:model]},version=#{d[:version]},locale=#{d[:locale]},orientation=#{d[:orientation]} " }.join}"\
|
36
|
+
"--timeout #{params[:timeout]} "\
|
37
|
+
"--results-bucket #{results_bucket} "\
|
38
|
+
"--results-dir #{results_dir} "\
|
39
|
+
"#{params[:extra_options]} "\
|
40
|
+
"#{robo_script_option}"\
|
41
|
+
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
42
|
+
)
|
115
43
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
44
|
+
# Fetch results
|
45
|
+
download_dir = params[:download_dir]
|
46
|
+
if download_dir
|
47
|
+
UI.message("Fetch results from Firebase Test Lab results bucket")
|
48
|
+
json.each do |status|
|
49
|
+
axis = status["axis_value"]
|
50
|
+
Helper.if_need_dir("#{download_dir}/#{axis}")
|
51
|
+
Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
|
52
|
+
Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
|
53
|
+
end
|
54
|
+
end
|
120
55
|
|
121
56
|
UI.message("********************************")
|
122
57
|
UI.message("Finish Action")
|
@@ -215,20 +150,6 @@ module Fastlane
|
|
215
150
|
type: String,
|
216
151
|
optional: false),
|
217
152
|
|
218
|
-
# swit_webhook url (false)
|
219
|
-
FastlaneCore::ConfigItem.new(key: :swit_webhook_url,
|
220
|
-
env_name: "SWIT_WEBHOOK_URL",
|
221
|
-
description: "The Swit WebHOOK URL",
|
222
|
-
type: String,
|
223
|
-
optional: true),
|
224
|
-
|
225
|
-
# swit_webhook payload (false)
|
226
|
-
FastlaneCore::ConfigItem.new(key: :swit_webhook_payload,
|
227
|
-
env_name: "SWIT_WEBHOOK_PAYLOAD",
|
228
|
-
description: "The Swit WebHOOK PAYLOAD",
|
229
|
-
type: String,
|
230
|
-
optional: true),
|
231
|
-
|
232
153
|
# test apk (false)
|
233
154
|
FastlaneCore::ConfigItem.new(key: :app_test_apk,
|
234
155
|
env_name: "APP_TEST_APK",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.
|
4
|
+
version: 0.1.934
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 나비이쁜이
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|