File: really-disable-ruby-prof.patch

package info (click to toggle)
ruby-elasticsearch 1.0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 2,812 kB
  • ctags: 2,451
  • sloc: ruby: 18,512; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 2,075 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Description: Disable support for ruby-prof in test suite
 It should be possible to disable ruby profiling support by
 not setting an environment support, but this isn't implemented
 correctly across the test suite.  The ruby-prof module has
 been removed from the Debian archive as it only supports amd64
 and i386 architectures.
Author: Tim Potter <tpot@hp.com>
Last Update: 2014-09-27

Index: ruby-elasticsearch/elasticsearch-extensions/lib/elasticsearch/extensions/test/profiling.rb
===================================================================
--- ruby-elasticsearch.orig/elasticsearch-extensions/lib/elasticsearch/extensions/test/profiling.rb
+++ ruby-elasticsearch/elasticsearch-extensions/lib/elasticsearch/extensions/test/profiling.rb
@@ -1,4 +1,4 @@
-require 'ruby-prof'
+require 'ruby-prof' if ENV["REQUIRE_PROF"]
 require 'benchmark'
 require 'ansi'
 
Index: ruby-elasticsearch/elasticsearch/test/test_helper.rb
===================================================================
--- ruby-elasticsearch.orig/elasticsearch/test/test_helper.rb
+++ ruby-elasticsearch/elasticsearch/test/test_helper.rb
@@ -36,7 +36,9 @@ RequireProf.print_timing_infos if ENV["R
 if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
   require 'elasticsearch/extensions/test/cluster'
   require 'elasticsearch/extensions/test/startup_shutdown'
-  require 'elasticsearch/extensions/test/profiling' unless JRUBY
+  if ENV["REQUIRE_PROF"]
+    require 'elasticsearch/extensions/test/profiling' unless JRUBY
+  end
 end
 
 module Elasticsearch
@@ -52,7 +54,7 @@ module Elasticsearch
   module Test
     class ProfilingTest < ::Test::Unit::TestCase
       extend Elasticsearch::Extensions::Test::StartupShutdown
-      extend Elasticsearch::Extensions::Test::Profiling
+      extend Elasticsearch::Extensions::Test::Profiling if ENV["REQUIRE_PROF"]
 
       shutdown { Elasticsearch::Extensions::Test::Cluster.stop if ENV['SERVER'] && started? && Elasticsearch::Extensions::Test::Cluster.running? }
       context "IntegrationTest" do; should "noop on Ruby 1.8" do; end; end if RUBY_1_8