diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-09-25 18:54:08 +0200 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-05 15:42:25 +0200 |
commit | 91f8e734fee1f9e7a16573f7185c48f442e3bb5e (patch) | |
tree | f9eb25a636c95a3bf1bbeaec09b0c36cefc7a7b9 /spec/workers | |
parent | f685c368eaa223035b9458b704cfd6ca768f0f7d (diff) | |
download | gitlab-ce-91f8e734fee1f9e7a16573f7185c48f442e3bb5e.tar.gz |
Add CI build trace sections extractor
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/build_finished_worker_spec.rb | 2 | ||||
-rw-r--r-- | spec/workers/build_trace_sections_worker_spec.rb | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/spec/workers/build_finished_worker_spec.rb b/spec/workers/build_finished_worker_spec.rb index 8cc3f37ebe8..1a7ffd5cdbf 100644 --- a/spec/workers/build_finished_worker_spec.rb +++ b/spec/workers/build_finished_worker_spec.rb @@ -11,6 +11,8 @@ describe BuildFinishedWorker do expect(BuildHooksWorker) .to receive(:new).ordered.and_call_original + expect(BuildTraceSectionsWorker) + .to receive(:perform_async) expect_any_instance_of(BuildCoverageWorker) .to receive(:perform) expect_any_instance_of(BuildHooksWorker) diff --git a/spec/workers/build_trace_sections_worker_spec.rb b/spec/workers/build_trace_sections_worker_spec.rb new file mode 100644 index 00000000000..45243f45547 --- /dev/null +++ b/spec/workers/build_trace_sections_worker_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe BuildTraceSectionsWorker do + describe '#perform' do + context 'when build exists' do + let!(:build) { create(:ci_build) } + + it 'updates trace sections' do + expect_any_instance_of(Ci::Build) + .to receive(:parse_trace_sections!) + + described_class.new.perform(build.id) + end + end + + context 'when build does not exist' do + it 'does not raise exception' do + expect { described_class.new.perform(123) } + .not_to raise_error + end + end + end +end |