diff options
author | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-12-14 11:24:45 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-12-14 12:25:37 +0100 |
commit | 32d83ee79fedc8760486ff40a2459ecb472fa51b (patch) | |
tree | 46b8032b6bcbfd1482707a9080e6538bf44faa1c /spec/features | |
parent | b8f67c5e4735eb25a3d03daeb95900dc87692123 (diff) | |
parent | c81023435795766411c5954a4676ebb215af40a6 (diff) | |
download | gitlab-ce-32d83ee79fedc8760486ff40a2459ecb472fa51b.tar.gz |
Merge branch 'master' into ux/suppress-ci-yml-warning
* master: (24 commits)
Fix runners admin view
Fix migrations
Run builds from projects with enabled CI
Use Gitlab::Git instead of Ci::Git
Fix last specs
Fix specs
Fix after column rename
Fix errors
Update badge
Finishing touches
Fix triggers tests
Rename columns and rename migrations
Reimplement Trigger API
Remove ci_ prefix from all ci related things
Add runners token
Migrate CI::Project to Project
Fix indentation and BuildsEmailService
Change default values
Enhance migrate CI emails
Fix issue tracker service
...
Conflicts:
spec/features/commits_spec.rb
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/atom/builds_spec.rb (renamed from spec/features/ci/admin/builds_spec.rb) | 35 | ||||
-rw-r--r-- | spec/features/atom/runners_spec.rb (renamed from spec/features/ci/admin/runners_spec.rb) | 10 | ||||
-rw-r--r-- | spec/features/builds_spec.rb | 24 | ||||
-rw-r--r-- | spec/features/ci/admin/events_spec.rb | 20 | ||||
-rw-r--r-- | spec/features/ci/admin/projects_spec.rb | 19 | ||||
-rw-r--r-- | spec/features/ci_settings_spec.rb | 22 | ||||
-rw-r--r-- | spec/features/ci_web_hooks_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/commits_spec.rb | 9 | ||||
-rw-r--r-- | spec/features/lint_spec.rb (renamed from spec/features/ci/lint_spec.rb) | 0 | ||||
-rw-r--r-- | spec/features/merge_requests/merge_when_build_succeeds_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/runners_spec.rb | 28 | ||||
-rw-r--r-- | spec/features/triggers_spec.rb | 7 | ||||
-rw-r--r-- | spec/features/variables_spec.rb | 7 |
13 files changed, 60 insertions, 152 deletions
diff --git a/spec/features/ci/admin/builds_spec.rb b/spec/features/atom/builds_spec.rb index 623d466c67b..72764b1629d 100644 --- a/spec/features/ci/admin/builds_spec.rb +++ b/spec/features/atom/builds_spec.rb @@ -5,17 +5,16 @@ describe "Admin Builds" do let(:build) { FactoryGirl.create :ci_build, commit: commit } before do - skip_ci_admin_auth - login_as :user + login_as :admin end describe "GET /admin/builds" do before do build - visit ci_admin_builds_path + visit admin_builds_path end - it { expect(page).to have_content "All builds" } + it { expect(page).to have_content "Running" } it { expect(page).to have_content build.short_sha } end @@ -26,43 +25,43 @@ describe "Admin Builds" do FactoryGirl.create :ci_build, commit: commit, status: "success" FactoryGirl.create :ci_build, commit: commit, status: "failed" - visit ci_admin_builds_path + visit admin_builds_path + + within ".center-top-menu" do + click_on "All" + end expect(page.all(".build-link").size).to eq(4) end - it "shows pending builds" do + it "shows finished builds" do build = FactoryGirl.create :ci_build, commit: commit, status: "pending" build1 = FactoryGirl.create :ci_build, commit: commit, status: "running" build2 = FactoryGirl.create :ci_build, commit: commit, status: "success" - build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed" - visit ci_admin_builds_path + visit admin_builds_path - within ".nav.nav-tabs" do - click_on "Pending" + within ".center-top-menu" do + click_on "Finished" end - expect(page.find(".build-link")).to have_content(build.id) + expect(page.find(".build-link")).not_to have_content(build.id) expect(page.find(".build-link")).not_to have_content(build1.id) - expect(page.find(".build-link")).not_to have_content(build2.id) - expect(page.find(".build-link")).not_to have_content(build3.id) + expect(page.find(".build-link")).to have_content(build2.id) end it "shows running builds" do build = FactoryGirl.create :ci_build, commit: commit, status: "pending" - build1 = FactoryGirl.create :ci_build, commit: commit, status: "running" build2 = FactoryGirl.create :ci_build, commit: commit, status: "success" build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed" - visit ci_admin_builds_path + visit admin_builds_path - within ".nav.nav-tabs" do + within ".center-top-menu" do click_on "Running" end - expect(page.find(".build-link")).to have_content(build1.id) - expect(page.find(".build-link")).not_to have_content(build.id) + expect(page.find(".build-link")).to have_content(build.id) expect(page.find(".build-link")).not_to have_content(build2.id) expect(page.find(".build-link")).not_to have_content(build3.id) end diff --git a/spec/features/ci/admin/runners_spec.rb b/spec/features/atom/runners_spec.rb index b83744f53a8..b1f2d401042 100644 --- a/spec/features/ci/admin/runners_spec.rb +++ b/spec/features/atom/runners_spec.rb @@ -10,7 +10,7 @@ describe "Admin Runners" do runner = FactoryGirl.create(:ci_runner) commit = FactoryGirl.create(:ci_commit) FactoryGirl.create(:ci_build, commit: commit, runner_id: runner.id) - visit ci_admin_runners_path + visit admin_runners_path end it { page.has_text? "Manage Runners" } @@ -36,9 +36,9 @@ describe "Admin Runners" do let(:runner) { FactoryGirl.create :ci_runner } before do - @project1 = FactoryGirl.create(:ci_project) - @project2 = FactoryGirl.create(:ci_project) - visit ci_admin_runner_path(runner) + @project1 = FactoryGirl.create(:empty_project) + @project2 = FactoryGirl.create(:empty_project) + visit admin_runner_path(runner) end describe 'runner info' do @@ -53,7 +53,7 @@ describe "Admin Runners" do describe 'search' do before do search_form = find('#runner-projects-search') - search_form.fill_in 'search', with: @project1.gl_project.name + search_form.fill_in 'search', with: @project1.name search_form.click_button 'Search' end diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb index 1f99a808f87..f0031a0a247 100644 --- a/spec/features/builds_spec.rb +++ b/spec/features/builds_spec.rb @@ -7,15 +7,15 @@ describe "Builds" do login_as(:user) @commit = FactoryGirl.create :ci_commit @build = FactoryGirl.create :ci_build, commit: @commit - @gl_project = @commit.project.gl_project - @gl_project.team << [@user, :master] + @project = @commit.project + @project.team << [@user, :master] end describe "GET /:project/builds" do context "Running scope" do before do @build.run! - visit namespace_project_builds_path(@gl_project.namespace, @gl_project) + visit namespace_project_builds_path(@project.namespace, @project) end it { expect(page).to have_content 'Running' } @@ -28,7 +28,7 @@ describe "Builds" do context "Finished scope" do before do @build.run! - visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :finished) + visit namespace_project_builds_path(@project.namespace, @project, scope: :finished) end it { expect(page).to have_content 'No builds to show' } @@ -37,8 +37,8 @@ describe "Builds" do context "All builds" do before do - @gl_project.ci_builds.running_or_pending.each(&:success) - visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :all) + @project.builds.running_or_pending.each(&:success) + visit namespace_project_builds_path(@project.namespace, @project, scope: :all) end it { expect(page).to have_content 'All' } @@ -52,7 +52,7 @@ describe "Builds" do describe "POST /:project/builds/:id/cancel_all" do before do @build.run! - visit namespace_project_builds_path(@gl_project.namespace, @gl_project) + visit namespace_project_builds_path(@project.namespace, @project) click_link "Cancel running" end @@ -62,7 +62,7 @@ describe "Builds" do describe "GET /:project/builds/:id" do before do - visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + visit namespace_project_build_path(@project.namespace, @project, @build) end it { expect(page).to have_content @commit.sha[0..7] } @@ -72,7 +72,7 @@ describe "Builds" do context "Download artifacts" do before do @build.update_attributes(artifacts_file: artifacts_file) - visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + visit namespace_project_build_path(@project.namespace, @project, @build) end it { expect(page).to have_content 'Download artifacts' } @@ -82,7 +82,7 @@ describe "Builds" do describe "POST /:project/builds/:id/cancel" do before do @build.run! - visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + visit namespace_project_build_path(@project.namespace, @project, @build) click_link "Cancel" end @@ -93,7 +93,7 @@ describe "Builds" do describe "POST /:project/builds/:id/retry" do before do @build.run! - visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + visit namespace_project_build_path(@project.namespace, @project, @build) click_link "Cancel" click_link 'Retry' end @@ -105,7 +105,7 @@ describe "Builds" do describe "GET /:project/builds/:id/download" do before do @build.update_attributes(artifacts_file: artifacts_file) - visit namespace_project_build_path(@gl_project.namespace, @gl_project, @build) + visit namespace_project_build_path(@project.namespace, @project, @build) click_link 'Download artifacts' end diff --git a/spec/features/ci/admin/events_spec.rb b/spec/features/ci/admin/events_spec.rb deleted file mode 100644 index a7e75cc4f6b..00000000000 --- a/spec/features/ci/admin/events_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe "Admin Events" do - let(:event) { FactoryGirl.create :ci_admin_event } - - before do - skip_ci_admin_auth - login_as :user - end - - describe "GET /admin/events" do - before do - event - visit ci_admin_events_path - end - - it { expect(page).to have_content "Events" } - it { expect(page).to have_content event.description } - end -end diff --git a/spec/features/ci/admin/projects_spec.rb b/spec/features/ci/admin/projects_spec.rb deleted file mode 100644 index b88f55a6807..00000000000 --- a/spec/features/ci/admin/projects_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe "Admin Projects" do - let(:project) { FactoryGirl.create :ci_project } - - before do - skip_ci_admin_auth - login_as :user - end - - describe "GET /admin/projects" do - before do - project - visit ci_admin_projects_path - end - - it { expect(page).to have_content "Projects" } - end -end diff --git a/spec/features/ci_settings_spec.rb b/spec/features/ci_settings_spec.rb deleted file mode 100644 index 7e25e883018..00000000000 --- a/spec/features/ci_settings_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'spec_helper' - -describe "CI settings" do - let(:user) { create(:user) } - before { login_as(user) } - - before do - @project = FactoryGirl.create :ci_project - @gl_project = @project.gl_project - @gl_project.team << [user, :master] - visit edit_namespace_project_ci_settings_path(@gl_project.namespace, @gl_project) - end - - it { expect(page).to have_content 'Build Schedule' } - - it "updates configuration" do - fill_in 'Timeout', with: '70' - click_button 'Save changes' - expect(page).to have_content 'was successfully updated' - expect(find_field('Timeout').value).to eq '70' - end -end diff --git a/spec/features/ci_web_hooks_spec.rb b/spec/features/ci_web_hooks_spec.rb deleted file mode 100644 index efae0a42c1e..00000000000 --- a/spec/features/ci_web_hooks_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'spec_helper' - -describe 'CI web hooks' do - let(:user) { create(:user) } - before { login_as(user) } - - before do - @project = FactoryGirl.create :ci_project - @gl_project = @project.gl_project - @gl_project.team << [user, :master] - visit namespace_project_ci_web_hooks_path(@gl_project.namespace, @gl_project) - end - - context 'create a trigger' do - before do - fill_in 'web_hook_url', with: 'http://example.com' - click_on 'Add Web Hook' - end - - it { expect(@project.web_hooks.count).to eq(1) } - - it 'revokes the trigger' do - click_on 'Remove' - expect(@project.web_hooks.count).to eq(0) - end - end -end diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index f48d96c35a4..ecc85376ffc 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -9,12 +9,11 @@ describe 'Commits' do before do login_as :user project.team << [@user, :master] - project.ensure_gitlab_ci_project stub_ci_commit_to_return_yaml_file end let!(:commit) do - FactoryGirl.create :ci_commit, gl_project: project, sha: project.commit.sha + FactoryGirl.create :ci_commit, project: project, sha: project.commit.sha end let!(:build) { FactoryGirl.create :ci_build, commit: commit } @@ -89,7 +88,7 @@ describe 'Commits' do end describe '.gitlab-ci.yml not found warning' do - context 'ci service enabled' do + context 'ci builds enabled' do it "does not show warning" do visit ci_status_path(commit) expect(page).not_to have_content '.gitlab-ci.yml not found in this commit' @@ -102,9 +101,9 @@ describe 'Commits' do end end - context 'ci service disabled' do + context 'ci builds disabled' do before do - stub_ci_service_disabled + stub_ci_builds_disabled stub_ci_commit_yaml_file(nil) visit ci_status_path(commit) end diff --git a/spec/features/ci/lint_spec.rb b/spec/features/lint_spec.rb index 5d8f56e2cfb..5d8f56e2cfb 100644 --- a/spec/features/ci/lint_spec.rb +++ b/spec/features/lint_spec.rb diff --git a/spec/features/merge_requests/merge_when_build_succeeds_spec.rb b/spec/features/merge_requests/merge_when_build_succeeds_spec.rb index a674124aab7..28a46a0725d 100644 --- a/spec/features/merge_requests/merge_when_build_succeeds_spec.rb +++ b/spec/features/merge_requests/merge_when_build_succeeds_spec.rb @@ -12,7 +12,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do end context "Active build for Merge Request" do - let!(:ci_commit) { create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) } + 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) } before do @@ -47,7 +47,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do merge_user: user, title: "MepMep", merge_when_build_succeeds: true) end - let!(:ci_commit) { create(:ci_commit, gl_project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch) } + 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) } before do diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb index b0259026630..d97831aae14 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -8,14 +8,14 @@ describe "Runners" do describe "specific runners" do before do - @project = FactoryGirl.create :ci_project - @project.gl_project.team << [user, :master] + @project = FactoryGirl.create :empty_project, shared_runners_enabled: false + @project.team << [user, :master] - @project2 = FactoryGirl.create :ci_project - @project2.gl_project.team << [user, :master] + @project2 = FactoryGirl.create :empty_project + @project2.team << [user, :master] - @project3 = FactoryGirl.create :ci_project - @project3.gl_project.team << [user, :developer] + @project3 = FactoryGirl.create :empty_project + @project3.team << [user, :developer] @shared_runner = FactoryGirl.create :ci_shared_runner @specific_runner = FactoryGirl.create :ci_specific_runner @@ -25,7 +25,7 @@ describe "Runners" do @project2.runners << @specific_runner2 @project3.runners << @specific_runner3 - visit runners_path(@project.gl_project) + visit runners_path(@project) end before do @@ -49,7 +49,7 @@ describe "Runners" do it "disables specific runner for project" do @project2.runners << @specific_runner - visit runners_path(@project.gl_project) + visit runners_path(@project) within ".activated-specific-runners" do click_on "Disable for this project" @@ -69,9 +69,9 @@ describe "Runners" do describe "shared runners" do before do - @project = FactoryGirl.create :ci_project - @project.gl_project.team << [user, :master] - visit runners_path(@project.gl_project) + @project = FactoryGirl.create :empty_project, shared_runners_enabled: false + @project.team << [user, :master] + visit runners_path(@project) end it "enables shared runners" do @@ -82,14 +82,14 @@ describe "Runners" do describe "show page" do before do - @project = FactoryGirl.create :ci_project - @project.gl_project.team << [user, :master] + @project = FactoryGirl.create :empty_project + @project.team << [user, :master] @specific_runner = FactoryGirl.create :ci_specific_runner @project.runners << @specific_runner end it "shows runner information" do - visit runners_path(@project.gl_project) + visit runners_path(@project) click_on @specific_runner.short_sha expect(page).to have_content(@specific_runner.platform) end diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb index 69492d58878..3cbc8253ad6 100644 --- a/spec/features/triggers_spec.rb +++ b/spec/features/triggers_spec.rb @@ -5,10 +5,9 @@ describe 'Triggers' do before { login_as(user) } before do - @project = FactoryGirl.create :ci_project - @gl_project = @project.gl_project - @gl_project.team << [user, :master] - visit namespace_project_triggers_path(@gl_project.namespace, @gl_project) + @project = FactoryGirl.create :empty_project + @project.team << [user, :master] + visit namespace_project_triggers_path(@project.namespace, @project) end context 'create a trigger' do diff --git a/spec/features/variables_spec.rb b/spec/features/variables_spec.rb index adb602f3edd..afea1840cd7 100644 --- a/spec/features/variables_spec.rb +++ b/spec/features/variables_spec.rb @@ -6,13 +6,12 @@ describe "Variables" do describe "specific runners" do before do - @project = FactoryGirl.create :ci_project - @gl_project = @project.gl_project - @gl_project.team << [user, :master] + @project = FactoryGirl.create :empty_project + @project.team << [user, :master] end it "creates variable", js: true do - visit namespace_project_variables_path(@gl_project.namespace, @gl_project) + visit namespace_project_variables_path(@project.namespace, @project) click_on "Add a variable" fill_in "Key", with: "SECRET_KEY" fill_in "Value", with: "SECRET_VALUE" |