summaryrefslogtreecommitdiff
path: root/spec/support/import_export/common_util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/import_export/common_util.rb')
-rw-r--r--spec/support/import_export/common_util.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/support/import_export/common_util.rb b/spec/support/import_export/common_util.rb
index 16762f32d8b..4e287f36648 100644
--- a/spec/support/import_export/common_util.rb
+++ b/spec/support/import_export/common_util.rb
@@ -15,15 +15,17 @@ module ImportExport
export_path = [prefix, 'spec', 'fixtures', 'lib', 'gitlab', 'import_export', name].compact
export_path = File.join(*export_path)
- extract_archive(export_path, 'tree.tar.gz')
+ if File.exist?(File.join(export_path, 'tree.tar.gz'))
+ extract_archive(export_path, 'tree.tar.gz')
+ end
allow_any_instance_of(Gitlab::ImportExport).to receive(:export_path) { export_path }
end
def extract_archive(path, archive)
- if File.exist?(File.join(path, archive))
- system("cd #{path}; tar xzvf #{archive} &> /dev/null")
- end
+ output, exit_status = Gitlab::Popen.popen(["cd #{path}; tar xzf #{archive}"])
+
+ raise "Failed to extract archive. Output: #{output}" unless exit_status.zero?
end
def cleanup_artifacts_from_extract_archive(name, prefix = nil)
@@ -31,7 +33,7 @@ module ImportExport
export_path = File.join(*export_path)
if File.exist?(File.join(export_path, 'tree.tar.gz'))
- system("cd #{export_path}; rm -fr tree &> /dev/null")
+ system("cd #{export_path}; rm -fr tree")
end
end