Skip to content
Snippets Groups Projects
Commit 717fdd6d authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Rename Ci::Build commit to pipeline

parent b2acebb4
No related branches found
No related tags found
No related merge requests found
Showing
with 90 additions and 90 deletions
Loading
Loading
@@ -165,7 +165,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
step 'commit has ci status' do
@project.enable_ci
ci_commit = create :ci_commit, project: @project, sha: sample_commit.id
create :ci_build, commit: ci_commit
create :ci_build, pipeline: ci_commit
end
 
step 'repository contains ".gitlab-ci.yml" file' do
Loading
Loading
Loading
Loading
@@ -520,7 +520,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
project = merge_request.source_project
project.enable_ci
ci_commit = create :ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch
create :ci_build, commit: ci_commit
create :ci_build, pipeline: ci_commit
end
 
step 'I should see merge request "Bug NS-05" with CI status' do
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ module SharedBuilds
end
 
step 'project has another build that is running' do
create(:ci_build, commit: @ci_commit, name: 'second build', status: 'running')
create(:ci_build, pipeline: @ci_commit, name: 'second build', status: 'running')
end
 
step 'I visit recent build details page' do
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ FactoryGirl.define do
}
end
 
commit factory: :ci_commit
pipeline factory: :ci_commit
 
trait :success do
status 'success'
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ FactoryGirl.define do
name 'default'
status 'success'
description 'commit status'
commit factory: :ci_commit_with_one_job
pipeline factory: :ci_commit_with_one_job
started_at 'Tue, 26 Jan 2016 08:21:42 +0100'
finished_at 'Tue, 26 Jan 2016 08:23:42 +0100'
 
Loading
Loading
Loading
Loading
@@ -11,10 +11,10 @@ describe 'Admin Builds' do
context 'All tab' do
context 'when have builds' do
it 'shows all builds' do
create(:ci_build, commit: commit, status: :pending)
create(:ci_build, commit: commit, status: :running)
create(:ci_build, commit: commit, status: :success)
create(:ci_build, commit: commit, status: :failed)
create(:ci_build, pipeline: commit, status: :pending)
create(:ci_build, pipeline: commit, status: :running)
create(:ci_build, pipeline: commit, status: :success)
create(:ci_build, pipeline: commit, status: :failed)
 
visit admin_builds_path
 
Loading
Loading
@@ -39,9 +39,9 @@ describe 'Admin Builds' do
context 'Running tab' do
context 'when have running builds' do
it 'shows running builds' do
build1 = create(:ci_build, commit: commit, status: :pending)
build2 = create(:ci_build, commit: commit, status: :success)
build3 = create(:ci_build, commit: commit, status: :failed)
build1 = create(:ci_build, pipeline: commit, status: :pending)
build2 = create(:ci_build, pipeline: commit, status: :success)
build3 = create(:ci_build, pipeline: commit, status: :failed)
 
visit admin_builds_path(scope: :running)
 
Loading
Loading
@@ -55,7 +55,7 @@ describe 'Admin Builds' do
 
context 'when have no builds running' do
it 'shows a message' do
create(:ci_build, commit: commit, status: :success)
create(:ci_build, pipeline: commit, status: :success)
 
visit admin_builds_path(scope: :running)
 
Loading
Loading
@@ -69,9 +69,9 @@ describe 'Admin Builds' do
context 'Finished tab' do
context 'when have finished builds' do
it 'shows finished builds' do
build1 = create(:ci_build, commit: commit, status: :pending)
build2 = create(:ci_build, commit: commit, status: :running)
build3 = create(:ci_build, commit: commit, status: :success)
build1 = create(:ci_build, pipeline: commit, status: :pending)
build2 = create(:ci_build, pipeline: commit, status: :running)
build3 = create(:ci_build, pipeline: commit, status: :success)
 
visit admin_builds_path(scope: :finished)
 
Loading
Loading
@@ -85,7 +85,7 @@ describe 'Admin Builds' do
 
context 'when have no builds finished' do
it 'shows a message' do
create(:ci_build, commit: commit, status: :running)
create(:ci_build, pipeline: commit, status: :running)
 
