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: 331eea0ed093eb1b8975cde6b903a52cc91ba23fd4c3d8303283be032ca4d615
4
- data.tar.gz: a4c16f84e8d45e98a2efdc0ee540e0b5335f5d323914f1ef67dd49d03b97d7c1
3
+ metadata.gz: 3abf4f751114b6fa21b861e2d83a011b51de444a3c61f86dd0b764a8d4236d2a
4
+ data.tar.gz: 4f5735bce308da7f556689e6fe52fed729f56502edd48f089fb5a151c6af4afa
5
5
  SHA512:
6
- metadata.gz: '02490e83460058c6c3bb140cdd80bf0f2f9d0aac861ed177e5e15645041bf9baf59bd00aeb77381cc4ecfe21dd345ea4b48ac25b3439f58de758edfa2edd66be'
7
- data.tar.gz: 01ff2a28cafa1df4179da0c1c502c83f20cfcac5bbc423d971fc5ccaa7c2f836bd6835dd2a5dd4b7d65b999b0eb041c448f9a7091494855414c1eaa379d2409f
6
+ metadata.gz: cc540da45ace53d8e58eef8856458f34eb0dd69542c06bbbdec125c1e92952523367a22ef6c337e5e71464d92bc9a11c7736b40e0792d91ce6cb0a773e81e82b
7
+ data.tar.gz: 59deca4098f4cd101adcfd771be2502860a39b853fb15ab7ed0ca188853b391f731a95fa82daa16b9ff5539dff3ff9891b2f662dac9ab7f5e83fd2915ed55637
@@ -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
- # Run Firebase Test Lab
41
- Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
42
- "--app #{params[:app_apk]} "\
43
- "#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
44
- "#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
45
- "#{params[:devices].map { |d| "--device model=#{d[:model]},version=#{d[:version]},locale=#{d[:locale]},orientation=#{d[:orientation]} " }.join}"\
46
- "--timeout #{params[:timeout]} "\
47
- "--results-bucket #{results_bucket} "\
48
- "--results-dir #{results_dir} "\
49
- "#{params[:extra_options]} "\
50
- "#{robo_script_option}"\
51
- "--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
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\":\"테스트 시간 : #{test_time}\"}]},"
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 + ']}]}'
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.918"
3
+ VERSION = "0.1.919"
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.918
4
+ version: 0.1.919
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이