Commit 0ac13220 authored by Shinya Maeda's avatar Shinya Maeda

Fix tests by latest proposal changes

parent 335bc0fe
......@@ -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')
......
......@@ -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
......
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'
describe CreateTraceArtifactWorker do
describe ArchiveTraceWorker do
describe '#perform' do
subject { described_class.new.perform(job&.id) }
......
......@@ -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
......
......@@ -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
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