diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 06:09:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 06:09:49 +0000 |
commit | 00a8c64ffd18e74df4b1cdeda7776b5221fddafe (patch) | |
tree | 3a5262df3df89455384809bbd45dfb696c48ecde /spec/support | |
parent | b71a496c7a3e109f7c85ad7ac453e6f7bf7cda45 (diff) | |
download | gitlab-ce-00a8c64ffd18e74df4b1cdeda7776b5221fddafe.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/import_export/common_util.rb | 12 |
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 |