bugsnag-maze-runner 8.12.1 → 8.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/download-logs +3 -0
- data/bin/maze-runner +3 -0
- data/bin/purge-projects +3 -0
- data/bin/upload-app +3 -0
- data/lib/maze/api/exit_code.rb +1 -0
- data/lib/maze/client/appium/bb_devices.rb +2 -1
- data/lib/maze/client/bb_client_utils.rb +44 -24
- data/lib/maze/retry_handler.rb +8 -2
- data/lib/maze.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8edd9312852fa9f431bf8b2ed42473a111eec241ca23a4b5993121a64b4bfddc
|
4
|
+
data.tar.gz: 836546b1088e2d66727d062009748cc88ead618e9ec90e851ca87541cbad5b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8574f48c04eb96a0821fef71e041b39399f9aa65e07add2745aa64aa1b66de3819369a41c88b2b9a2583df3ceb31bca4bd90ef6e086368adb1333a7b5c12ec7
|
7
|
+
data.tar.gz: 8f4ed901c5e5b08cbba9c4bc7183aae1c20c0a8f769161956844f177e90c2014f8e1d829369ba2a62130c2f48c55ba86eb2265cfc8e42a5a64a9fe31c4f513a0
|
data/bin/download-logs
CHANGED
data/bin/maze-runner
CHANGED
data/bin/purge-projects
CHANGED
data/bin/upload-app
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
# Workaround for running on ARM macOS machines
|
5
|
+
require 'em/pure_ruby'
|
6
|
+
|
4
7
|
require_relative '../lib/maze'
|
5
8
|
require_relative '../lib/maze/client/bs_client_utils'
|
6
9
|
require_relative '../lib/maze/client/bb_client_utils'
|
data/lib/maze/api/exit_code.rb
CHANGED
@@ -96,7 +96,8 @@ module Maze
|
|
96
96
|
appium_options = {
|
97
97
|
'automationName' => 'UiAutomator2',
|
98
98
|
'autoGrantPermissions' => true,
|
99
|
-
'uiautomator2ServerInstallTimeout' => 60000
|
99
|
+
'uiautomator2ServerInstallTimeout' => 60000,
|
100
|
+
'uiautomator2ServerLaunchTimeout' => 60000
|
100
101
|
}
|
101
102
|
hash = {
|
102
103
|
'platformName' => 'Android',
|
@@ -19,41 +19,61 @@ module Maze
|
|
19
19
|
# @param api_key [String] The BitBar API key
|
20
20
|
# @param app [String] A path to the application file
|
21
21
|
# @param app_id_file [String] the file to write the uploaded app url to BitBar
|
22
|
-
|
22
|
+
# @param max_attempts [Integer] the maximum number of attempts to upload the app
|
23
|
+
def upload_app(api_key, app, app_id_file=nil, max_attempts=5)
|
23
24
|
uuid_regex = /\A[0-9]+\z/
|
24
25
|
|
25
26
|
if uuid_regex.match? app
|
26
27
|
$logger.info "Using pre-uploaded app with ID #{app}"
|
27
28
|
app_uuid = app
|
28
29
|
else
|
29
|
-
|
30
|
-
|
30
|
+
upload_proc = Proc.new do |app_path|
|
31
|
+
$logger.info "Uploading app: #{app_path}"
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
# Upload the app to BitBar
|
34
|
+
uri = URI('https://cloud.bitbar.com/api/me/files')
|
35
|
+
request = Net::HTTP::Post.new(uri)
|
36
|
+
request.basic_auth(api_key, '')
|
37
|
+
request.set_form({ 'file' => File.new(app_path, 'rb') }, 'multipart/form-data')
|
37
38
|
|
38
|
-
|
39
|
-
|
39
|
+
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
40
|
+
http.request(request)
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
expanded_app = Maze::Helper.expand_path(app)
|
45
|
+
|
46
|
+
attempts = 0
|
47
|
+
app_uuid = nil
|
48
|
+
last_error = nil
|
49
|
+
while attempts < max_attempts && app_uuid.nil?
|
50
|
+
attempts += 1
|
51
|
+
begin
|
52
|
+
response = upload_proc.call(expanded_app)
|
53
|
+
body = JSON.parse(response.body)
|
54
|
+
if body.key?('id')
|
55
|
+
app_uuid = body['id'].to_s
|
56
|
+
$logger.info "Uploaded app ID: #{app_uuid}"
|
57
|
+
$logger.info 'You can use this ID to avoid uploading the same app more than once.'
|
58
|
+
else
|
59
|
+
error_string = "Unexpected response body: #{body}"
|
60
|
+
$logger.error error_string
|
61
|
+
last_error = RuntimeError.new(error_string)
|
62
|
+
end
|
63
|
+
rescue JSON::ParserError => error
|
64
|
+
last_error = error
|
65
|
+
Bugsnag.notify error
|
66
|
+
$logger.error "Expected JSON response, received: #{response}"
|
67
|
+
rescue => error
|
68
|
+
last_error = error
|
69
|
+
Bugsnag.notify error
|
70
|
+
$logger.error "Unexpected error uploading app: #{error}"
|
52
71
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
72
|
+
end
|
73
|
+
|
74
|
+
if app_uuid.nil?
|
75
|
+
$logger.error "App upload to BitBar failed after #{attempts} attempts"
|
76
|
+
raise last_error
|
57
77
|
end
|
58
78
|
end
|
59
79
|
|
data/lib/maze/retry_handler.rb
CHANGED
@@ -20,10 +20,16 @@ module Maze
|
|
20
20
|
return false if !Maze.config.enable_retries || retried_previously?(test_case)
|
21
21
|
|
22
22
|
if retry_on_driver_error?(event)
|
23
|
-
$logger.warn "Retrying #{test_case.name} due to driver error: #{event.result.exception}"
|
24
23
|
if Maze.driver.is_a?(Maze::Driver::Appium)
|
25
|
-
Maze.
|
24
|
+
if Maze.config.farm.eql?(:bb)
|
25
|
+
Maze::Hooks::ErrorCodeHook.exit_code = Maze::Api::ExitCode::APPIUM_SESSION_FAILURE
|
26
|
+
return false
|
27
|
+
else
|
28
|
+
$logger.warn "Retrying #{test_case.name} due to appium driver error: #{event.result.exception}"
|
29
|
+
Maze.driver.restart
|
30
|
+
end
|
26
31
|
elsif Maze.driver.is_a?(Maze::Driver::Browser)
|
32
|
+
$logger.warn "Retrying #{test_case.name} due to selenium driver error: #{event.result.exception}"
|
27
33
|
Maze.driver.refresh
|
28
34
|
end
|
29
35
|
elsif retry_on_tag?(test_case)
|
data/lib/maze.rb
CHANGED
@@ -7,7 +7,7 @@ require_relative 'maze/timers'
|
|
7
7
|
# Glues the various parts of MazeRunner together that need to be accessed globally,
|
8
8
|
# providing an alternative to the proliferation of global variables or singletons.
|
9
9
|
module Maze
|
10
|
-
VERSION = '8.
|
10
|
+
VERSION = '8.13.1'
|
11
11
|
|
12
12
|
class << self
|
13
13
|
attr_accessor :check, :driver, :internal_hooks, :mode, :start_time, :dynamic_retry, :public_address,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag-maze-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Kirkland
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -448,11 +448,11 @@ files:
|
|
448
448
|
- lib/maze/wait.rb
|
449
449
|
- lib/utils/deep_merge.rb
|
450
450
|
- lib/utils/selenium_money_patch.rb
|
451
|
-
homepage:
|
451
|
+
homepage:
|
452
452
|
licenses:
|
453
453
|
- MIT
|
454
454
|
metadata: {}
|
455
|
-
post_install_message:
|
455
|
+
post_install_message:
|
456
456
|
rdoc_options: []
|
457
457
|
require_paths:
|
458
458
|
- lib
|
@@ -468,7 +468,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
468
468
|
version: '0'
|
469
469
|
requirements: []
|
470
470
|
rubygems_version: 3.1.6
|
471
|
-
signing_key:
|
471
|
+
signing_key:
|
472
472
|
specification_version: 4
|
473
473
|
summary: Bugsnag API request validation harness
|
474
474
|
test_files: []
|