fastlane-plugin-android_testlab_script_swit 0.1.917 → 0.1.918

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: 89b7b3b9a757a277099df6757bd42ece2503955a9ec758eee84958e0ccbb6b34
4
- data.tar.gz: cc93a06dd35e0a13d4b186f09ff19cf631391f94699256ebb584b2a509d930d7
3
+ metadata.gz: 331eea0ed093eb1b8975cde6b903a52cc91ba23fd4c3d8303283be032ca4d615
4
+ data.tar.gz: a4c16f84e8d45e98a2efdc0ee540e0b5335f5d323914f1ef67dd49d03b97d7c1
5
5
  SHA512:
6
- metadata.gz: c51e037474c6377ac1a0080e0c8b62e5efb75424fd3a81743567573e1e84f8515f52c0dc8ea1571576c32f5cea2272266b3613d3160b06411dcd0eb323da54ca
7
- data.tar.gz: f608d4c3df7e20a48e27c0bcfcfb39b2d82cb62f55c5e3bda831d833408d03c0eb7aa3128c91ab2c055abb77683eb2df223adeb3255ff7ebfba32b1242bb83b0
6
+ metadata.gz: '02490e83460058c6c3bb140cdd80bf0f2f9d0aac861ed177e5e15645041bf9baf59bd00aeb77381cc4ecfe21dd345ea4b48ac25b3439f58de758edfa2edd66be'
7
+ data.tar.gz: 01ff2a28cafa1df4179da0c1c502c83f20cfcac5bbc423d971fc5ccaa7c2f836bd6835dd2a5dd4b7d65b999b0eb041c448f9a7091494855414c1eaa379d2409f
@@ -13,6 +13,16 @@ module Fastlane
13
13
  UI.message("********************************")
14
14
  UI.message("Start Action")
15
15
  UI.message("********************************")
16
+
17
+ def measure_time
18
+ start_time = Time.now
19
+ yield
20
+ end_time = Time.now
21
+ duration_sec_total = (end_time - start_time).round(1)
22
+ duration_min = (duration_sec_total / 60).round(1)
23
+ duration_sec = duration_sec_total % 60
24
+ return "#{duration_min}분 소요시간 자동화"
25
+ end
16
26
 
17
27
  # Result Bucket & Dir
18
28
  results_bucket = params[:firebase_test_lab_results_bucket] || "#{params[:project_id]}_test_results"
@@ -27,12 +37,6 @@ module Fastlane
27
37
  # RoboScriptOption
28
38
  robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
29
39
 
30
- # Swit Result PayLoad
31
- swit_device_payload = ""
32
-
33
- # Swit Send PayLoad
34
- swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
35
-
36
40
  # Run Firebase Test Lab
37
41
  Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
38
42
  "--app #{params[:app_apk]} "\
@@ -46,51 +50,38 @@ module Fastlane
46
50
  "#{robo_script_option}"\
47
51
  "--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
48
52
  )
49
-
53
+
54
+ # Swit Result PayLoad
55
+ swit_device_payload = ""
56
+
57
+ # Swit Send PayLoad - 테스트 시간 추가
58
+ swit_webhook_payload = params[:swit_webhook_payload][0..-5] + ','
59
+ swit_webhook_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"테스트 시간 : #{test_time}\"}]},"
60
+
50
61
  # Firebase Test Lab Result Json
51
62
  resultJson = JSON.parse(File.read(params[:console_log_file_name]))
52
63
 
53
64
  swit_device_payload = resultJson.map.with_index do |item, device_index|
54
65
  axis_value_parts = item["axis_value"].split('-')
55
66
  outcome = item["outcome"]
56
-
67
+
68
+ model = axis_value_parts[0]
69
+ version = axis_value_parts[1]
70
+ locale = axis_value_parts[2]
71
+ orientation = axis_value_parts[3]
72
+
57
73
  parts_payload = axis_value_parts.map do |part|
58
74
  "{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{part}\"}]}"
59
75
  end.join(',')
60
76
 
61
- device_payload = "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{device_index + 1}\"}]},#{parts_payload},{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\": #{outcome.to_json}}]}"
62
- end.join(',')
77
+ device_payload = "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{device_index + 1}\"}]},{\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"model: #{model}\"},{\"type\":\"rt_text\",\"content\":\"version: #{version}\"},{\"type\":\"rt_text\",\"content\":\"locale: #{locale}\"},{\"type\":\"rt_text\",\"content\":\"orientation: #{orientation}\"},{\"type\":\"rt_text\",\"content\": \"Outcome: #{outcome.to_json}}]}"
78
+ end.join(',')
63
79
 
64
80
  swit_device_payload.chomp!(',')
65
-
66
-
67
-
68
81
 
69
- # 각 JSON 객체에 대해 반복
70
- # resultJson.each do |item|
71
- # # 정보 추출하기
72
- # axis_value = item["axis_value"]
73
- # outcome = item["outcome"]
74
- # test_details = item["test_details"]
75
- #
76
- # # 'axis_value' 분리하기
77
- # parts = axis_value.split('-')
78
- #
79
- # parts.each_with_index do |part, index|
80
- # swit_device_payload += "{\"type\":\"rt_section\",\"indent\":1,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Device#{index + 1}\"}]},
81
- # {\"type\": \"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content\":\"Part : #{parts[index]}\"}]},
82
- # {\"type\":\"rt_section\",\"indent\":2,\"elements\":[{\"type\":\"rt_text\",\"content":"Result : #{outcome}\"}]}"
83
- #
84
- # swit_device_payload += "," unless index == parts.length - 1
85
- # end
86
- # end
87
-
88
-
89
82
 
90
-
91
83
 
92
- # 중간 체크
93
- UI.message(swit_device_payload)
84
+
94
85
 
95
86
  # Fetch results
96
87
  download_dir = params[:download_dir]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.917"
3
+ VERSION = "0.1.918"
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.917
4
+ version: 0.1.918
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이