fastlane-plugin-android_testlab_script_swit 0.1.89 → 0.1.901

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: e2f4848d0bbfdacaba69ad9c0ee781e4329424a1cc779ee7c6b181c58e2fbb11
4
- data.tar.gz: 24f5351b95bef8bbc442f3904d7971e6f4fb6986a68ba7aed48670b7373cd6c0
3
+ metadata.gz: 9df5077c3ed88a2e24742ccf721a792a30aaa518a55e8a75ce83bcb772472faa
4
+ data.tar.gz: f8a9cc8f6578206bb345b59f9588b648e70aab5d938629ba3f8bf081a16680e1
5
5
  SHA512:
6
- metadata.gz: d8c889ff05fde2a00d5ad0a90fa73bb9a3f014d99b951fb75d31abbdf575906932b6e7f17c4e2f6d65439352db15d7645b183c2164fa6d9cde8debbd92d20e8a
7
- data.tar.gz: a5b58629c96d450d08cb3833f1525e451c29784e7145f9e7aebf9ed169ca9e903a0983ca6d3aade292115442ea723bf5971b5ae38df6899938bd7b95188e39b8
6
+ metadata.gz: e75382078a46efded4b897a55f587db722df98ff7aa213d8deb5859179e16f797d215b02bcd0f907b3b0f10d7feb28549e0cc8d123da97d9737e1cec2dfa2a70
7
+ data.tar.gz: 65d80a84ab251238aab9aa972b60847b0e91761f399a1a754a6c20dac500a001ac5fc79b00b4a3dd6ef1b9668ededd260963d613b17ff60605eba7e221b714a8
@@ -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 target project
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 Add
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
- json = JSON.parse(File.read(params[:console_log_file_name]))
47
- UI.message("Test status: #{json}")
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
- json.each do |item|
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
- params[:devices].each_with_index do |device, index|
64
- # UI.message("Part #{index + 1}: #{part}")
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
- # params[:devices].each_with_index do |device, index|
79
- # new_payload += "{\"type\": \"rt_section\", \"indent\": 1, \"elements\": [{\"type\": \"rt_text\", \"content\": \"Device#{index + 1}\"}]},
80
- # {\"type\": \"rt_section\", \"indent\": 2, \"elements\": [{\"type\": \"rt_text\", \"content\": \"model : #{device[:model]}\"}]},
81
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"OS Version : #{device[:version]}\"}]},
82
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"locale : #{device[:locale]}\"}]},
83
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"orientation : #{device[:orientation]}\"}]},
84
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Result : #{outcome}\"}]}"
85
- #
86
- # new_payload += "," unless index == params[:devices].length - 1
87
- # end
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.89"
3
+ VERSION = "0.1.901"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.89
4
+ version: 0.1.901
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이