visit admin_builds_path(scope: :finished)
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe "Admin Runners" do
before do
runner = FactoryGirl.create(:ci_runner)
commit = FactoryGirl.create(:ci_commit)
FactoryGirl.create(:ci_build, commit: commit, runner_id: runner.id)
FactoryGirl.create(:ci_build, pipeline: commit, runner_id: runner.id)
visit admin_runners_path
end
 
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ describe "Builds" do
before do
login_as(:user)
@commit = FactoryGirl.create :ci_commit
@build = FactoryGirl.create :ci_build, commit: @commit
@build = FactoryGirl.create :ci_build, pipeline: @commit
@project = @commit.project
@project.team << [@user, :developer]
end
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe 'Commits' do
end
 
context 'commit status is Generic Commit Status' do
let!(:status) { FactoryGirl.create :generic_commit_status, commit: commit }
let!(:status) { FactoryGirl.create :generic_commit_status, pipeline: commit }
 
before do
project.team << [@user, :reporter]
Loading
Loading
@@ -39,7 +39,7 @@ describe 'Commits' do
end
 
context 'commit status is Ci Build' do
let!(:build) { FactoryGirl.create :ci_build, commit: commit }
let!(:build) { FactoryGirl.create :ci_build, pipeline: commit }
let(:artifacts_file) { fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') }
 
context 'when logged as developer' do
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
 
context "Active build for Merge Request" do
let!(:ci_commit) { create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, commit: ci_commit) }
let!(:ci_build) { create(:ci_build, pipeline: ci_commit) }
 
before do
login_as user
Loading
Loading
@@ -48,7 +48,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end
 
let!(:ci_commit) { create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) }
let!(:ci_build) { create(:ci_build, commit: ci_commit) }
let!(:ci_build) { create(:ci_build, pipeline: ci_commit) }
 
before do
login_as user
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ describe "Pipelines" do
end
 
context 'cancelable pipeline' do
let!(:running) { create(:ci_build, :running, commit: pipeline, stage: 'test', commands: 'test') }
let!(:running) { create(:ci_build, :running, pipeline: pipeline, stage: 'test', commands: 'test') }
 
before { visit namespace_project_pipelines_path(project.namespace, project) }
 
Loading
Loading
@@ -47,7 +47,7 @@ describe "Pipelines" do
end
 
context 'retryable pipelines' do
let!(:failed) { create(:ci_build, :failed, commit: pipeline, stage: 'test', commands: 'test') }
let!(:failed) { create(:ci_build, :failed, pipeline: pipeline, stage: 'test', commands: 'test') }
 
before { visit namespace_project_pipelines_path(project.namespace, project) }
 
Loading
Loading
@@ -64,7 +64,7 @@ describe "Pipelines" do
 
context 'for generic statuses' do
context 'when running' do
let!(:running) { create(:generic_commit_status, status: 'running', commit: pipeline, stage: 'test') }
let!(:running) { create(:generic_commit_status, status: 'running', pipeline: pipeline, stage: 'test') }
 
before { visit namespace_project_pipelines_path(project.namespace, project) }
 
Loading
Loading
@@ -78,7 +78,7 @@ describe "Pipelines" do
end
 
context 'when failed' do
let!(:running) { create(:generic_commit_status, status: 'failed', commit: pipeline, stage: 'test') }
let!(:running) { create(:generic_commit_status, status: 'failed', pipeline: pipeline, stage: 'test') }
 
before { visit namespace_project_pipelines_path(project.namespace, project) }
 
Loading
Loading
@@ -94,7 +94,7 @@ describe "Pipelines" do
 
context 'downloadable pipelines' do
context 'with artifacts' do
let!(:with_artifacts) { create(:ci_build, :artifacts, :success, commit: pipeline, name: 'rspec tests', stage: 'test') }
let!(:with_artifacts) { create(:ci_build, :artifacts, :success, pipeline: pipeline, name: 'rspec tests', stage: 'test') }
 
before { visit namespace_project_pipelines_path(project.namespace, project) }
 
Loading
Loading
@@ -103,7 +103,7 @@ describe "Pipelines" do
end
 
context 'without artifacts' do
let!(:without_artifacts) { create(:ci_build, :success, commit: pipeline, name: 'rspec', stage: 'test') }
let!(:without_artifacts) { create(:ci_build, :success, pipeline: pipeline, name: 'rspec', stage: 'test') }
 
it { expect(page).not_to have_selector('.build-artifacts') }
end
Loading
Loading
@@ -114,10 +114,10 @@ describe "Pipelines" do
let(:pipeline) { create(:ci_commit, project: project, ref: 'master') }
 
