diff options
Diffstat (limited to 'spec/support/import_export/common_util.rb')
-rw-r--r-- | spec/support/import_export/common_util.rb | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/spec/support/import_export/common_util.rb b/spec/support/import_export/common_util.rb index 1a5668946c6..0069ae81b76 100644 --- a/spec/support/import_export/common_util.rb +++ b/spec/support/import_export/common_util.rb @@ -15,28 +15,9 @@ module ImportExport export_path = [prefix, 'spec', 'fixtures', 'lib', 'gitlab', 'import_export', name].compact export_path = File.join(*export_path) - 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) - 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) - export_path = [prefix, 'spec', 'fixtures', 'lib', 'gitlab', 'import_export', name].compact - export_path = File.join(*export_path) - - if File.exist?(File.join(export_path, 'tree.tar.gz')) - system("cd #{export_path}; rm -fr tree") - end - end - def setup_reader(reader) if reader == :ndjson_reader && Feature.enabled?(:project_import_ndjson) allow_any_instance_of(Gitlab::ImportExport::JSON::LegacyReader::File).to receive(:exist?).and_return(false) |