summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-05 18:58:01 +0000
committerPhil Hughes <me@iamphill.com>2017-05-05 18:58:01 +0000
commit9caa7e7a54a5e3d261f77765868b07117a282a68 (patch)
treeca3c6b9de47499fde1f02aa39edef00deaafcaaa /spec/features
parent240400152242924e75ea81918b5cfdcf2441549c (diff)
parent9f3f22c8959b430811102fb790895e7edd61d3f9 (diff)
downloadgitlab-ce-9caa7e7a54a5e3d261f77765868b07117a282a68.tar.gz
Merge branch '24883-build-failure-summary-page' into 'master'
Build failures summary page for pipelines Closes #24883 See merge request !10719
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb53
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 5a53e48f5f8..cfac54ef259 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -254,4 +254,57 @@ describe 'Pipeline', :feature, :js do
it { expect(build_manual.reload).to be_pending }
end
end
+
+ describe 'GET /:project/pipelines/:id/failures' do
+ let(:project) { create(:project) }
+ let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
+ let(:pipeline_failures_page) { failures_namespace_project_pipeline_path(project.namespace, project, pipeline) }
+ let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline) }
+
+ context 'with failed build' do
+ before do
+ failed_build.trace.set('4 examples, 1 failure')
+
+ visit pipeline_failures_page
+ end
+
+ it 'shows jobs tab pane as active' do
+ expect(page).to have_content('Failed Jobs')
+ expect(page).to have_css('#js-tab-failures.active')
+ end
+
+ it 'lists failed builds' do
+ expect(page).to have_content(failed_build.name)
+ expect(page).to have_content(failed_build.stage)
+ end
+
+ it 'shows build failure logs' do
+ expect(page).to have_content('4 examples, 1 failure')
+ end
+ end
+
+ context 'when missing build logs' do
+ before do
+ visit pipeline_failures_page
+ end
+
+ it 'includes failed jobs' do
+ expect(page).to have_content('No job trace')
+ end
+ end
+
+ context 'without failures' do
+ before do
+ failed_build.update!(status: :success)
+
+ visit pipeline_failures_page
+ end
+
+ it 'displays the pipeline graph' do
+ expect(current_path).to eq(pipeline_path(pipeline))
+ expect(page).not_to have_content('Failed Jobs')
+ expect(page).to have_selector('.pipeline-visualization')
+ end
+ end
+ end
end