before do
@success = create(:ci_build, :success, commit: pipeline, stage: 'build', name: 'build')
@failed = create(:ci_build, :failed, commit: pipeline, stage: 'test', name: 'test', commands: 'test')
@running = create(:ci_build, :running, commit: pipeline, stage: 'deploy', name: 'deploy')
@external = create(:generic_commit_status, status: 'success', commit: pipeline, name: 'jenkins', stage: 'external')
@success = create(:ci_build, :success, pipeline: pipeline, stage: 'build', name: 'build')
@failed = create(:ci_build, :failed, pipeline: pipeline, stage: 'test', name: 'test', commands: 'test')
@running = create(:ci_build, :running, pipeline: pipeline, stage: 'deploy', name: 'deploy')
@external = create(:generic_commit_status, status: 'success', pipeline: pipeline, name: 'jenkins', stage: 'external')
end
 
before { visit namespace_project_pipeline_path(project.namespace, project, pipeline) }
Loading
Loading
Loading
Loading
@@ -143,7 +143,7 @@ describe "Public Project Access", feature: true do
 
describe "GET /:project_path/builds/:id" do
let(:commit) { create(:ci_commit, project: project) }
let(:build) { create(:ci_build, commit: commit) }
let(:build) { create(:ci_build, pipeline: commit) }
subject { namespace_project_build_path(project.namespace, project, build.id) }
 
context "when allowed for public" do
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ describe Ci::Charts, lib: true do
context "build_times" do
before do
@commit = FactoryGirl.create(:ci_commit)
FactoryGirl.create(:ci_build, commit: @commit)
FactoryGirl.create(:ci_build, pipeline: @commit)
end
 
it 'should return build times in minutes' do
Loading
Loading
Loading
Loading
@@ -43,7 +43,7 @@ describe Gitlab::Badge::Build do
 
context 'build exists' do
let(:ci_commit) { create(:ci_commit, project: project, sha: sha, ref: branch) }
let!(:build) { create(:ci_build, commit: ci_commit) }
let!(:build) { create(:ci_build, pipeline: ci_commit) }
 
 
context 'build success' do
Loading
Loading
Loading
Loading
@@ -3,15 +3,15 @@ require 'spec_helper'
describe Ci::Build, models: true do
let(:project) { create(:project) }
let(:commit) { create(:ci_commit, project: project) }
let(:build) { create(:ci_build, commit: commit) }
let(:build) { create(:ci_build, pipeline: commit) }
 
it { is_expected.to validate_presence_of :ref }
 
it { is_expected.to respond_to :trace_html }
 
describe '#first_pending' do
let!(:first) { create(:ci_build, commit: commit, status: 'pending', created_at: Date.yesterday) }
let!(:second) { create(:ci_build, commit: commit, status: 'pending') }
let!(:first) { create(:ci_build, pipeline: commit, status: 'pending', created_at: Date.yesterday) }
let!(:second) { create(:ci_build, pipeline: commit, status: 'pending') }
subject { Ci::Build.first_pending }
 
it { is_expected.to be_a(Ci::Build) }
Loading
Loading
@@ -219,7 +219,7 @@ describe Ci::Build, models: true do
 
