fastlane-plugin-android_testlab_script_swit 0.1.36 → 0.1.37
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: 5c022838ee298ef493126bee4d45b3f57189b067498ace65b91e82e282de84ba
|
4
|
+
data.tar.gz: 6739c6875e6b390e16ed55f13cc7f23a8f73f32b9c71290c229abad624d548df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 610d1881b5e91edfe3dc2c45209b611009495c91338a4fcdd2db6217e0c0be78db0d7bc93f3d77a331fbf2852cdafcc7ac88c827e7bdf14642a076821326ace2
|
7
|
+
data.tar.gz: afd6ff095e267d2e73409a4182c76792bb2718a8d2a95241869035c0f8d70d848f399554d61e0c5d9343b882a43fef654a453602f7ead2cfc7279febd9498e18
|
data/lib/fastlane/plugin/android_testlab_script_swit/actions/android_testlab_script_swit_action.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'fastlane/action'
|
2
2
|
require 'json'
|
3
3
|
require 'fileutils'
|
4
|
+
require 'httparty'
|
5
|
+
require 'open-uri'
|
4
6
|
|
5
7
|
module Fastlane
|
6
8
|
module Actions
|
@@ -23,7 +25,7 @@ module Fastlane
|
|
23
25
|
robo_script_option = params[:robo_script_path].nil? ? "" : "--robo-script #{params[:robo_script_path]} "
|
24
26
|
|
25
27
|
# Run Firebase Test Lab
|
26
|
-
Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
28
|
+
result_url = Helper.run_tests(params[:gcloud_components_channel], "--type #{params[:type]} "\
|
27
29
|
"--app #{params[:app_apk]} "\
|
28
30
|
"#{"--test #{params[:app_test_apk]} " unless params[:app_test_apk].nil?}"\
|
29
31
|
"#{"--use-orchestrator " if params[:type] == "instrumentation" && params[:use_orchestrator]}"\
|
@@ -36,6 +38,8 @@ module Fastlane
|
|
36
38
|
"--format=json 1>#{Helper.if_need_dir(params[:console_log_file_name])}"
|
37
39
|
)
|
38
40
|
|
41
|
+
wait_for_test_to_complete(test_results_url)
|
42
|
+
|
39
43
|
swit_webhook_url = params[:swit_webhook_url]
|
40
44
|
swit_webhook_payload = params[:swit_webhook_payload]
|
41
45
|
|
@@ -59,6 +63,20 @@ module Fastlane
|
|
59
63
|
UI.message("Finish Action")
|
60
64
|
end
|
61
65
|
|
66
|
+
def wait_for_test_to_complete(url)
|
67
|
+
require 'open-uri'
|
68
|
+
|
69
|
+
loop do
|
70
|
+
html = open(url).read
|
71
|
+
|
72
|
+
if html.include?("Test is complete")
|
73
|
+
break
|
74
|
+
else
|
75
|
+
sleep(10) # wait for a few seconds before checking again.
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
62
80
|
# Short Detils
|
63
81
|
def self.description
|
64
82
|
"Android Firebase TestLab with Robo Script Test"
|
@@ -260,10 +278,24 @@ module Fastlane
|
|
260
278
|
platform == :android
|
261
279
|
end
|
262
280
|
|
281
|
+
#
|
263
282
|
def self.output
|
264
283
|
[['console_output.log', 'A console log when running Firebase Test Lab with gcloud']]
|
265
284
|
end
|
266
285
|
|
286
|
+
#
|
287
|
+
def wait_for_test_to_complete(url)
|
288
|
+
loop do
|
289
|
+
html = open(url).read
|
290
|
+
|
291
|
+
if html.include?("TestLab is complete")
|
292
|
+
break
|
293
|
+
else
|
294
|
+
sleep(10) # wait for 10 seconds before checking again
|
295
|
+
end
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
267
299
|
def self.example_code
|
268
300
|
|
269
301
|
end
|