fastlane-plugin-android_testlab_script_swit 0.1.38 → 0.1.40

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: ac05a3cb02ce74a34b2aa3795c6543287aa6e2da4c7df8ab8405a3b284fa1fca
4
- data.tar.gz: 5707540ccf5c2b38602ddaf0578759eb5e17b89b0bbbb6c5e30b65b71682d234
3
+ metadata.gz: 791fc74ef48b4238b8eebf9877ec7339584b035caa99223cd5245f2a3692524e
4
+ data.tar.gz: adfad851a37d428347cd503186f4b861c4511c35fba23f492839b7b8a50a3e1c
5
5
  SHA512:
6
- metadata.gz: ee8ad34c894b2e6d4323dcfb6ec73121c712c01668bcffe18f4ffe07ea3080553c1f5a7c04a421ced60a129a717c1f87f9b3459df96a4d0d3122f851efeac0c5
7
- data.tar.gz: 542e117d09c7ad829ed94d79cd5429070caffe375fd26c16fa21b4c5bd6438ed9bc02571a1e3ca16bc0071224c379a8e99fc34323784911b3849e224e27cb48c
6
+ metadata.gz: 9a60c3bc108645bee420928e0f155da5ef7cc7760c9f9c6252bd0b0eb6ac3eebcd6ecb1cb4b5e765a3abb08aada567c3a467020f8e80879ab05c902fd0fb2f7a
7
+ data.tar.gz: ce74a3ce4cd883700afee578b7e93f2ac53001441f78d291ce83b03375e2e7e43c6134aa338dfc5a1675315c569a1c7bf2844c2862d891a158a0ad53608971ca
@@ -24,7 +24,7 @@ module Fastlane
24
24
  robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
25
25
 
26
26
  # Run Firebase Test Lab
27
- result_url = Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
27
+ result_url = Helper.run_tests2(params[:gcloud_components_channel], "--type #{params[:type]} "\
28
28
  "--app #{params[:app_apk]} "\
29
29
  "#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
30
30
  "#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
@@ -37,43 +37,24 @@ module Fastlane
37
37
  "--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
38
38
  )
39
39
 
40
- wait_for_test_to_complete(test_results_url)
41
-
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' })
46
-
47
- # json = JSON.parse(File.read(params[:console_log_file_name]))
48
- # UI.message("Test status: #{json}")
49
- #
50
- # # Fetch results
51
- # download_dir = params[:download_dir]
52
- # if download_dir
53
- # UI.message("Fetch results from Firebase Test Lab results bucket")
54
- # json.each do |status|
55
- # axis = status["axis_value"]
56
- # Helper.if_need_dir("#{download_dir}/#{axis}")
57
- # Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
58
- # Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
59
- # end
60
- # end
40
+ # wait_for_test_to_complete(test_results_url)
61
41
 
62
- UI.message("Finish Action")
63
- end
42
+ json = JSON.parse(File.read(params[:console_log_file_name]))
43
+ UI.message("Test status: #{json}")
64
44
 
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
45
+ # Fetch results
46
+ download_dir = params[:download_dir]
47
+ if download_dir
48
+ UI.message("Fetch results from Firebase Test Lab results bucket")
49
+ json.each do |status|
50
+ axis = status["axis_value"]
51
+ Helper.if_need_dir("#{download_dir}/#{axis}")
52
+ Helper.copy_from_gcs("#{results_bucket}/#{results_dir}/#{axis}", download_dir)
53
+ Helper.set_public("#{results_bucket}/#{results_dir}/#{axis}")
54
+ end
76
55
  end
56
+
57
+ UI.message("Finish Action")
77
58
  end
78
59
 
79
60
  # Short Detils
@@ -37,6 +37,22 @@ module Fastlane
37
37
  Action.sh("set +e; gcloud #{gcloud_components_channel unless gcloud_components_channel == "stable"} firebase test android run #{arguments}; set -e")
38
38
  end
39
39
 
40
+ def self.run_tests2(gcloud_components_channel, arguments)
41
+ UI.message("Test running...")
42
+
43
+ thread = Thread.new do
44
+ Action.sh("set +e; gcloud #{gcloud_components_channel unless gcloud_components_channel == "stable"} firebase test android run #{arguments}; set -e")
45
+ end
46
+
47
+ while thread.alive?
48
+ # Do something while waiting for the test to complete...
49
+ sleep(10) # wait for a few seconds before checking again.
50
+ end
51
+
52
+ UI.message("Test completed.")
53
+ end
54
+
55
+
40
56
  def self.copy_from_gcs(bucket_and_path, copy_to)
41
57
  UI.message("Copy from gs://#{bucket_and_path}")
42
58
  Action.sh("gsutil -m cp -r gs://#{bucket_and_path} #{copy_to}")
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AndroidTestlabScriptSwit
3
- VERSION = "0.1.38"
3
+ VERSION = "0.1.40"
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.38
4
+ version: 0.1.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - 나비이쁜이