Commit c5f5ce88 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken tests

Rename Build to Job

Replace "Builds" by "Jobs" and fix broken specs

Replace "Builds" by "Jobs"

Fix broken spinach test

Fix broken test

Remove `˙` at the beginning of the file

Fix broken spinach test

Fix broken tests

Changes after review
parent 5b0f492b
No related merge requests found
......@@ -180,7 +180,7 @@
<tr>
<th class="environments-name">Environment</th>
<th class="environments-deploy">Last deployment</th>
<th class="environments-build">Build</th>
<th class="environments-build">Job</th>
<th class="environments-commit">Commit</th>
<th class="environments-date">Updated</th>
<th class="hidden-xs environments-actions"></th>
......
......@@ -26,9 +26,9 @@
v-if='actions'
class="dropdown-toggle btn btn-default has-tooltip js-pipeline-dropdown-manual-actions"
data-toggle="dropdown"
title="Manual build"
title="Manual job"
data-placement="top"
aria-label="Manual build"
aria-label="Manual job"
>
<span v-html='svgs.iconPlay' aria-hidden="true"></span>
<i class="fa fa-caret-down" aria-hidden="true"></i>
......
......@@ -204,7 +204,7 @@
.col-sm-10
= f.number_field :max_artifacts_size, class: 'form-control'
.help-block
Set the maximum file size each build's artifacts can have
Set the maximum file size each jobs's artifacts can have
= link_to "(?)", help_page_path("user/admin_area/settings/continuous_integration", anchor: "maximum-artifacts-size")
- if Gitlab.config.registry.enabled
......
......@@ -143,7 +143,7 @@
.key g
.key b
%td
Go to builds
Go to jobs
%tr
%td.shortcut
.key g
......
......@@ -96,8 +96,8 @@
-# Shortcut to builds page
- if project_nav_tab? :builds
%li.hidden
= link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
Builds
= link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
Jobs
-# Shortcut to commits page
- if project_nav_tab? :commits
......
- content_for :header do
%h1{ style: "background: #c40834; color: #FFF; font: normal 20px Helvetica, Arial, sans-serif; margin: 0; padding: 5px 10px; line-height: 32px; font-size: 16px;" }
GitLab (build failed)
GitLab (job failed)
%h3
Project:
......@@ -21,4 +21,4 @@
Message: #{@build.pipeline.git_commit_message}
%p
Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)}
Job details: #{link_to "Job #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)}
Build failed for <%= @project.name %>
Job failed for <%= @project.name %>
Status: <%= @build.status %>
Commit: <%= @build.pipeline.short_sha %>
......
- content_for :header do
%h1{ style: "background: #38CF5B; color: #FFF; font: normal 20px Helvetica, Arial, sans-serif; margin: 0; padding: 5px 10px; line-height: 32px; font-size: 16px;" }
GitLab (build successful)
GitLab (job successful)
%h3
Project:
......@@ -21,4 +21,4 @@
Message: #{@build.pipeline.git_commit_message}
%p
Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)}
Job details: #{link_to "Job #{@build.id}", namespace_project_build_url(@build.project.namespace, @build.project, @build)}
Build successful for <%= @project.name %>
Job successful for <%= @project.name %>
Status: <%= @build.status %>
Commit: <%= @build.pipeline.short_sha %>
......
Build #<%= build.id %> ( <%= pipeline_build_url(pipeline, build) %> )
Job #<%= build.id %> ( <%= pipeline_build_url(pipeline, build) %> )
Build #<%= build.id %>
Job #<%= build.id %>
......@@ -3,6 +3,6 @@
%h4
Customize your workflow!
%p
Get started with GitLab by enabling features that work best for your project. From issues and wikis, to merge requests and builds, GitLab can help manage your workflow from idea to production!
Get started with GitLab by enabling features that work best for your project. From issues and wikis, to merge requests and pipelines, GitLab can help manage your workflow from idea to production!
- if can?(current_user, :admin_project, @project)
= link_to "Get started", edit_project_path(@project), class: "btn btn-success"
- page_title 'Artifacts', "#{@build.name} (##{@build.id})", 'Builds'
- page_title 'Artifacts', "#{@build.name} (##{@build.id})", 'Jobs'
.top-block.row-content-block.clearfix
.pull-right
......
......@@ -17,6 +17,6 @@
= render "user"
= time_ago_with_tooltip(@build.created_at)
- if can?(current_user, :update_build, @build) && @build.retryable?
= link_to "Retry build", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-inverted-secondary pull-right', method: :post
= link_to "Retry job", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'btn btn-inverted-secondary pull-right', method: :post
%button.btn.btn-default.pull-right.visible-xs-block.visible-sm-block.build-gutter-toggle.js-sidebar-build-toggle{ role: "button", type: "button" }
= icon('angle-double-left')
......@@ -44,7 +44,7 @@
.title
Job details
- if can?(current_user, :update_build, @build) && @build.retryable?
= link_to "Retry build", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post
= link_to "Retry job", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right retry-link', method: :post
- if @build.merge_request
%p.build-detail-row
%span.build-light-text Merge Request:
......
......@@ -12,14 +12,14 @@
.bs-callout.bs-callout-warning
%p
- if no_runners_for_project?(@build.project)
This build is stuck, because the project doesn't have any runners online assigned to it.
This job is stuck, because the project doesn't have any runners online assigned to it.
- elsif @build.tags.any?
This build is stuck, because you don't have any active runners online with any of these tags assigned to them:
This job is stuck, because you don't have any active runners online with any of these tags assigned to them:
- @build.tags.each do |tag|
%span.label.label-primary
= tag
- else
This build is stuck, because you don't have any active runners that can run this build.
This job is stuck, because you don't have any active runners that can run this job.
%br
Go to
......
......@@ -32,10 +32,10 @@
= link_to build.short_sha, namespace_project_commit_path(build.project.namespace, build.project, build.sha), class: "commit-id monospace"
- if build.stuck?
= icon('warning', class: 'text-warning has-tooltip', title: 'Build is stuck. Check runners.')
= icon('warning', class: 'text-warning has-tooltip', title: 'Job is stuck. Check runners.')
- if retried
= icon('refresh', class: 'text-warning has-tooltip', title: 'Build was retried')
= icon('refresh', class: 'text-warning has-tooltip', title: 'Job was retried')
.label-container
- if build.tags.any?
......
......@@ -15,7 +15,7 @@
- else
%span.api.monospace API
- if pipeline.latest?
%span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
%span.label.label-success.has-tooltip{ title: 'Latest job for this branch' } latest
- if pipeline.triggered?
%span.label.label-primary triggered
- if pipeline.yaml_errors.present?
......@@ -78,7 +78,7 @@
.btn-group.inline
- if actions.any?
.btn-group
%button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual build', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual build' }
%button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual job', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual job' }
= custom_icon('icon_play')
= icon('caret-down', 'aria-hidden' => 'true')
%ul.dropdown-menu.dropdown-menu-align-right
......
......@@ -13,7 +13,7 @@
Pipeline
= link_to "##{pipeline.id}", namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: "monospace"
with
= pluralize pipeline.statuses.count(:id), "build"
= pluralize pipeline.statuses.count(:id), "job"
- if pipeline.ref
for
= link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace"
......@@ -44,7 +44,7 @@
%thead
%tr
%th Status
%th Build ID
%th Job ID
%th Name
%th
- if pipeline.project.build_coverage_enabled?
......
......@@ -32,7 +32,7 @@
%tr
%th ID
%th Commit
%th Build
%th Job
%th Created
%th.hidden-xs
......
......@@ -21,7 +21,7 @@
.ci_widget{ class: "ci-#{status} ci-status-icon-#{status}", style: "display:none" }
= ci_icon_for_status(status)
%span
CI build
CI job
= ci_label_for_status(status)
for
- commit = @merge_request.diff_head_commit
......
......@@ -16,13 +16,13 @@
gitlab_icon: "#{asset_path 'gitlab_logo.png'}",
ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}",
ci_message: {
normal: "Build {{status}} for \"{{title}}\"",
preparing: "{{status}} build for \"{{title}}\""
normal: "Job {{status}} for \"{{title}}\"",
preparing: "{{status}} job for \"{{title}}\""
},
ci_enable: #{@project.ci_service ? "true" : "false"},
ci_title: {
preparing: "{{status}} build",
normal: "Build {{status}}"
preparing: "{{status}} job",
normal: "Job {{status}}"
},
ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}",
ci_pipeline: #{@merge_request.head_pipeline.try(:id).to_json},
......
%h4
= icon('exclamation-triangle')
The build for this merge request failed
The job for this merge request failed
%p
Please retry the build or push a new commit to fix the failure.
Please retry the job or push a new commit to fix the failure.
......@@ -11,7 +11,7 @@
- if project_nav_tab? :builds
= nav_link(controller: %w(builds)) do
= link_to project_builds_path(@project), title: 'Builds', class: 'shortcuts-builds' do
= link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do
%span
Jobs
......
......@@ -25,7 +25,7 @@
.well-segment.pipeline-info
.icon-container
= icon('clock-o')
= pluralize @pipeline.statuses.count(:id), "build"
= pluralize @pipeline.statuses.count(:id), "job"
- if @pipeline.ref
from
= link_to @pipeline.ref, namespace_project_commits_path(@project.namespace, @project, @pipeline.ref), class: "monospace"
......
......@@ -5,7 +5,7 @@
.col-sm-10
.checkbox
= f.check_box :active
%span.light Paused Runners don't accept new builds
%span.light Paused Runners don't accept new jobs
.form-group
= label :run_untagged, 'Run untagged jobs', class: 'control-label'
.col-sm-10
......
......@@ -2,7 +2,7 @@
.light.prepend-top-default
%p
A 'Runner' is a process which runs a build.
A 'Runner' is a process which runs a job.
You can setup as many Runners as you need.
%br
Runners can be placed on separate users, servers, and even on your local machine.
......
......@@ -67,7 +67,7 @@
In the
%code .gitlab-ci.yml
of another project, include the following snippet.
The project will be rebuilt at the end of the build.
The project will be rebuilt at the end of the job.
%pre
:plain
......@@ -91,7 +91,7 @@
%p.light
Add
%code variables[VARIABLE]=VALUE
to an API request. Variable values can be used to distinguish between triggered builds and normal builds.
to an API request. Variable values can be used to distinguish between triggered jobs and normal jobs.
With cURL:
......
......@@ -5,4 +5,4 @@
%p
So you can use them for passwords, secret keys or whatever you want.
%p
The value of the variable can be visible in build log if explicitly asked to do so.
The value of the variable can be visible in job log if explicitly asked to do so.
......@@ -66,7 +66,7 @@
= f.check_box :build_events, class: 'pull-left'
.prepend-left-20
= f.label :build_events, class: 'list-label' do
%strong Build events
%strong Jobs events
%p.light
This URL will be triggered when the job status changes
%li
......
......@@ -33,7 +33,7 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
step 'recent build summary contains information saying that build has been erased' do
page.within('.erased') do
expect(page).to have_content 'Build has been erased'
expect(page).to have_content 'Job has been erased'
end
end
......
......@@ -34,9 +34,9 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
step 'page should have CI graphs' do
expect(page).to have_content 'Overall'
expect(page).to have_content 'Builds for last week'
expect(page).to have_content 'Builds for last month'
expect(page).to have_content 'Builds for last year'
expect(page).to have_content 'Jobs for last week'
expect(page).to have_content 'Jobs for last month'
expect(page).to have_content 'Jobs for last year'
expect(page).to have_content 'Commit duration in minutes for last 30 commits'
end
......
......@@ -47,7 +47,7 @@ module SharedBuilds
end
step 'recent build has a build trace' do
@build.trace = 'build trace'
@build.trace = 'job trace'
end
step 'download of build artifacts archive starts' do
......@@ -60,7 +60,7 @@ module SharedBuilds
end
step 'I see details of a build' do
expect(page).to have_content "Build ##{@build.id}"
expect(page).to have_content "Job ##{@build.id}"
end
step 'I see build trace' do
......
......@@ -209,7 +209,7 @@ module API
build = get_build!(params[:build_id])
bad_request!("Unplayable Build") unless build.playable?
bad_request!("Unplayable Job") unless build.playable?
build.play(current_user)
......
......@@ -9,8 +9,8 @@ describe 'Admin Builds' do
let(:pipeline) { create(:ci_pipeline) }
context 'All tab' do
context 'when have builds' do
it 'shows all builds' do
context 'when have jobs' do
it 'shows all jobs' do
create(:ci_build, pipeline: pipeline, status: :pending)
create(:ci_build, pipeline: pipeline, status: :running)
create(:ci_build, pipeline: pipeline, status: :success)
......@@ -19,26 +19,26 @@ describe 'Admin Builds' do
visit admin_builds_path
expect(page).to have_selector('.nav-links li.active', text: 'All')
expect(page).to have_selector('.row-content-block', text: 'All builds')
expect(page).to have_selector('.row-content-block', text: 'All jobs')
expect(page.all('.build-link').size).to eq(4)
expect(page).to have_link 'Cancel all'
end
end
context 'when have no builds' do
context 'when have no jobs' do
it 'shows a message' do
visit admin_builds_path
expect(page).to have_selector('.nav-links li.active', text: 'All')
expect(page).to have_content 'No builds to show'
expect(page).to have_content 'No jobs to show'
expect(page).not_to have_link 'Cancel all'
end
end
end
context 'Pending tab' do
context 'when have pending builds' do
it 'shows pending builds' do
context 'when have pending jobs' do
it 'shows pending jobs' do
build1 = create(:ci_build, pipeline: pipeline, status: :pending)
build2 = create(:ci_build, pipeline: pipeline, status: :running)
build3 = create(:ci_build, pipeline: pipeline, status: :success)
......@@ -55,22 +55,22 @@ describe 'Admin Builds' do
end
end
context 'when have no builds pending' do
context 'when have no jobs pending' do
it 'shows a message' do
create(:ci_build, pipeline: pipeline, status: :success)
visit admin_builds_path(scope: :pending)
expect(page).to have_selector('.nav-links li.active', text: 'Pending')
expect(page).to have_content 'No builds to show'
expect(page).to have_content 'No jobs to show'
expect(page).not_to have_link 'Cancel all'
end
end
end
context 'Running tab' do
context 'when have running builds' do
it 'shows running builds' do
context 'when have running jobs' do
it 'shows running jobs' do
build1 = create(:ci_build, pipeline: pipeline, status: :running)
build2 = create(:ci_build, pipeline: pipeline, status: :success)
build3 = create(:ci_build, pipeline: pipeline, status: :failed)
......@@ -87,22 +87,22 @@ describe 'Admin Builds' do
end
end
context 'when have no builds running' do
context 'when have no jobs running' do
it 'shows a message' do
create(:ci_build, pipeline: pipeline, status: :success)
visit admin_builds_path(scope: :running)
expect(page).to have_selector('.nav-links li.active', text: 'Running')
expect(page).to have_content 'No builds to show'
expect(page).to have_content 'No jobs to show'
expect(page).not_to have_link 'Cancel all'
end
end
end
context 'Finished tab' do
context 'when have finished builds' do
it 'shows finished builds' do
context 'when have finished jobs' do
it 'shows finished jobs' do
build1 = create(:ci_build, pipeline: pipeline, status: :pending)
build2 = create(:ci_build, pipeline: pipeline, status: :running)
build3 = create(:ci_build, pipeline: pipeline, status: :success)
......@@ -117,14 +117,14 @@ describe 'Admin Builds' do
end
end
context 'when have no builds finished' do
context 'when have no jobs finished' do
it 'shows a message' do
create(:ci_build, pipeline: pipeline, status: :running)
visit admin_builds_path(scope: :finished)
expect(page).to have_selector('.nav-links li.active', text: 'Finished')
expect(page).to have_content 'No builds to show'
expect(page).to have_content 'No jobs to show'
expect(page).to have_link 'Cancel all'
end
end
......
......@@ -50,7 +50,7 @@ feature 'Only allow merge requests to be merged if the build succeeds', feature:
visit_merge_request(merge_request)
expect(page).not_to have_button 'Accept Merge Request'
expect(page).to have_content('Please retry the build or push a new commit to fix the failure.')
expect(page).to have_content('Please retry the job or push a new commit to fix the failure.')
end
end
......@@ -61,7 +61,7 @@ feature 'Only allow merge requests to be merged if the build succeeds', feature:
visit_merge_request(merge_request)
expect(page).not_to have_button 'Accept Merge Request'
expect(page).to have_content('Please retry the build or push a new commit to fix the failure.')
expect(page).to have_content('Please retry the job or push a new commit to fix the failure.')
end
end
......
......@@ -27,7 +27,7 @@ feature 'Builds', :feature do
visit namespace_project_builds_path(project.namespace, project, scope: :pending)
end
it "shows Pending tab builds" do
it "shows Pending tab jobs" do
expect(page).to have_link 'Cancel running'
expect(page).to have_selector('.nav-links li.active', text: 'Pending')
expect(page).to have_content build.short_sha
......@@ -42,7 +42,7 @@ feature 'Builds', :feature do
visit namespace_project_builds_path(project.namespace, project, scope: :running)
end
it "shows Running tab builds" do
it "shows Running tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'Running')
expect(page).to have_link 'Cancel running'
expect(page).to have_content build.short_sha
......@@ -57,20 +57,20 @@ feature 'Builds', :feature do
visit namespace_project_builds_path(project.namespace, project, scope: :finished)
end
it "shows Finished tab builds" do
it "shows Finished tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'Finished')
expect(page).to have_content 'No builds to show'
expect(page).to have_content 'No jobs to show'
expect(page).to have_link 'Cancel running'
end
end
context "All builds" do
context "All jobs" do
before do
project.builds.running_or_pending.each(&:success)
visit namespace_project_builds_path(project.namespace, project)
end
it "shows All tab builds" do
it "shows All tab jobs" do
expect(page).to have_selector('.nav-links li.active', text: 'All')
expect(page).to have_content build.short_sha
expect(page).to have_content build.ref
......@@ -98,7 +98,7 @@ feature 'Builds', :feature do
end
describe "GET /:project/builds/:id" do
context "Build from project" do
context "Job from project" do
before do
visit namespace_project_build_path(project.namespace, project, build)
end
......@@ -111,7 +111,7 @@ feature 'Builds', :feature do
end
end
context "Build from other project" do
context "Job from other project" do
before do
visit namespace_project_build_path(project.namespace, project, build2)
end
......@@ -149,7 +149,7 @@ feature 'Builds', :feature do
context 'when expire date is defined' do
let(:expire_at) { Time.now + 7.days }
context 'when user has ability to update build' do
context 'when user has ability to update job' do
it 'keeps artifacts when keep button is clicked' do
expect(page).to have_content 'The artifacts will be removed'
......@@ -160,7 +160,7 @@ feature 'Builds', :feature do
end
end
context 'when user does not have ability to update build' do
context 'when user does not have ability to update job' do
let(:user_access_level) { :guest }
it 'does not have keep button' do
......@@ -197,8 +197,8 @@ feature 'Builds', :feature do
visit namespace_project_build_path(project.namespace, project, build)
end
context 'when build has an initial trace' do
it 'loads build trace' do
context 'when job has an initial trace' do
it 'loads job trace' do
expect(page).to have_content 'BUILD TRACE'
build.append_trace(' and more trace', 11)
......@@ -242,32 +242,32 @@ feature 'Builds', :feature do
end
end
context 'when build starts environment' do
context 'when job starts environment' do
let(:environment) { create(:environment, project: project) }
let(:pipeline) { create(:ci_pipeline, project: project) }
context 'build is successfull and has deployment' do
context 'job is successfull and has deployment' do
let(:deployment) { create(:deployment) }
let(:build) { create(:ci_build, :success, environment: environment.name, deployments: [deployment], pipeline: pipeline) }
it 'shows a link for the build' do
it 'shows a link for the job' do
visit namespace_project_build_path(project.namespace, project, build)
expect(page).to have_link environment.name
end
end
context 'build is complete and not successfull' do
context 'job is complete and not successfull' do
let(:build) { create(:ci_build, :failed, environment: environment.name, pipeline: pipeline) }
it 'shows a link for the build' do
it 'shows a link for the job' do
visit namespace_project_build_path(project.namespace, project, build)
expect(page).to have_link environment.name
end
end
context 'build creates a new deployment' do
context 'job creates a new deployment' do
let!(:deployment) { create(:deployment, environment: environment, sha: project.commit.id) }
let(:build) { create(:ci_build, :success, environment: environment.name, pipeline: pipeline) }
......@@ -281,7 +281,7 @@ feature 'Builds', :feature do
end
describe "POST /:project/builds/:id/cancel" do
context "Build from project" do
context "Job from project" do
before do
build.run!
visit namespace_project_build_path(project.namespace, project, build)
......@@ -295,7 +295,7 @@ feature 'Builds', :feature do
end
end
context "Build from other project" do
context "Job from other project" do
before do
build.run!
visit namespace_project_build_path(project.namespace, project, build)
......@@ -307,13 +307,13 @@ feature 'Builds', :feature do
end
describe "POST /:project/builds/:id/retry" do
context "Build from project" do
context "Job from project" do
before do
build.run!
visit namespace_project_build_path(project.namespace, project, build)
click_link 'Cancel'
page.within('.build-header') do
click_link 'Retry build'
click_link 'Retry job'
end
end
......
......@@ -91,10 +91,10 @@ describe 'Pipeline', :feature, :js do
end
end
it 'should be possible to retry the success build' do
it 'should be possible to retry the success job' do
find('#ci-badge-build .ci-action-icon-container').trigger('click')
expect(page).not_to have_content('Retry build')
expect(page).not_to have_content('Retry job')
end
end
......@@ -113,11 +113,11 @@ describe 'Pipeline', :feature, :js do
it 'should be possible to retry the failed build' do
find('#ci-badge-test .ci-action-icon-container').trigger('click')
expect(page).not_to have_content('Retry build')
expect(page).not_to have_content('Retry job')
end
end
context 'when pipeline has manual builds' do
context 'when pipeline has manual jobs' do
it 'shows the skipped icon and a play action for the manual build' do
page.within('#ci-badge-manual-build') do
expect(page).to have_selector('.js-ci-status-icon-manual')
......@@ -129,14 +129,14 @@ describe 'Pipeline', :feature, :js do
end
end
it 'should be possible to play the manual build' do
it 'should be possible to play the manual job' do
find('#ci-badge-manual-build .ci-action-icon-container').trigger('click')
expect(page).not_to have_content('Play build')
expect(page).not_to have_content('Play job')
end
end
context 'when pipeline has external build' do
context 'when pipeline has external job' do
it 'shows the success icon and the generic comit status build' do
expect(page).to have_selector('.js-ci-status-icon-success')
expect(page).to have_content('jenkins')
......@@ -146,12 +146,12 @@ describe 'Pipeline', :feature, :js do
end
context 'page tabs' do
it 'shows Pipeline and Builds tabs with link' do
it 'shows Pipeline and Jobs tabs with link' do
expect(page).to have_link('Pipeline')
expect(page).to have_link('Builds')
expect(page).to have_link('Jobs')
end
it 'shows counter in Builds tab' do
it 'shows counter in Jobs tab' do
expect(page.find('.js-builds-counter').text).to eq(pipeline.statuses.count.to_s)
end
......@@ -160,7 +160,7 @@ describe 'Pipeline', :feature, :js do
end
end
context 'retrying builds' do
context 'retrying jobs' do
it { expect(page).not_to have_content('retried') }
context 'when retrying' do
......@@ -170,7 +170,7 @@ describe 'Pipeline', :feature, :js do
end
end
context 'canceling builds' do
context 'canceling jobs' do
it { expect(page).not_to have_selector('.ci-canceled') }
context 'when canceling' do
......@@ -191,7 +191,7 @@ describe 'Pipeline', :feature, :js do
visit builds_namespace_project_pipeline_path(project.namespace, project, pipeline)
end
it 'shows a list of builds' do
it 'shows a list of jobs' do
expect(page).to have_content('Test')
expect(page).to have_content(build_passed.id)
expect(page).to have_content('Deploy')
......@@ -203,26 +203,26 @@ describe 'Pipeline', :feature, :js do
expect(page).to have_link('Play')
end
it 'shows Builds tab pane as active' do
it 'shows jobs tab pane as active' do
expect(page).to have_css('#js-tab-builds.active')
end
context 'page tabs' do
it 'shows Pipeline and Builds tabs with link' do
it 'shows Pipeline and Jobs tabs with link' do
expect(page).to have_link('Pipeline')
expect(page).to have_link('Builds')
expect(page).to have_link('Jobs')
end
it 'shows counter in Builds tab' do
it 'shows counter in Jobs tab' do
expect(page.find('.js-builds-counter').text).to eq(pipeline.statuses.count.to_s)
end
it 'shows Builds tab as active' do
it 'shows Jobs tab as active' do
expect(page).to have_css('li.js-builds-tab-link.active')
end
end
context 'retrying builds' do
context 'retrying jobs' do
it { expect(page).not_to have_content('retried') }
context 'when retrying' do
......@@ -233,7 +233,7 @@ describe 'Pipeline', :feature, :js do
end
end
context 'canceling builds' do
context 'canceling jobs' do
it { expect(page).not_to have_selector('.ci-canceled') }
context 'when canceling' do
......@@ -244,7 +244,7 @@ describe 'Pipeline', :feature, :js do
end
end
context 'playing manual build' do
context 'playing manual job' do
before do
within '.pipeline-holder' do
click_link('Play')
......
......@@ -11,41 +11,41 @@ feature 'Project settings > Merge Requests', feature: true, js: true do
login_as(user)
end
context 'when Merge Request and Builds are initially enabled' do
context 'when Merge Request and Pipelines are initially enabled' do
before do
project.project_feature.update_attribute('merge_requests_access_level', ProjectFeature::ENABLED)
end
context 'when Builds are initially enabled' do
context 'when Pipelines are initially enabled' do
before do
project.project_feature.update_attribute('builds_access_level', ProjectFeature::ENABLED)
visit edit_project_path(project)
end
scenario 'shows the Merge Requests settings' do
expect(page).to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Disabled', from: "project_project_feature_attributes_merge_requests_access_level"
expect(page).not_to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
end
end
context 'when Builds are initially disabled' do
context 'when Pipelines are initially disabled' do
before do
project.project_feature.update_attribute('builds_access_level', ProjectFeature::DISABLED)
visit edit_project_path(project)
end
scenario 'shows the Merge Requests settings that do not depend on Builds feature' do
expect(page).not_to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_builds_access_level"
expect(page).to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
end
end
......@@ -58,12 +58,12 @@ feature 'Project settings > Merge Requests', feature: true, js: true do
end
scenario 'does not show the Merge Requests settings' do
expect(page).not_to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_merge_requests_access_level"
expect(page).to have_content('Only allow merge requests to be merged if the build succeeds')
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
end
end
......
......@@ -3,7 +3,7 @@
%tr
%th Environment
%th Last deployment
%th Build
%th Job
%th Commit
%th
%th
......
......@@ -484,11 +484,11 @@ describe Ci::Build, :models do
let!(:build) { create(:ci_build, :trace, :success, :artifacts) }
subject { build.erased? }
context 'build has not been erased' do
context 'job has not been erased' do
it { is_expected.to be_falsey }
end
context 'build has been erased' do
context 'job has been erased' do
before do
build.erase
end
......
......@@ -86,7 +86,7 @@ describe API::Builds, api: true do
context 'when commit exists in repository' do
context 'when user is authorized' do
context 'when pipeline has builds' do
context 'when pipeline has jobs' do
before do
create(:ci_pipeline, project: project, sha: project.commit.id)
create(:ci_build, pipeline: pipeline)
......@@ -95,7 +95,7 @@ describe API::Builds, api: true do
get api("/projects/#{project.id}/repository/commits/#{project.commit.id}/builds", api_user)
end
it 'returns project builds for specific commit' do
it 'returns project jobs for specific commit' do
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
expect(json_response.size).to eq 2
......@@ -111,7 +111,7 @@ describe API::Builds, api: true do
end
end
context 'when pipeline has no builds' do
context 'when pipeline has no jobs' do
before do
branch_head = project.commit('feature').id
get api("/projects/#{project.id}/repository/commits/#{branch_head}/builds", api_user)
......@@ -133,7 +133,7 @@ describe API::Builds, api: true do
get api("/projects/#{project.id}/repository/commits/#{project.commit.id}/builds", nil)
end
it 'does not return project builds' do
it 'does not return project jobs' do
expect(response).to have_http_status(401)
expect(json_response.except('message')).to be_empty
end
......@@ -147,7 +147,7 @@ describe API::Builds, api: true do
end
context 'authorized user' do
it 'returns specific build data' do
it 'returns specific job data' do
expect(response).to have_http_status(200)
expect(json_response['name']).to eq('test')
end
......@@ -165,7 +165,7 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not return specific build data' do
it 'does not return specific job data' do
expect(response).to have_http_status(401)
end
end
......@@ -176,7 +176,7 @@ describe API::Builds, api: true do
get api("/projects/#{project.id}/builds/#{build.id}/artifacts", api_user)
end
context 'build with artifacts' do
context 'job with artifacts' do
let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) }
context 'authorized user' do
......@@ -185,7 +185,7 @@ describe API::Builds, api: true do
'Content-Disposition' => 'attachment; filename=ci_build_artifacts.zip' }
end
it 'returns specific build artifacts' do
it 'returns specific job artifacts' do
expect(response).to have_http_status(200)
expect(response.headers).to include(download_headers)
end
......@@ -194,13 +194,13 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not return specific build artifacts' do
it 'does not return specific job artifacts' do
expect(response).to have_http_status(401)
end
end
end
it 'does not return build artifacts if not uploaded' do
it 'does not return job artifacts if not uploaded' do
expect(response).to have_http_status(404)
end
end
......@@ -241,7 +241,7 @@ describe API::Builds, api: true do
end
end
context 'non-existing build' do
context 'non-existing job' do
shared_examples 'not found' do
it { expect(response).to have_http_status(:not_found) }
end
......@@ -254,7 +254,7 @@ describe API::Builds, api: true do
it_behaves_like 'not found'
end
context 'has no such build' do
context 'has no such job' do
before do
get path_for_ref(pipeline.ref, 'NOBUILD')
end
......@@ -263,7 +263,7 @@ describe API::Builds, api: true do
end
end
context 'find proper build' do
context 'find proper job' do
shared_examples 'a valid file' do
let(:download_headers) do
{ 'Content-Transfer-Encoding' => 'binary',
......@@ -311,7 +311,7 @@ describe API::Builds, api: true do
end
context 'authorized user' do
it 'returns specific build trace' do
it 'returns specific job trace' do
expect(response).to have_http_status(200)
expect(response.body).to eq(build.trace)
end
......@@ -320,7 +320,7 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not return specific build trace' do
it 'does not return specific job trace' do
expect(response).to have_http_status(401)
end
end
......@@ -333,7 +333,7 @@ describe API::Builds, api: true do
context 'authorized user' do
context 'user with :update_build persmission' do
it 'cancels running or pending build' do
it 'cancels running or pending job' do
expect(response).to have_http_status(201)
expect(project.builds.first.status).to eq('canceled')
end
......@@ -342,7 +342,7 @@ describe API::Builds, api: true do
context 'user without :update_build permission' do
let(:api_user) { reporter.user }
it 'does not cancel build' do
it 'does not cancel job' do
expect(response).to have_http_status(403)
end
end
......@@ -351,7 +351,7 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not cancel build' do
it 'does not cancel job' do
expect(response).to have_http_status(401)
end
end
......@@ -366,7 +366,7 @@ describe API::Builds, api: true do
context 'authorized user' do
context 'user with :update_build permission' do
it 'retries non-running build' do
it 'retries non-running job' do
expect(response).to have_http_status(201)
expect(project.builds.first.status).to eq('canceled')
expect(json_response['status']).to eq('pending')
......@@ -376,7 +376,7 @@ describe API::Builds, api: true do
context 'user without :update_build permission' do
let(:api_user) { reporter.user }
it 'does not retry build' do
it 'does not retry job' do
expect(response).to have_http_status(403)
end
end
......@@ -385,7 +385,7 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not retry build' do
it 'does not retry job' do
expect(response).to have_http_status(401)
end
end
......@@ -396,23 +396,23 @@ describe API::Builds, api: true do
post api("/projects/#{project.id}/builds/#{build.id}/erase", user)
end
context 'build is erasable' do
context 'job is erasable' do
let(:build) { create(:ci_build, :trace, :artifacts, :success, project: project, pipeline: pipeline) }
it 'erases build content' do
it 'erases job content' do
expect(response.status).to eq 201
expect(build.trace).to be_empty
expect(build.artifacts_file.exists?).to be_falsy
expect(build.artifacts_metadata.exists?).to be_falsy
end
it 'updates build' do
it 'updates job' do
expect(build.reload.erased_at).to be_truthy
expect(build.reload.erased_by).to eq user
end
end
context 'build is not erasable' do
context 'job is not erasable' do
let(:build) { create(:ci_build, :trace, project: project, pipeline: pipeline) }
it 'responds with forbidden' do
......@@ -452,20 +452,20 @@ describe API::Builds, api: true do
post api("/projects/#{project.id}/builds/#{build.id}/play", user)
end
context 'on an playable build' do
context 'on an playable job' do
let(:build) { create(:ci_build, :manual, project: project, pipeline: pipeline) }
it 'plays the build' do
it 'plays the job' do
expect(response).to have_http_status 200
expect(json_response['user']['id']).to eq(user.id)
expect(json_response['id']).to eq(build.id)
end
end
context 'on a non-playable build' do
context 'on a non-playable job' do
it 'returns a status code 400, Bad Request' do
expect(response).to have_http_status 400
expect(response.body).to match("Unplayable Build")
expect(response.body).to match("Unplayable Job")
end
end
end
......
......@@ -288,7 +288,7 @@ describe Ci::API::Builds do
expect(build.reload.trace).to eq 'BUILD TRACE'
end
context 'build has been erased' do
context 'job has been erased' do
let(:build) { create(:ci_build, runner_id: runner.id, erased_at: Time.now) }
it 'responds with forbidden' do
......
......@@ -15,7 +15,7 @@ describe 'projects/builds/show', :view do
allow(view).to receive(:can?).and_return(true)
end
describe 'build information in header' do
describe 'job information in header' do
let(:build) do
create(:ci_build, :success, environment: 'staging')
end
......@@ -28,11 +28,11 @@ describe 'projects/builds/show', :view do
expect(rendered).to have_css('.ci-status.ci-success', text: 'passed')
end
it 'does not render a link to the build' do
it 'does not render a link to the job' do
expect(rendered).not_to have_link('passed')
end
it 'shows build id' do
it 'shows job id' do
expect(rendered).to have_css('.js-build-id', text: build.id)
end
......@@ -45,8 +45,8 @@ describe 'projects/builds/show', :view do
end
end
describe 'environment info in build view' do
context 'build with latest deployment' do
describe 'environment info in job view' do
context 'job with latest deployment' do
let(:build) do
create(:ci_build, :success, environment: 'staging')
end
......@@ -57,7 +57,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'This build is the most recent deployment'
expected_text = 'This job is the most recent deployment'
render
expect(rendered).to have_css(
......@@ -65,7 +65,7 @@ describe 'projects/builds/show', :view do
end
end
context 'build with outdated deployment' do
context 'job with outdated deployment' do
let(:build) do
create(:ci_build, :success, environment: 'staging', pipeline: pipeline)
end
......@@ -87,7 +87,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'This build is an out-of-date deployment ' \
expected_text = 'This job is an out-of-date deployment ' \
"to staging.\nView the most recent deployment ##{second_deployment.iid}."
render
......@@ -95,7 +95,7 @@ describe 'projects/builds/show', :view do
end
end
context 'build failed to deploy' do
context 'job failed to deploy' do
let(:build) do
create(:ci_build, :failed, environment: 'staging', pipeline: pipeline)
end
......@@ -105,7 +105,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'The deployment of this build to staging did not succeed.'
expected_text = 'The deployment of this job to staging did not succeed.'
render
expect(rendered).to have_css(
......@@ -113,7 +113,7 @@ describe 'projects/builds/show', :view do
end
end
context 'build will deploy' do
context 'job will deploy' do
let(:build) do
create(:ci_build, :running, environment: 'staging', pipeline: pipeline)
end
......@@ -124,7 +124,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'This build is creating a deployment to staging'
expected_text = 'This job is creating a deployment to staging'
render
expect(rendered).to have_css(
......@@ -137,7 +137,7 @@ describe 'projects/builds/show', :view do
end
it 'shows that deployment will be overwritten' do
expected_text = 'This build is creating a deployment to staging'
expected_text = 'This job is creating a deployment to staging'
render
expect(rendered).to have_css(
......@@ -150,7 +150,7 @@ describe 'projects/builds/show', :view do
context 'when environment does not exist' do
it 'shows deployment message' do
expected_text = 'This build is creating a deployment to staging'
expected_text = 'This job is creating a deployment to staging'
render
expect(rendered).to have_css(
......@@ -161,7 +161,7 @@ describe 'projects/builds/show', :view do
end
end
context 'build that failed to deploy and environment has not been created' do
context 'job that failed to deploy and environment has not been created' do
let(:build) do
create(:ci_build, :failed, environment: 'staging', pipeline: pipeline)
end
......@@ -171,7 +171,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'The deployment of this build to staging did not succeed'
expected_text = 'The deployment of this job to staging did not succeed'
render
expect(rendered).to have_css(
......@@ -179,7 +179,7 @@ describe 'projects/builds/show', :view do
end
end
context 'build that will deploy and environment has not been created' do
context 'job that will deploy and environment has not been created' do
let(:build) do
create(:ci_build, :running, environment: 'staging', pipeline: pipeline)
end
......@@ -189,7 +189,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'This build is creating a deployment to staging'
expected_text = 'This job is creating a deployment to staging'
render
expect(rendered).to have_css(
......@@ -200,7 +200,7 @@ describe 'projects/builds/show', :view do
end
end
context 'when build is running' do
context 'when job is running' do
before do
build.run!
render
......@@ -211,7 +211,7 @@ describe 'projects/builds/show', :view do
end
end
context 'when build is not running' do
context 'when job is not running' do
before do
build.success!
render
......
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