bugsnag-maze-runner 9.6.0 → 9.7.0
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 +4 -4
- data/lib/features/support/internal_hooks.rb +13 -9
- data/lib/maze/server.rb +6 -0
- data/lib/maze/servlets/command_servlet.rb +26 -15
- data/lib/maze.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f948d5bf3980cb7514127f60fbecb2ffdb4484c8d19a484e39ebccaaaebda535
|
4
|
+
data.tar.gz: efb5c22b4c81824d63c2762ea0792ad6316dc8744660042b4c1d6357eb8b7a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 100b68e6b60360ea1a0bad3eb51c2b7e28fce9328e0ebc5a8bfeba089621714cfb834d7c4ae568f4c88c7399ff2e2b0fef351cbf8dd97397b3fb4da5cd39644b
|
7
|
+
data.tar.gz: ba9d6bbf2e966981d14be78688c119967278d662b5c0cc166fedba5302c829a3e9b2e93a0c4dfefc30893c5a9cebd09e1f7408de7c71ee7986d3fe89995eb748
|
@@ -238,17 +238,21 @@ AfterAll do
|
|
238
238
|
# Ensure the logger output is in the correct location
|
239
239
|
Maze::Hooks::LoggerHooks.after_all
|
240
240
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
241
|
+
if Maze.config.file_log
|
242
|
+
# create a zip file from the maze_output directory
|
243
|
+
maze_output = File.join(Dir.pwd, 'maze_output')
|
244
|
+
maze_output_zip = File.join(Dir.pwd, 'maze_output.zip')
|
245
|
+
|
246
|
+
# zip a folder with files and subfolders
|
247
|
+
Zip::File.open(maze_output_zip, Zip::File::CREATE) do |zipfile|
|
248
|
+
Dir["#{maze_output}/**/**"].each do |file|
|
249
|
+
zipfile.add(file.sub(Dir.pwd + '/', ''), file)
|
250
|
+
end
|
247
251
|
end
|
248
|
-
end
|
249
252
|
|
250
|
-
|
251
|
-
|
253
|
+
# Move the zip file to the maze_output folder
|
254
|
+
FileUtils.mv(maze_output_zip, maze_output)
|
255
|
+
end
|
252
256
|
|
253
257
|
metrics = Maze::MetricsProcessor.new(Maze::Server.metrics)
|
254
258
|
metrics.process
|
data/lib/maze/server.rb
CHANGED
@@ -15,6 +15,12 @@ module Maze
|
|
15
15
|
DEFAULT_STATUS_CODE = 200
|
16
16
|
|
17
17
|
class << self
|
18
|
+
|
19
|
+
# Records the previous command UUID sent to the test fixture
|
20
|
+
#
|
21
|
+
# @return [String] The UUID of the last command sent
|
22
|
+
attr_accessor :last_command_uuid
|
23
|
+
|
18
24
|
# Sets the response delay generator.
|
19
25
|
#
|
20
26
|
# @param generator [Maze::Generator] The new generator
|
@@ -19,17 +19,7 @@ module Maze
|
|
19
19
|
|
20
20
|
if request.query.empty?
|
21
21
|
# Non-idempotent mode - return the "current" command
|
22
|
-
|
23
|
-
|
24
|
-
if commands.size_remaining == 0
|
25
|
-
response.body = NOOP_COMMAND
|
26
|
-
response.status = 200
|
27
|
-
else
|
28
|
-
command = commands.current
|
29
|
-
response.body = JSON.pretty_generate(command)
|
30
|
-
response.status = 200
|
31
|
-
commands.next
|
32
|
-
end
|
22
|
+
send_current_command(response)
|
33
23
|
else
|
34
24
|
# Idempotent mode
|
35
25
|
after_uuid = request.query['after']
|
@@ -44,6 +34,21 @@ module Maze
|
|
44
34
|
response.header['Access-Control-Allow-Origin'] = '*'
|
45
35
|
end
|
46
36
|
|
37
|
+
def send_current_command(response)
|
38
|
+
commands = Maze::Server.commands
|
39
|
+
|
40
|
+
if commands.size_remaining == 0
|
41
|
+
response.body = NOOP_COMMAND
|
42
|
+
response.status = 200
|
43
|
+
else
|
44
|
+
command = commands.current
|
45
|
+
Server.last_command_uuid = command[:uuid]
|
46
|
+
response.body = JSON.pretty_generate(command)
|
47
|
+
response.status = 200
|
48
|
+
commands.next
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
47
52
|
def command_after(uuid, response)
|
48
53
|
commands = Maze::Server.commands
|
49
54
|
if uuid.empty?
|
@@ -52,14 +57,20 @@ module Maze
|
|
52
57
|
index = commands.all.find_index {|command| command[:uuid] == uuid }
|
53
58
|
end
|
54
59
|
if index.nil?
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
60
|
+
# If the UUID given matches the last UUID sent by the server, we can assume the fixture has failed to reset
|
61
|
+
if uuid.eql?(Server.last_command_uuid)
|
62
|
+
send_current_command(response)
|
63
|
+
else
|
64
|
+
msg = "Request invalid - there is no command with a UUID of #{uuid} to follow on from"
|
65
|
+
$logger.error msg
|
66
|
+
response.body = msg
|
67
|
+
response.status = 400
|
68
|
+
end
|
59
69
|
else
|
60
70
|
if index + 1 < commands.size_all
|
61
71
|
# Respond with the next command in the queue
|
62
72
|
command = commands.get(index + 1)
|
73
|
+
Server.last_command_uuid = command[:uuid]
|
63
74
|
command_json = JSON.pretty_generate(command)
|
64
75
|
response.body = command_json
|
65
76
|
response.status = 200
|
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 = '9.
|
10
|
+
VERSION = '9.7.0'
|
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: 9.
|
4
|
+
version: 9.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Kirkland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|