Commit 8793197c0818aad22a9243ceb8f49194ad443b34
1 parent
0cdf5e65
Exists in
master
and in
28 other branches
[postgres-tests] Removing obsolete test
Showing
1 changed file
with
0 additions
and
30 deletions
Show diff stats
test/integration/performance_test.rb
@@ -52,28 +52,6 @@ class PerformanceTest < ActionController::IntegrationTest | @@ -52,28 +52,6 @@ class PerformanceTest < ActionController::IntegrationTest | ||
52 | a2 = (time2.total - time1.total)/50.0 | 52 | a2 = (time2.total - time1.total)/50.0 |
53 | assert a1 > a2*FACTOR, "#{a1} should be larger than #{a2} by at least a factor of #{FACTOR}" | 53 | assert a1 > a2*FACTOR, "#{a1} should be larger than #{a2} by at least a factor of #{FACTOR}" |
54 | end | 54 | end |
55 | - | ||
56 | - should 'not have a linear increase in time to save enterprise due to amount of products' do | ||
57 | - $DISABLE_DELAYED_JOB_TEST_ENV_RUN = true | ||
58 | - enterprise0 = Enterprise.create!(:name => 'Enterprise 0', :identifier => 'enterprise0') | ||
59 | - enterprise1 = Enterprise.create!(:name => 'Enterprise 1', :identifier => 'enterprise1') | ||
60 | - enterprise2 = Enterprise.create!(:name => 'Enterprise 2', :identifier => 'enterprise2') | ||
61 | - | ||
62 | - create_products(enterprise1,25) | ||
63 | - create_products(enterprise2,50) | ||
64 | - | ||
65 | - enterprise0.reload | ||
66 | - enterprise1.reload | ||
67 | - enterprise2.reload | ||
68 | - | ||
69 | - time0 = (Benchmark.measure { 10.times { enterprise0.save! } }).total | ||
70 | - time1 = (Benchmark.measure { 10.times { enterprise1.save! } }).total | ||
71 | - time2 = (Benchmark.measure { 10.times { enterprise2.save! } }).total | ||
72 | - | ||
73 | - assert (time1 - time0) < time0*0.5 | ||
74 | - assert (time2 - time0) < time0*0.5 | ||
75 | - end | ||
76 | - | ||
77 | protected | 55 | protected |
78 | 56 | ||
79 | def create_profile(name) | 57 | def create_profile(name) |
@@ -91,13 +69,5 @@ class PerformanceTest < ActionController::IntegrationTest | @@ -91,13 +69,5 @@ class PerformanceTest < ActionController::IntegrationTest | ||
91 | end | 69 | end |
92 | end | 70 | end |
93 | 71 | ||
94 | - def create_products(enterprise,n) | ||
95 | - number = Product.all.count | ||
96 | - pc = ProductCategory.create!(:name => "Any Category #{n}", :environment => Environment.default) | ||
97 | - n.times do |i| | ||
98 | - Product.create!(:enterprise => enterprise, :product_category => pc, :name => "Product #{i+number+1}") | ||
99 | - end | ||
100 | - end | ||
101 | - | ||
102 | end | 72 | end |
103 | 73 |