Skip to content

Fix timezone dependant tests

Alessio Caiazza requested to merge fix-timezone-dependant-tests into master

Tests in spec/lib/services/upstream_merge_service_spec.rb are timezone dependant, on CEST they will fail with errors like

  7) Services::UpstreamMergeService#perform when open upstream MR exists when forced when real run (default) behaves like successful MR creation and automatic acceptance returns a successful result object
     Failure/Error:
       merge = UpstreamMerge.new(
         origin: Project::GitlabEe.remotes[:gitlab],
         upstream: Project::GitlabCe.remotes[:gitlab],
         merge_branch: upstream_merge_request.source_branch)
     
       #<UpstreamMerge (class)> received :new with unexpected arguments
         expected: ({:origin=>"git@gitlab.com:gitlab-org/gitlab-ee.git", :upstream=>"git@gitlab.com:gitlab-org/gitlab-ce.git", :merge_branch=>"ce-to-ee-2017-11-15"})
              got: ({:origin=>"git@gitlab.com:gitlab-org/gitlab-ee.git", :upstream=>"git@gitlab.com:gitlab-org/gitlab-ce.git", :merge_branch=>"ce-to-ee-2017-11-14"})
       Diff:
       @@ -1,4 +1,4 @@
        [{:origin=>"git@gitlab.com:gitlab-org/gitlab-ee.git",
          :upstream=>"git@gitlab.com:gitlab-org/gitlab-ce.git",
       -  :merge_branch=>"ce-to-ee-2017-11-15"}]
       +  :merge_branch=>"ce-to-ee-2017-11-14"}]
       
     Shared Example Group: "successful MR creation and automatic acceptance" called from ./spec/lib/services/upstream_merge_service_spec.rb:108
     # ./lib/services/upstream_merge_service.rb:23:in `perform'
     # ./spec/lib/services/upstream_merge_service_spec.rb:64:in `block (3 levels) in <top (required)>'
     # ./spec/lib/services/upstream_merge_service_spec.rb:10:in `block (3 levels) in <top (required)>'
     # ./spec/lib/services/upstream_merge_service_spec.rb:9:in `block (2 levels) in <top (required)>'

Merge request reports