fastlane-plugin-android_testlab_script_swit 0.1.89 → 0.1.901
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: 9df5077c3ed88a2e24742ccf721a792a30aaa518a55e8a75ce83bcb772472faa
|
|
4
|
+
data.tar.gz: f8a9cc8f6578206bb345b59f9588b648e70aab5d938629ba3f8bf081a16680e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e75382078a46efded4b897a55f587db722df98ff7aa213d8deb5859179e16f797d215b02bcd0f907b3b0f10d7feb28549e0cc8d123da97d9737e1cec2dfa2a70
|
|
7
|
+
data.tar.gz: 65d80a84ab251238aab9aa972b60847b0e91761f399a1a754a6c20dac500a001ac5fc79b00b4a3dd6ef1b9668ededd260963d613b17ff60605eba7e221b714a8
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
|
@@ -10,24 +10,26 @@ module Fastlane
|
|
|
10
10
|
|
|
11
11
|
# actions run
|
|
12
12
|
def self.run(params)
|
|
13
|
+
UI.message("********************************")
|
|
13
14
|
UI.message("Start Action")
|
|
15
|
+
UI.message(params[:gcloud_components_channel])
|
|
16
|
+
|
|
14
17
|
|
|
18
|
+
# Result Bucket & Dir
|
|
15
19
|
results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
|
|
16
20
|
results_dir = params[:firebase_test_lab_results_dir] || "firebase_test_result_#{DateTime.now.strftime('%Y-%m-%d-%H:%M:%S')}"
|
|
17
21
|
|
|
18
|
-
# Set
|
|
22
|
+
# Set Target Project ID
|
|
19
23
|
Helper.config(params[:project_id])
|
|
20
24
|
|
|
21
25
|
# Activate service account
|
|
22
26
|
Helper.authenticate(params[:gcloud_key_file])
|
|
23
27
|
|
|
24
|
-
# RoboScriptOption
|
|
28
|
+
# RoboScriptOption
|
|
25
29
|
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
|
26
30
|
|
|
27
|
-
#
|
|
31
|
+
# Swit PayLoad
|
|
28
32
|
new_payload = ""
|
|
29
|
-
|
|
30
|
-
UI.message(params[:gcloud_components_channel])
|
|
31
33
|
|
|
32
34
|
# Run Firebase Test Lab
|
|
33
35
|
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
|
@@ -43,12 +45,14 @@ module Fastlane
|
|
|
43
45
|
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
|
44
46
|
)
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
# Firebase Test Lab Result Json
|
|
49
|
+
resultJson = JSON.parse(File.read(params[:console_log_file_name]))
|
|
49
50
|
|
|
51
|
+
# 결과 데이터 저장용 배열 생성
|
|
52
|
+
results = []
|
|
53
|
+
|
|
50
54
|
# 각 JSON 객체에 대해 반복
|
|
51
|
-
|
|
55
|
+
resultJson.each do |item|
|
|
52
56
|
# 정보 추출하기
|
|
53
57
|
axis_value = item["axis_value"]
|
|
54
58
|
outcome = item["outcome"]
|
|
@@ -60,31 +64,26 @@ module Fastlane
|
|
|
60
64
|
# 출력하기
|
|
61
65
|
UI.message("Outcome: #{outcome}, Test Details: #{test_details}")
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
new_payload += "{\"type\": \"rt_section\", \"indent\": 1, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Device#{index + 1}\"}]},
|
|
67
|
-
{\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"model : #{device[:model]}\"}]},
|
|
68
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{device[:version]}\"}]},
|
|
69
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{device[:locale]}\"}]},
|
|
70
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{device[:orientation]}\"}]},
|
|
71
|
-
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Result : #{outcome}\"}]}"
|
|
72
|
-
|
|
73
|
-
new_payload += "," unless index == params[:devices].length - 1
|
|
74
|
-
|
|
75
|
-
end
|
|
67
|
+
# 결과 데이터 저장
|
|
68
|
+
results << { parts: parts, outcome: outcome }
|
|
76
69
|
end
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
|
|
71
|
+
results.each do |result|
|
|
72
|
+
result[:parts].each_with_index do |part, index|
|
|
73
|
+
new_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
|
|
74
|
+
{\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"model : #{part[:model]}\"}]},
|
|
75
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{part[:version]}\"}]},
|
|
76
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{part[:locale]}\"}]},
|
|
77
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{part[:orientation]}\"}]},
|
|
78
|
+
{\"type\":{\"tada:\"},{\"name\":{\"tada:\"}}},
|
|
79
|
+
{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content":"Result : " + result[:outcome] + "\"}]}"
|
|
80
|
+
|
|
81
|
+
new_payload += "," unless index == result[:parts].length -1
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# 결과좀 봅시다.
|
|
86
|
+
UI.message(new_payload)
|
|
88
87
|
|
|
89
88
|
# Fetch results
|
|
90
89
|
download_dir = params[:download_dir]
|
|
@@ -107,7 +106,9 @@ module Fastlane
|
|
|
107
106
|
# Swit Message
|
|
108
107
|
HTTParty.post(params[:swit_webhook_url], body: { body_text: swit_webhook_payload }.to_json, headers: { 'Content-Type' => 'application/json' })
|
|
109
108
|
|
|
109
|
+
UI.message("********************************")
|
|
110
110
|
UI.message("Finish Action")
|
|
111
|
+
UI.message("********************************")
|
|
111
112
|
end
|
|
112
113
|
|
|
113
114
|
# Short Detils
|