context 'and trigger variables' do
let(:trigger) { create(:ci_trigger, project: project) }
let(:trigger_request) { create(:ci_trigger_request_with_variables, commit: commit, trigger: trigger) }
let(:trigger_request) { create(:ci_trigger_request_with_variables, pipeline: commit, trigger: trigger) }
let(:trigger_variables) do
[
{ key: :TRIGGER_KEY, value: 'TRIGGER_VALUE', public: false }
Loading
Loading
@@ -428,10 +428,10 @@ describe Ci::Build, models: true do
end
 
describe '#depends_on_builds' do
let!(:build) { create(:ci_build, commit: commit, name: 'build', stage_idx: 0, stage: 'build') }
let!(:rspec_test) { create(:ci_build, commit: commit, name: 'rspec', stage_idx: 1, stage: 'test') }
let!(:rubocop_test) { create(:ci_build, commit: commit, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, commit: commit, name: 'staging', stage_idx: 2, stage: 'deploy') }
let!(:build) { create(:ci_build, pipeline: commit, name: 'build', stage_idx: 0, stage: 'build') }
let!(:rspec_test) { create(:ci_build, pipeline: commit, name: 'rspec', stage_idx: 1, stage: 'test') }
let!(:rubocop_test) { create(:ci_build, pipeline: commit, name: 'rubocop', stage_idx: 1, stage: 'test') }
let!(:staging) { create(:ci_build, pipeline: commit, name: 'staging', stage_idx: 2, stage: 'deploy') }
 
it 'to have no dependents if this is first build' do
expect(build.depends_on_builds).to be_empty
Loading
Loading
@@ -500,7 +500,7 @@ describe Ci::Build, models: true do
before do
@merge_request = create_mr(build, commit, factory: :merge_request_with_diffs)
commit2 = create(:ci_commit, project: project)
@build2 = create(:ci_build, commit: commit2)
@build2 = create(:ci_build, pipeline: commit2)
 
commits = [double(id: commit.sha), double(id: commit2.sha)]
allow(@merge_request).to receive(:commits).and_return(commits)
Loading
Loading
Loading
Loading
@@ -42,8 +42,8 @@ describe Ci::Pipeline, models: true do
subject { commit.retried }
 
before do
@commit1 = FactoryGirl.create :ci_build, commit: commit, name: 'deploy'
@commit2 = FactoryGirl.create :ci_build, commit: commit, name: 'deploy'
@commit1 = FactoryGirl.create :ci_build, pipeline: commit, name: 'deploy'
@commit2 = FactoryGirl.create :ci_build, pipeline: commit, name: 'deploy'
end
 
it 'returns old builds' do
Loading
Loading
@@ -264,14 +264,14 @@ describe Ci::Pipeline, models: true do
let(:commit) { FactoryGirl.create :ci_commit }
 
it "returns finished_at of latest build" do
build = FactoryGirl.create :ci_build, commit: commit, finished_at: Time.now - 60
FactoryGirl.create :ci_build, commit: commit, finished_at: Time.now - 120
build = FactoryGirl.create :ci_build, pipeline: commit, finished_at: Time.now - 60
FactoryGirl.create :ci_build, pipeline: commit, finished_at: Time.now - 120
 
expect(commit.finished_at.to_i).to eq(build.finished_at.to_i)
end
 
it "returns nil if there is no finished build" do
FactoryGirl.create :ci_not_started_build, commit: commit
FactoryGirl.create :ci_not_started_build, pipeline: commit
 
expect(commit.finished_at).to be_nil
end
Loading
Loading
@@ -282,27 +282,27 @@ describe Ci::Pipeline, models: true do
let(:commit) { FactoryGirl.create :ci_commit, project: project }
 
it "calculates average when there are two builds with coverage" do
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, commit: commit
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, pipeline: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, pipeline: commit
expect(commit.coverage).to eq("35.00")
end
 
it "calculates average when there are two builds with coverage and one with nil" do
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, commit: commit
FactoryGirl.create :ci_build, commit: commit
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, pipeline: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, pipeline: commit
FactoryGirl.create :ci_build, pipeline: commit
expect(commit.coverage).to eq("35.00")
end
 
it "calculates average when there are two builds with coverage and one is retried" do
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, commit: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 30, commit: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, commit: commit
FactoryGirl.create :ci_build, name: "rspec", coverage: 30, pipeline: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 30, pipeline: commit
FactoryGirl.create :ci_build, name: "rubocop", coverage: 40, pipeline: commit
expect(commit.coverage).to eq("35.00")
end
 
it "calculates average when there is one build without coverage" do
FactoryGirl.create :ci_build, commit: commit
FactoryGirl.create :ci_build, pipeline: commit
expect(commit.coverage).to be_nil
end
end
Loading
Loading
@@ -312,7 +312,7 @@ describe Ci::Pipeline, models: true do
 
context 'no failed builds' do
before do
FactoryGirl.create :ci_build, name: "rspec", commit: commit, status: 'success'
FactoryGirl.create :ci_build, name: "rspec", pipeline: commit, status: 'success'
end
 
it 'be not retryable' do
Loading
Loading
@@ -322,8 +322,8 @@ describe Ci::Pipeline, models: true do
 
context 'with failed builds' do
before do
FactoryGirl.create :ci_build, name: "rspec", commit: commit, status: 'running'
FactoryGirl.create :ci_build, name: "rubocop", commit: commit, status: 'failed'
FactoryGirl.create :ci_build, name: "rspec", pipeline: commit, status: 'running'
FactoryGirl.create :ci_build, name: "rubocop", pipeline: commit, status: 'failed'
end
 
it 'be retryable' do
Loading
Loading
@@ -337,8 +337,8 @@ describe Ci::Pipeline, models: true do
subject { CommitStatus.where(commit: [commit, commit2]).stages }
 
before do
FactoryGirl.create :ci_build, commit: commit2, stage: 'test', stage_idx: 1
FactoryGirl.create :ci_build, commit: commit, stage: 'build', stage_idx: 0
FactoryGirl.create :ci_build, pipeline: commit2, stage: 'test', stage_idx: 1
FactoryGirl.create :ci_build, pipeline: commit, stage: 'build', stage_idx: 0
end
 
it 'return all stages' do
Loading
Loading
@@ -353,7 +353,7 @@ describe Ci::Pipeline, models: true do
end
 
context 'dependent objects' do
let(:commit_status) { build :commit_status, commit: commit }
let(:commit_status) { build :commit_status, pipeline: commit }
 
it 'execute update_state after saving dependent object' do
expect(commit).to receive(:update_state).and_return(true)
Loading
Loading
@@ -363,7 +363,7 @@ describe Ci::Pipeline, models: true do
 
context 'update state' do
let(:current) { Time.now.change(usec: 0) }
let(:build) { FactoryGirl.create :ci_build, :success, commit: commit, started_at: current - 120, finished_at: current - 60 }
let(:build) { FactoryGirl.create :ci_build, :success, pipeline: commit, started_at: current - 120, finished_at: current - 60 }
 
before do
build
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ require 'spec_helper'
 
describe CommitStatus, models: true do
let(:commit) { FactoryGirl.create :ci_commit }
let(:commit_status) { FactoryGirl.create :commit_status, commit: commit }
let(:commit_status) { FactoryGirl.create :commit_status, pipeline: commit }
 
it { is_expected.to belong_to(:commit) }
it { is_expected.to belong_to(:user) }
Loading
Loading
@@ -121,11 +121,11 @@ describe CommitStatus, models: true do
subject { CommitStatus.latest.order(:id) }
 
before do
@commit1 = FactoryGirl.create :commit_status, commit: commit, name: 'aa', ref: 'bb', status: 'running'
@commit2 = FactoryGirl.create :commit_status, commit: commit, name: 'cc', ref: 'cc', status: 'pending'
@commit3 = FactoryGirl.create :commit_status, commit: commit, name: 'aa', ref: 'cc', status: 'success'
@commit4 = FactoryGirl.create :commit_status, commit: commit, name: 'cc', ref: 'bb', status: 'success'
@commit5 = FactoryGirl.create :commit_status, commit: commit, name: 'aa', ref: 'bb', status: 'success'
@commit1 = FactoryGirl.create :commit_status, pipeline: commit, name: 'aa', ref: 'bb', status: 'running'
@commit2 = FactoryGirl.create :commit_status, pipeline: commit, name: 'cc', ref: 'cc', status: 'pending'
@commit3 = FactoryGirl.create :commit_status, pipeline: commit, name: 'aa', ref: 'cc', status: 'success'
@commit4 = FactoryGirl.create :commit_status, pipeline: commit, name: 'cc', ref: 'bb', status: 'success'
@commit5 = FactoryGirl.create :commit_status, pipeline: commit, name: 'aa', ref: 'bb', status: 'success'
end
 
it 'return unique statuses' do
Loading
Loading
@@ -137,11 +137,11 @@ describe CommitStatus, models: true do
subject { CommitStatus.running_or_pending.order(:id) }
 
before do
@commit1 = FactoryGirl.create :commit_status, commit: commit, name: 'aa', ref: 'bb', status: 'running'
@commit2 = FactoryGirl.create :commit_status, commit: commit, name: 'cc', ref: 'cc', status: 'pending'
@commit3 = FactoryGirl.create :commit_status, commit: commit, name: 'aa', ref: nil, status: 'success'
@commit4 = FactoryGirl.create :commit_status, commit: commit, name: 'dd', ref: nil, status: 'failed'
@commit5 = FactoryGirl.create :commit_status, commit: commit, name: 'ee', ref: nil, status: 'canceled'
@commit1 = FactoryGirl.create :commit_status, pipeline: commit, name: 'aa', ref: 'bb', status: 'running'
@commit2 = FactoryGirl.create :commit_status, pipeline: commit, name: 'cc', ref: 'cc', status: 'pending'
@commit3 = FactoryGirl.create :commit_status, pipeline: commit, name: 'aa', ref: nil, status: 'success'
@commit4 = FactoryGirl.create :commit_status, pipeline: commit, name: 'dd', ref: nil, status: 'failed'
@commit5 = FactoryGirl.create :commit_status, pipeline: commit, name: 'ee', ref: nil, status: 'canceled'
end
 
it 'return statuses that are running or pending' do
Loading
Loading
@@ -172,10 +172,10 @@ describe CommitStatus, models: true do
 
describe '#stages' do
before do
FactoryGirl.create :commit_status, commit: commit, stage: 'build', stage_idx: 0, status: 'success'
FactoryGirl.create :commit_status, commit: commit, stage: 'build', stage_idx: 0, status: 'failed'
FactoryGirl.create :commit_status, commit: commit, stage: 'deploy', stage_idx: 2, status: 'running'
FactoryGirl.create :commit_status, commit: commit, stage: 'test', stage_idx: 1, status: 'success'
FactoryGirl.create :commit_status, pipeline: commit, stage: 'build', stage_idx: 0, status: 'success'
FactoryGirl.create :commit_status, pipeline: commit, stage: 'build', stage_idx: 0, status: 'failed'
FactoryGirl.create :commit_status, pipeline: commit, stage: 'deploy', stage_idx: 2, status: 'running'
FactoryGirl.create :commit_status, pipeline: commit, stage: 'test', stage_idx: 1, status: 'success'
end
 
context 'stages list' do
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ require 'spec_helper'
 
describe GenericCommitStatus, models: true do
let(:commit) { FactoryGirl.create :ci_commit }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, commit: commit }
let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: commit }
 
