summaryrefslogtreecommitdiff
path: root/spec/models/ci
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-04-30 09:39:47 +0400
committerDylan Griffith <dyl.griffith@gmail.com>2018-04-30 10:02:25 +0400
commit87740df2ba7153439c30544f299b235632717738 (patch)
tree66c40d2cf0e4289991ee8f3a9d038ac400f29da9 /spec/models/ci
parent0077679ae88793b200bdcf69d2ca7e4d15e6f7fa (diff)
downloadgitlab-ce-87740df2ba7153439c30544f299b235632717738.tar.gz
Revert fair scheduling for all builds
Per discussion in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9646#note_65730532 this logic is being optimized elsewhere and it will simplify things if we make less changes to this code right now.
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/runner_spec.rb67
1 files changed, 0 insertions, 67 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb
index fbf9539e698..d6ce97a9b28 100644
--- a/spec/models/ci/runner_spec.rb
+++ b/spec/models/ci/runner_spec.rb
@@ -792,73 +792,6 @@ describe Ci::Runner do
end
end
- describe '#accessible_projects' do
- let!(:shared_runner) { create(:ci_runner, :shared) }
- let!(:shared_project) { create(:project, shared_runners_enabled: true) }
-
- let!(:project_runner) { create(:ci_runner) }
- let!(:project_project) { create(:project, runners: [project_runner], shared_runners_enabled: false) }
-
- let!(:group_runner) { create(:ci_runner) }
-
- let!(:parent_group) { create(:group) }
- let!(:parent_group_project) do
- create(:project, group: parent_group, shared_runners_enabled: false)
- end
-
- let!(:group) { create :group, runners: [group_runner], parent: parent_group }
- let!(:group_project) do
- create(:project, group: group, shared_runners_enabled: false)
- end
-
- let!(:nested_group_project) do
- nested_group = create :group, parent: group
- create(:project, group: nested_group, shared_runners_enabled: false)
- end
-
- it 'returns the project with a shared runner' do
- expect(shared_runner.reload.accessible_projects).to eq [shared_project]
- end
-
- it 'returns the project with a project runner' do
- expect(project_runner.reload.accessible_projects).to eq [project_project]
- end
-
- it 'returns the projects with a group and nested group runner', :nested_groups do
- expect(group_runner.reload.accessible_projects).to eq [group_project, nested_group_project]
- end
-
- context 'deleted' do
- before do
- shared_project.update_attributes!(pending_delete: true)
- project_project.update_attributes!(pending_delete: true)
- group_project.update_attributes!(pending_delete: true)
- nested_group_project.update_attributes!(pending_delete: true)
- end
-
- it 'returns no projects' do
- expect(shared_runner.reload.accessible_projects).to be_empty
- expect(project_runner.reload.accessible_projects).to be_empty
- expect(group_runner.reload.accessible_projects).to be_empty
- end
- end
-
- context 'builds disabled' do
- before do
- shared_project.update_attributes!(builds_enabled: false)
- project_project.update_attributes!(builds_enabled: false)
- group_project.update_attributes!(builds_enabled: false)
- nested_group_project.update_attributes!(builds_enabled: false)
- end
-
- it 'returns no projects' do
- expect(shared_runner.reload.accessible_projects).to be_empty
- expect(project_runner.reload.accessible_projects).to be_empty
- expect(group_runner.reload.accessible_projects).to be_empty
- end
- end
- end
-
describe '#invalidate_build_cache!' do
context 'runner can pick the build' do
it 'calls #tick_runner_queue' do