fastlane-plugin-android_testlab_script_swit 0.1.36 → 0.1.38

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: 1a167646f0169a46f2c26740c662d7a3402e583097111f0c438167cfc46252da
4
- data.tar.gz: 6e8ae6313cac3b15375898ccf34505ea7a2a270d71676e199a9f8284768e7c6f
3
+ metadata.gz: ac05a3cb02ce74a34b2aa3795c6543287aa6e2da4c7df8ab8405a3b284fa1fca
4
+ data.tar.gz: 5707540ccf5c2b38602ddaf0578759eb5e17b89b0bbbb6c5e30b65b71682d234
5
5
  SHA512:
6
- metadata.gz: 0b8dd79b4caa957ca9cf6f0054d6937eae31059dc24849e6f3e0b2ff34e910dfb53f4ab47adf4ba3045b2a8ae36db86d6dca4c85427ef621c37c096789579bd1
7
- data.tar.gz: 304c228be70e798930155911d4f0d514fa87e133798927186efad5c1229049776ab9fccec4a4204559c0991e76af7d6e1491b8217eefb96ae7f407869088e1af
6
+ metadata.gz: ee8ad34c894b2e6d4323dcfb6ec73121c712c01668bcffe18f4ffe07ea3080553c1f5a7c04a421ced60a129a717c1f87f9b3459df96a4d0d3122f851efeac0c5
7
+ data.tar.gz: 542e117d09c7ad829ed94d79cd5429070caffe375fd26c16fa21b4c5bd6438ed9bc02571a1e3ca16bc0071224c379a8e99fc34323784911b3849e224e27cb48c
@@ -1,6 +1,7 @@
1
1
  require 'fastlane/action'
2
2
  require 'json'
3
3
  require 'fileutils'
4
+ require 'open-uri'
4
5
 
5
6
  module Fastlane
6
7
  module Actions
@@ -23,7 +24,7 @@ module Fastlane
23
24
  robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
24
25
 
25
26
  # Run Firebase Test Lab
26
- Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
27
+ result_url = Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
27
28
  "--app #{params[:app_apk]} "\
28
29
  "#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
29
30
  "#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
@@ -36,10 +37,12 @@ module Fastlane
36
37
  "--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
37
38
  )
38
39
 
39
- swit_webhook_url = params[:swit_webhook_url]
40
- swit_webhook_payload = params[:swit_webhook_payload]
40
+ wait_for_test_to_complete(test_results_url)
41
41
 
42
- HTTParty.post(swit_webhook_url, body: swit_webhook_payload.to_json, headers: { 'Content-Type' => 'application/json' })
42
+ # swit_webhook_url = params[:swit_webhook_url]
43
+ # swit_webhook_payload = params[:swit_webhook_payload]
44
+ #
45
+ # HTTParty.post(swit_webhook_url, body: swit_webhook_payload.to_json, headers: { 'Content-Type' => 'application/json' })
43
46
 
44
47
  # json = JSON.parse(File.read(params[:console_log_file_name]))
45
48
  # UI.message("Test status: #{json}")
@@ -59,6 +62,20 @@ module Fastlane
59
62
  UI.message("Finish Action")
60
63
  end
61
64
 
65
+ def wait_for_test_to_complete(url)
66
+ require 'open-uri'
67
+
68
+ loop do
69
+ html = open(url).read
70
+
71
+ if html.include?("Test is complete")
72
+ break
73
+ else
74
+ sleep(10) # wait for a few seconds before checking again.
75
+ end
76
+ end
77
+ end
78
+
62
79
  # Short Detils
63
80
  def self.description
64
81
  "Android Firebase TestLab with Robo Script Test"
@@ -260,10 +277,24 @@ module Fastlane
260
277
  platform == :android
261
278
  end
262
279
 
280
+ #
263
281
  def self.output
264
282
  [['console_output.log', 'A console log when running Firebase Test Lab with gcloud']]
265
283
  end
266
284
 
285
+ #
286
+ def wait_for_test_to_complete(url)
287
+ loop do
288
+ html = open(url).read
289
+
290
+ if html.include?("TestLab is complete")
291
+ break
292
+ else
293
+ sleep(10) # wait for 10 seconds before checking again
294
+ end
295
+ end
296
+ end
297
+
267
298
  def self.example_code
268
299
 
269
300
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.36"
3
+ VERSION = "0.1.38"
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.36
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이