diff --git a/CHANGELOG.md b/CHANGELOG.md index 612b99f5f..3b6345627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# TBD + +## Fixes + +- Only zip maze_output if file_log is on [#644](https://github.com/bugsnag/maze-runner/pull/644) + # 9.6.0 - 2024/04/03 ## Enhancements diff --git a/lib/features/support/internal_hooks.rb b/lib/features/support/internal_hooks.rb index afd705b9f..e6ce013bc 100644 --- a/lib/features/support/internal_hooks.rb +++ b/lib/features/support/internal_hooks.rb @@ -238,17 +238,21 @@ def output_received_requests(request_type) # Ensure the logger output is in the correct location Maze::Hooks::LoggerHooks.after_all - maze_output = File.join(Dir.pwd, 'maze_output') - maze_output_zip = File.join(Dir.pwd, 'maze_output.zip') - # zip a folder with files and subfolders - Zip::File.open(maze_output_zip, Zip::File::CREATE) do |zipfile| - Dir["#{maze_output}/**/**"].each do |file| - zipfile.add(file.sub(Dir.pwd + '/', ''), file) + if Maze.config.file_log + # create a zip file from the maze_output directory + maze_output = File.join(Dir.pwd, 'maze_output') + maze_output_zip = File.join(Dir.pwd, 'maze_output.zip') + + # zip a folder with files and subfolders + Zip::File.open(maze_output_zip, Zip::File::CREATE) do |zipfile| + Dir["#{maze_output}/**/**"].each do |file| + zipfile.add(file.sub(Dir.pwd + '/', ''), file) + end end - end - # Move the zip file to the maze_output folder - FileUtils.mv(maze_output_zip, maze_output) + # Move the zip file to the maze_output folder + FileUtils.mv(maze_output_zip, maze_output) + end metrics = Maze::MetricsProcessor.new(Maze::Server.metrics) metrics.process