diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-03-06 15:40:50 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-03-06 15:44:15 +0300 |
commit | 0ac1322045bd6d069aa74da04df7fb2d2797a3f0 (patch) | |
tree | bec78a5081e9791a47c4122910ca61278ec32621 | |
parent | 335bc0fec05d282e2e4daa0e4a1bcb82ddec0594 (diff) |
Fix tests by latest proposal changes
-rw-r--r-- | spec/migrations/migrate_create_trace_artifact_sidekiq_queue_spec.rb (renamed from spec/migrations/migrate_create_trace_artifact_sidekiq_queue.rb) | 0 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 4 | ||||
-rw-r--r-- | spec/tasks/gitlab/traces_rake_spec.rb | 4 | ||||
-rw-r--r-- | spec/workers/archive_legacy_trace_worker_spec.rb | 30 | ||||
-rw-r--r-- | spec/workers/archive_trace_worker_spec.rb (renamed from spec/workers/create_trace_artifact_worker_spec.rb) | 2 | ||||
-rw-r--r-- | spec/workers/build_finished_worker_spec.rb | 2 | ||||
-rw-r--r-- | spec/workers/concerns/pipeline_background_queue_spec.rb | 2 |
7 files changed, 7 insertions, 37 deletions
diff --git a/spec/migrations/migrate_create_trace_artifact_sidekiq_queue.rb b/spec/migrations/migrate_create_trace_artifact_sidekiq_queue_spec.rb index c18ae3b76d3..c18ae3b76d3 100644 --- a/spec/migrations/migrate_create_trace_artifact_sidekiq_queue.rb +++ b/spec/migrations/migrate_create_trace_artifact_sidekiq_queue_spec.rb diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index ce1311ac97c..95c23726a79 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -698,10 +698,10 @@ describe API::Runner do end end - context 'when tace is given' do + context 'when trace is given' do it 'creates a trace artifact' do allow(BuildFinishedWorker).to receive(:perform_async).with(job.id) do - CreateTraceArtifactWorker.new.perform(job.id) + ArchiveTraceWorker.new.perform(job.id) end update_job(state: 'success', trace: 'BUILD TRACE UPDATED') diff --git a/spec/tasks/gitlab/traces_rake_spec.rb b/spec/tasks/gitlab/traces_rake_spec.rb index d2eaa88f287..bd18e8ffc1e 100644 --- a/spec/tasks/gitlab/traces_rake_spec.rb +++ b/spec/tasks/gitlab/traces_rake_spec.rb @@ -7,7 +7,7 @@ describe 'gitlab:traces rake tasks' do shared_examples 'passes the job id to worker' do it do - expect(ArchiveLegacyTraceWorker).to receive(:bulk_perform_async).with([[job.id]]) + expect(ArchiveTraceWorker).to receive(:bulk_perform_async).with([[job.id]]) run_rake_task('gitlab:traces:archive') end @@ -15,7 +15,7 @@ describe 'gitlab:traces rake tasks' do shared_examples 'does not pass the job id to worker' do it do - expect(ArchiveLegacyTraceWorker).not_to receive(:bulk_perform_async) + expect(ArchiveTraceWorker).not_to receive(:bulk_perform_async) run_rake_task('gitlab:traces:archive') end diff --git a/spec/workers/archive_legacy_trace_worker_spec.rb b/spec/workers/archive_legacy_trace_worker_spec.rb deleted file mode 100644 index 28b247e3058..00000000000 --- a/spec/workers/archive_legacy_trace_worker_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe ArchiveLegacyTraceWorker do - it { is_expected.to be_a(ObjectStorageQueue) } - it { is_expected.not_to be_a(PipelineQueue) } - - describe '#perform' do - subject { described_class.new.perform(job&.id) } - - context 'when job is found' do - let(:job) { create(:ci_build) } - - it 'executes service' do - expect_any_instance_of(Gitlab::Ci::Trace).to receive(:archive!) - - subject - end - end - - context 'when job is not found' do - let(:job) { nil } - - it 'does not execute service' do - expect_any_instance_of(Gitlab::Ci::Trace).not_to receive(:archive!) - - subject - end - end - end -end diff --git a/spec/workers/create_trace_artifact_worker_spec.rb b/spec/workers/archive_trace_worker_spec.rb index 5fc2b183abc..b768588c6e1 100644 --- a/spec/workers/create_trace_artifact_worker_spec.rb +++ b/spec/workers/archive_trace_worker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe CreateTraceArtifactWorker do +describe ArchiveTraceWorker do describe '#perform' do subject { described_class.new.perform(job&.id) } diff --git a/spec/workers/build_finished_worker_spec.rb b/spec/workers/build_finished_worker_spec.rb index c7ff8cf3b92..acd8da11d8d 100644 --- a/spec/workers/build_finished_worker_spec.rb +++ b/spec/workers/build_finished_worker_spec.rb @@ -14,7 +14,7 @@ describe BuildFinishedWorker do expect_any_instance_of(BuildTraceSectionsWorker).to receive(:perform) expect_any_instance_of(BuildCoverageWorker).to receive(:perform) expect(BuildHooksWorker).to receive(:perform_async) - expect(CreateTraceArtifactWorker).to receive(:perform_async) + expect(ArchiveTraceWorker).to receive(:perform_async) described_class.new.perform(build.id) end diff --git a/spec/workers/concerns/pipeline_background_queue_spec.rb b/spec/workers/concerns/pipeline_background_queue_spec.rb index e1ee85ae238..24c0a3c6a20 100644 --- a/spec/workers/concerns/pipeline_background_queue_spec.rb +++ b/spec/workers/concerns/pipeline_background_queue_spec.rb @@ -14,6 +14,6 @@ describe PipelineBackgroundQueue do it 'sets a default object storage queue automatically' do expect(worker.sidekiq_options['queue']) - .to eq 'object_storage:dummy' + .to eq 'pipeline_background:dummy' end end |