Commit 227c4154 authored by Shinya Maeda's avatar Shinya Maeda

Fix tests by latest proposal changes

parent 698d239c
...@@ -700,10 +700,10 @@ describe API::Runner do ...@@ -700,10 +700,10 @@ describe API::Runner do
end end
end end
context 'when tace is given' do context 'when trace is given' do
it 'creates a trace artifact' do it 'creates a trace artifact' do
allow(BuildFinishedWorker).to receive(:perform_async).with(job.id) do allow(BuildFinishedWorker).to receive(:perform_async).with(job.id) do
CreateTraceArtifactWorker.new.perform(job.id) ArchiveTraceWorker.new.perform(job.id)
end end
update_job(state: 'success', trace: 'BUILD TRACE UPDATED') update_job(state: 'success', trace: 'BUILD TRACE UPDATED')
......
...@@ -7,7 +7,7 @@ describe 'gitlab:traces rake tasks' do ...@@ -7,7 +7,7 @@ describe 'gitlab:traces rake tasks' do
shared_examples 'passes the job id to worker' do shared_examples 'passes the job id to worker' do
it 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') run_rake_task('gitlab:traces:archive')
end end
...@@ -15,7 +15,7 @@ describe 'gitlab:traces rake tasks' do ...@@ -15,7 +15,7 @@ describe 'gitlab:traces rake tasks' do
shared_examples 'does not pass the job id to worker' do shared_examples 'does not pass the job id to worker' do
it 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') run_rake_task('gitlab:traces:archive')
end end
......
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
require 'spec_helper' require 'spec_helper'
describe CreateTraceArtifactWorker do describe ArchiveTraceWorker do
describe '#perform' do describe '#perform' do
subject { described_class.new.perform(job&.id) } subject { described_class.new.perform(job&.id) }
......
...@@ -14,7 +14,7 @@ describe BuildFinishedWorker do ...@@ -14,7 +14,7 @@ describe BuildFinishedWorker do
expect_any_instance_of(BuildTraceSectionsWorker).to receive(:perform) expect_any_instance_of(BuildTraceSectionsWorker).to receive(:perform)
expect_any_instance_of(BuildCoverageWorker).to receive(:perform) expect_any_instance_of(BuildCoverageWorker).to receive(:perform)
expect(BuildHooksWorker).to receive(:perform_async) expect(BuildHooksWorker).to receive(:perform_async)
expect(CreateTraceArtifactWorker).to receive(:perform_async) expect(ArchiveTraceWorker).to receive(:perform_async)
described_class.new.perform(build.id) described_class.new.perform(build.id)
end end
......
...@@ -14,6 +14,6 @@ describe PipelineBackgroundQueue do ...@@ -14,6 +14,6 @@ describe PipelineBackgroundQueue do
it 'sets a default object storage queue automatically' do it 'sets a default object storage queue automatically' do
expect(worker.sidekiq_options['queue']) expect(worker.sidekiq_options['queue'])
.to eq 'object_storage:dummy' .to eq 'pipeline_background:dummy'
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment