Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make tests wait for docs to build in background (or force them to bui…

…ld in foreground)
  • Loading branch information...
commit 55df43d3196258cc617bdf6e93d11709858a5b52 1 parent 322fac3
@alexch alexch authored
View
6 lib/rubygems/dependency_installer.rb
@@ -32,6 +32,7 @@ class Gem::DependencyInstaller
:prerelease => false,
:security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
:wrappers => true,
+ :build_docs_in_background => true,
}.freeze
##
@@ -77,6 +78,7 @@ def initialize(options = {})
@security_policy = options[:security_policy]
@user_install = options[:user_install]
@wrappers = options[:wrappers]
+ @build_docs_in_background = options[:build_docs_in_background]
# Indicates that we should not try to update any deps unless
# we absolutely must.
@@ -378,14 +380,14 @@ def install dep_or_name, version = Gem::Requirement.default
hook.call self, @installed_gems
end
finish = Time.now
- puts "Done installing documentation for #{@installed_gems.map(&:name).join(', ')} (#{(finish-start).to_i} sec)."
+ say "Done installing documentation for #{@installed_gems.map(&:name).join(', ')} (#{(finish-start).to_i} sec)."
end unless Gem.done_installing_hooks.empty?
@installed_gems
end
def in_background what
- if Process.respond_to?(:fork)
+ if @build_docs_in_background and Process.respond_to?(:fork)
say "#{what} in a background process."
Process.fork do
yield
View
2  test/rubygems/test_gem_commands_install_command.rb
@@ -304,6 +304,8 @@ def test_execute_rdoc
assert_equal 0, e.exit_code
end
+ Process.wait rescue Errno::ECHILD if Process.respond_to?(:fork)
+
assert_path_exists File.join(@a2.doc_dir, 'ri')
assert_path_exists File.join(@a2.doc_dir, 'rdoc')
end
View
2  test/rubygems/test_gem_commands_update_command.rb
@@ -274,6 +274,8 @@ def test_execute_rdoc
@cmd.execute
end
+ Process.wait rescue Errno::ECHILD if Process.respond_to?(:fork)
+
assert_path_exists File.join(@a2.doc_dir, 'ri')
assert_path_exists File.join(@a2.doc_dir, 'rdoc')
end
View
2  test/rubygems/test_gem_dependency_installer.rb
@@ -187,7 +187,7 @@ def test_install_dependency
FileUtils.mv @b1_gem, @tempdir
Dir.chdir @tempdir do
- inst = Gem::DependencyInstaller.new
+ inst = Gem::DependencyInstaller.new(:build_docs_in_background => false)
inst.install 'b'
end
Please sign in to comment.
Something went wrong with that request. Please try again.