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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac05a3cb02ce74a34b2aa3795c6543287aa6e2da4c7df8ab8405a3b284fa1fca
|
4
|
+
data.tar.gz: 5707540ccf5c2b38602ddaf0578759eb5e17b89b0bbbb6c5e30b65b71682d234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee8ad34c894b2e6d4323dcfb6ec73121c712c01668bcffe18f4ffe07ea3080553c1f5a7c04a421ced60a129a717c1f87f9b3459df96a4d0d3122f851efeac0c5
|
7
|
+
data.tar.gz: 542e117d09c7ad829ed94d79cd5429070caffe375fd26c16fa21b4c5bd6438ed9bc02571a1e3ca16bc0071224c379a8e99fc34323784911b3849e224e27cb48c
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -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
|
-
|
40
|
-
swit_webhook_payload = params[:swit_webhook_payload]
|
40
|
+
wait_for_test_to_complete(test_results_url)
|
41
41
|
|
42
|
-
|
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
|