Failures in ee/spec/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy_spec.rb for latest CE upstream

https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/86469980

Failures:

  1) EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy#execute updates the project import_source with the path to import
     Failure/Error: expect(project.reload.import_source).to eq 'path'

       expected: "path"
            got: nil

       (compared using ==)
     # ./ee/spec/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy_spec.rb:31:in `block (3 levels) in <top (required)>'

  2) EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy#execute imports repository
     Failure/Error:
       response.flat_map do |msg|
         msg.paths.map { |d| EncodingHelper.encode!(d.dup) }
       end

     GRPC::NotFound:
       5:GetRepoPath: not a git repository '/builds/gitlab-org/gitlab-ee/tmp/tests/repositories/@hashed/3b/cc/3bcc1340d90b3d55accb9a57998b69708fea2a63c39f7369047469f952ccad4f.git'
     # ./lib/gitlab/gitaly_client/commit_service.rb:18:in `each'
     # ./lib/gitlab/gitaly_client/commit_service.rb:18:in `flat_map'
     # ./lib/gitlab/gitaly_client/commit_service.rb:18:in `ls_files'
     # ./lib/gitlab/git/repository.rb:693:in `ls_files'
     # ./app/models/repository.rb:929:in `ls_files'
     # ./ee/spec/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy_spec.rb:39:in `block (3 levels) in <top (required)>'

Finished in 20 minutes 24 seconds (files took 14.99 seconds to load)
1840 examples, 2 failures

Failed examples:

rspec ./ee/spec/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy_spec.rb:25 # EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy#execute updates the project import_source with the path to import
rspec ./ee/spec/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy_spec.rb:34 # EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportImportStrategy#execute imports repository

The first error is removed (but not fixed) by:

diff --git a/lib/gitlab/template_helper.rb b/lib/gitlab/template_helper.rb
index 3918abaab45..2f07f2ac027 100644
--- a/lib/gitlab/template_helper.rb
+++ b/lib/gitlab/template_helper.rb
@@ -3,6 +3,7 @@ module Gitlab
     include Gitlab::Utils::StrongMemoize
 
     def prepare_template_environment(file)
+      return unless file.respond_to?(:path)
       return unless file&.path.present?
 
       if Gitlab::ImportExport.object_storage?

For some reason, in this test, the method is getting a String when it appears to want something else, maybe one of the CarrierWave file objects? Edit: It's probably just expecting a File object.

The second error persists, I'm still investigating.

Edited Aug 02, 2018 by Robert Speicher
Assignee Loading
Time tracking Loading