describe :context do
subject { generic_commit_status.context }
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ describe API::API, api: true do
let!(:developer) { create(:project_member, :developer, user: user, project: project) }
let!(:reporter) { create(:project_member, :reporter, user: user2, project: project) }
let(:commit) { create(:ci_commit, project: project)}
let(:build) { create(:ci_build, commit: commit) }
let(:build) { create(:ci_build, pipeline: commit) }
 
describe 'GET /projects/:id/builds ' do
let(:query) { '' }
Loading
Loading
@@ -102,7 +102,7 @@ describe API::API, api: true do
before { get api("/projects/#{project.id}/builds/#{build.id}/artifacts", api_user) }
 
context 'build with artifacts' do
let(:build) { create(:ci_build, :artifacts, commit: commit) }
let(:build) { create(:ci_build, :artifacts, pipeline: commit) }
 
context 'authorized user' do
let(:download_headers) do
Loading
Loading
@@ -131,7 +131,7 @@ describe API::API, api: true do
end
 
describe 'GET /projects/:id/builds/:build_id/trace' do
let(:build) { create(:ci_build, :trace, commit: commit) }
let(:build) { create(:ci_build, :trace, pipeline: commit) }
before { get api("/projects/#{project.id}/builds/#{build.id}/trace", api_user) }
 
