diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-11-02 19:38:25 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:04:49 +0100 |
commit | c7d945758accc6f80ee63c7c3b25782cf7f6f3b0 (patch) | |
tree | 4d3f5dd8325eee87ab72a3c0269f452a0edacd82 /spec | |
parent | cc750539ec852e9f42ea25b31cc14a45962fc975 (diff) | |
download | gitlab-ce-c7d945758accc6f80ee63c7c3b25782cf7f6f3b0.tar.gz |
Fix most test failures
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/ci/builds.rb | 1 | ||||
-rw-r--r-- | spec/features/projects/pipelines/pipelines_spec.rb | 2 | ||||
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/ci/retry_build_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/tasks/gitlab/backup_rake_spec.rb | 1 |
5 files changed, 6 insertions, 4 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index ee449bfe5db..2ce49ede4fa 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -158,6 +158,7 @@ FactoryGirl.define do after(:create) do |build| create(:ci_job_artifact, job: build) create(:ci_job_metadata, job: build) + build.reload end end diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index a1b1d94ae06..b87b47d0e1a 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -304,7 +304,7 @@ describe 'Pipelines', :js do context 'with artifacts expired' do let!(:with_artifacts_expired) do - create(:ci_build, :artifacts_expired, :success, + create(:ci_build, :expired, :success, pipeline: pipeline, name: 'rspec', stage: 'test') diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 7144b66585c..88d347322a6 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -117,7 +117,7 @@ describe PipelineSerializer do shared_examples 'no N+1 queries' do it 'verifies number of queries', :request_store do recorded = ActiveRecord::QueryRecorder.new { subject } - expect(recorded.count).to be_within(1).of(57) + expect(recorded.count).to be_within(1).of(36) expect(recorded.cached_count).to eq(0) end end diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb index b61d1cb765e..20fe80beade 100644 --- a/spec/services/ci/retry_build_service_spec.rb +++ b/spec/services/ci/retry_build_service_spec.rb @@ -17,7 +17,7 @@ describe Ci::RetryBuildService do %i[id status user token coverage trace runner artifacts_expire_at artifacts_file artifacts_metadata artifacts_size created_at updated_at started_at finished_at queued_at erased_by - erased_at auto_canceled_by].freeze + erased_at auto_canceled_by job_artifacts job_archive job_metadata].freeze IGNORE_ACCESSORS = %i[type lock_version target_url base_tags trace_sections @@ -34,7 +34,7 @@ describe Ci::RetryBuildService do end let(:build) do - create(:ci_build, :failed, :artifacts_expired, :erased, + create(:ci_build, :failed, :artifacts, :expired, :erased, :queued, :coverage, :tags, :allowed_to_fail, :on_tag, :triggered, :trace, :teardown_environment, description: 'my-job', stage: 'test', pipeline: pipeline, diff --git a/spec/tasks/gitlab/backup_rake_spec.rb b/spec/tasks/gitlab/backup_rake_spec.rb index bf2e11bc360..52f81106829 100644 --- a/spec/tasks/gitlab/backup_rake_spec.rb +++ b/spec/tasks/gitlab/backup_rake_spec.rb @@ -24,6 +24,7 @@ describe 'gitlab:app namespace rake task' do # We need this directory to run `gitlab:backup:create` task FileUtils.mkdir_p('public/uploads') + FileUtils.mkdir_p(Rails.root.join('tmp/tests/artifacts')) end before do |