diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb index cc4aaffb0a4..83d47ae6819 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/sequence_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Sequence do let_it_be(:user) { create(:user) } let(:pipeline) { build_stubbed(:ci_pipeline) } - let(:command) { Gitlab::Ci::Pipeline::Chain::Command.new } + let(:command) { Gitlab::Ci::Pipeline::Chain::Command.new(project: project) } let(:first_step) { spy('first step') } let(:second_step) { spy('second step') } let(:sequence) { [first_step, second_step] } @@ -71,5 +71,20 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Sequence do expect(histogram).to have_received(:observe) .with({ source: 'push' }, 0) end + + it 'records active jobs by pipeline plan in a histogram' do + allow(command.metrics) + .to receive(:active_jobs_histogram) + .and_return(histogram) + + pipeline = create(:ci_pipeline, project: project, status: :running) + create(:ci_build, :finished, project: project, pipeline: pipeline) + create(:ci_build, :failed, project: project, pipeline: pipeline) + create(:ci_build, :running, project: project, pipeline: pipeline) + subject.build! + + expect(histogram).to have_received(:observe) + .with(hash_including(plan: project.actual_plan_name), 3) + end end end |