Loading
Loading
@@ -181,7 +181,7 @@ describe API::API, api: true do
end
 
describe 'POST /projects/:id/builds/:build_id/retry' do
let(:build) { create(:ci_build, :canceled, commit: commit) }
let(:build) { create(:ci_build, :canceled, pipeline: commit) }
 
before { post api("/projects/#{project.id}/builds/#{build.id}/retry", api_user) }
 
Loading
Loading
@@ -218,7 +218,7 @@ describe API::API, api: true do
end
 
context 'build is erasable' do
let(:build) { create(:ci_build, :trace, :artifacts, :success, project: project, commit: commit) }
let(:build) { create(:ci_build, :trace, :artifacts, :success, project: project, pipeline: commit) }
 
it 'should erase build content' do
expect(response.status).to eq 201
Loading
Loading
@@ -234,7 +234,7 @@ describe API::API, api: true do
end
 
context 'build is not erasable' do
let(:build) { create(:ci_build, :trace, project: project, commit: commit) }
let(:build) { create(:ci_build, :trace, project: project, pipeline: commit) }
 
it 'should respond with forbidden' do
expect(response.status).to eq 403
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ describe API::CommitStatuses, api: true do
 
let!(:project) { create(:project) }
let(:commit) { project.repository.commit }
let(:commit_status) { create(:commit_status, commit: ci_commit) }
let(:commit_status) { create(:commit_status, pipeline: ci_commit) }
let(:guest) { create_user(:guest) }
let(:reporter) { create_user(:reporter) }
let(:developer) { create_user(:developer) }
Loading
Loading
@@ -27,7 +27,7 @@ describe API::CommitStatuses, api: true do
let(:statuses_id) { json_response.map { |status| status['id'] } }
 
def create_status(commit, opts = {})
create(:commit_status, { commit: commit, ref: commit.ref }.merge(opts))
create(:commit_status, { pipeline: commit, ref: commit.ref }.merge(opts))
end
 
let!(:status1) { create_status(master, status: 'running') }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment