summaryrefslogtreecommitdiff
path: root/spec/benchmarks
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-10-20 17:44:15 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2015-10-29 12:09:25 +0100
commit6369c992a6d9279f4aa38c60c350c966f3926df1 (patch)
tree40e4206b6e795d495223b6d554f86f8e21d1dcd2 /spec/benchmarks
parent7fc95d805dd2a4b997bbc3ad24a1a3a7d64ef305 (diff)
downloadgitlab-ce-6369c992a6d9279f4aa38c60c350c966f3926df1.tar.gz
Added benchmark for Projects::CreateService
This benchmark currently runs at ~0.6 iterations per second and is unlikely to perform any better any time soon.
Diffstat (limited to 'spec/benchmarks')
-rw-r--r--spec/benchmarks/services/projects/create_service_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/benchmarks/services/projects/create_service_spec.rb b/spec/benchmarks/services/projects/create_service_spec.rb
new file mode 100644
index 00000000000..25ed48c34fd
--- /dev/null
+++ b/spec/benchmarks/services/projects/create_service_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe Projects::CreateService, benchmark: true do
+ describe '#execute' do
+ let(:user) { create(:user, :admin) }
+
+ let(:group) do
+ group = create(:group)
+
+ create(:group_member, group: group, user: user)
+
+ group
+ end
+
+ benchmark_subject do
+ name = SecureRandom.hex
+ service = described_class.new(user,
+ name: name,
+ path: name,
+ namespace_id: group.id,
+ visibility_level: Gitlab::VisibilityLevel::PUBLIC)
+
+ service.execute
+ end
+
+ it { is_expected.to iterate_per_second(0.5) }
+ end
+end