From 1c94afa7e560f2436830adabeef87d00b13adfc1 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 21 Dec 2020 17:15:46 -0500 Subject: [PATCH 1/7] style: improve readability of packaging ports and patches --- rakelib/cross-ruby.rake | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/rakelib/cross-ruby.rake b/rakelib/cross-ruby.rake index 2a6d7dfc65..5cd6ed703f 100644 --- a/rakelib/cross-ruby.rake +++ b/rakelib/cross-ruby.rake @@ -316,21 +316,19 @@ else dependencies = YAML.load_file("dependencies.yml") task gem_build_path do - %w[libxml2 libxslt].each do |lib| + ["libxml2", "libxslt"].each do |lib| version = dependencies[lib]["version"] archive = File.join("ports", "archives", "#{lib}-#{version}.tar.gz") add_file_to_gem archive + patchesdir = File.join("patches", lib) patches = `#{['git', 'ls-files', patchesdir].shelljoin}`.split("\n").grep(/\.patch\z/) - patches.each { |patch| - add_file_to_gem patch - } - (untracked = Dir[File.join(patchesdir, '*.patch')] - patches).empty? or - at_exit { - untracked.each { |patch| - puts "** WARNING: untracked patch file not added to gem: #{patch}" - } - } + patches.each { |patch| add_file_to_gem patch } + + untracked = Dir[File.join(patchesdir, '*.patch')] - patches + at_exit do + untracked.each { |patch| puts "** WARNING: untracked patch file not added to gem: #{patch}" } + end end end From ea9b2b3088e916af734d4f3117e4b61c36ab9b23 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 21 Dec 2020 11:57:04 -0500 Subject: [PATCH 2/7] dev: rename build-against-libxml2-source to the more precise compile-against-libxml2-source --- ...uild-against-libxml2-source => compile-against-libxml2-source} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{build-against-libxml2-source => compile-against-libxml2-source} (100%) diff --git a/scripts/build-against-libxml2-source b/scripts/compile-against-libxml2-source similarity index 100% rename from scripts/build-against-libxml2-source rename to scripts/compile-against-libxml2-source From 4effe03822c44db2d9f60473db96211d9267fa09 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 22 Dec 2020 21:19:15 -0500 Subject: [PATCH 3/7] test: ensure better isolation in the subprocess of test_version.rb --- test/test_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_version.rb b/test/test_version.rb index 42bde493a3..d79907c2c0 100644 --- a/test/test_version.rb +++ b/test/test_version.rb @@ -88,7 +88,7 @@ class TestVersionInfo class Base < Nokogiri::TestCase let(:version_info) do version_info = Dir.chdir(ROOTDIR) do - %x(#{RUBYEXEC} -Ilib -rjson -r#{require_name} -e 'puts Nokogiri::VERSION_INFO.to_json') + %x(#{RUBYEXEC} -Ilib -rjson -e 'require "#{require_name}"; puts Nokogiri::VERSION_INFO.to_json') end JSON.parse(version_info) end From 99a8f35f750a95025126de0b882adaf10b22bdbe Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 22 Dec 2020 23:00:46 -0500 Subject: [PATCH 4/7] dev: cross-compile jruby gem only once avoiding the (buggy) default behavior of rake-compiler-dock when no platform is set for jruby. --- rakelib/cross-ruby.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rakelib/cross-ruby.rake b/rakelib/cross-ruby.rake index 5cd6ed703f..53be2cbc40 100644 --- a/rakelib/cross-ruby.rake +++ b/rakelib/cross-ruby.rake @@ -279,7 +279,8 @@ namespace "gem" do desc "build a jruby gem" task "jruby" do - RakeCompilerDock.sh "gem install bundler --no-document && bundle && rake java gem", rubyvm: "jruby" + RakeCompilerDock.sh("gem install bundler --no-document && bundle && rake java gem", + rubyvm: "jruby", platform: "jruby") end desc "build native gems for windows" From f4519f52452438675c1d446ec5a78485c3f9a730 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 22 Dec 2020 23:10:45 -0500 Subject: [PATCH 5/7] feat: provide packaged libraries' headers in ext/nokogiri/include This commit introduces complete test coverage for: - the contents of every flavor of gem file - the filesystem after every flavor of gem installation The key outcome of this change is to allow nokogumbo to compile against the same headers used by Nokogiri, #1788 A secondary outcome is much improved confidence and understanding of how we're packaging the gems and what we're putting on disk during installation. Closes #1788 Closes #2076 Closes #2078 --- .gitignore | 3 +- Rakefile | 2 + ext/nokogiri/extconf.rb | 22 ++++ lib/nokogiri/version/info.rb | 3 + rakelib/cross-ruby.rake | 20 ++- scripts/test-gem-file-contents | 217 +++++++++++++++++++++++++++++++++ scripts/test-gem-installation | 107 ++++++++++++++++ 7 files changed, 372 insertions(+), 2 deletions(-) create mode 100755 scripts/test-gem-file-contents create mode 100755 scripts/test-gem-installation diff --git a/.gitignore b/.gitignore index f33cb22c36..15255616b4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,9 +23,10 @@ coverage ext/java/Canna ext/java/nokogiri/**/*.class ext/nokogiri/*.dll +ext/nokogiri/include gems -lib/nokogiri/**/nokogiri.so lib/nokogiri/**/nokogiri.bundle +lib/nokogiri/**/nokogiri.so lib/nokogiri/nokogiri.jar pkg ports diff --git a/Rakefile b/Rakefile index 215beea52f..5ac3707930 100644 --- a/Rakefile +++ b/Rakefile @@ -43,6 +43,8 @@ HOE = Hoe.spec "nokogiri" do |hoe| "lib/nokogiri/[0-9].[0-9]", "coverage", "concourse/images/*.generated", + "ext/nokogiri/include", + "tmp", ] hoe.clean_globs += Dir.glob("ports/*").reject { |d| d =~ %r{/archives$} } diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 421f7c5b4a..52b5f41991 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -445,6 +445,14 @@ def process_recipe(name, version, static_p, cross_p) end end +def copy_packaged_libraries_headers(to_path:, from_recipes:) + FileUtils.rm_rf(to_path, secure: true) + FileUtils.mkdir(to_path) + from_recipes.each do |recipe| + FileUtils.cp_r(Dir[File.join(recipe.path, 'include/*')], to_path) + end +end + def do_help print NOKOGIRI_HELP_MESSAGE exit! 0 @@ -762,6 +770,20 @@ def configure have_func('vasprintf') +unless using_system_libraries? + if cross_build_p + # When precompiling native gems, copy packaged libraries' headers to ext/nokogiri/include + # These are packaged up by the cross-compiling callback in the ExtensionTask + copy_packaged_libraries_headers(to_path: File.join(PACKAGE_ROOT_DIR, "ext/nokogiri/include"), + from_recipes: [libxml2_recipe, libxslt_recipe]) + else + # When compiling during installation, install packaged libraries' header files into ext/nokogiri/include + copy_packaged_libraries_headers(to_path: "include", + from_recipes: [libxml2_recipe, libxslt_recipe]) + $INSTALLFILES << ["include/**/*.h", "$(rubylibdir)"] + end +end + create_makefile('nokogiri/nokogiri') if enable_config('clean', true) diff --git a/lib/nokogiri/version/info.rb b/lib/nokogiri/version/info.rb index 24903a6469..aacc92f844 100644 --- a/lib/nokogiri/version/info.rb +++ b/lib/nokogiri/version/info.rb @@ -90,6 +90,9 @@ def to_hash libxml["source"] = "packaged" libxml["precompiled"] = libxml2_precompiled? libxml["patches"] = Nokogiri::LIBXML2_PATCHES + + # this is for nokogumbo and shouldn't be forever + libxml["libxml2_path"] = File.expand_path(File.join(File.dirname(__FILE__), "../../../ext/nokogiri")) else libxml["source"] = "system" end diff --git a/rakelib/cross-ruby.rake b/rakelib/cross-ruby.rake index 53be2cbc40..ff7912d4bd 100644 --- a/rakelib/cross-ruby.rake +++ b/rakelib/cross-ruby.rake @@ -297,11 +297,14 @@ if java? require "rake/javaextensiontask" Rake::JavaExtensionTask.new("nokogiri", HOE.spec) do |ext| jruby_home = RbConfig::CONFIG['prefix'] + jars = ["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar'] + + ext.gem_spec.files.reject! { |path| File.fnmatch?("ext/nokogiri/*.h", path) } + ext.ext_dir = 'ext/java' ext.lib_dir = 'lib/nokogiri' ext.source_version = '1.6' ext.target_version = '1.6' - jars = ["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar'] ext.classpath = jars.map { |x| File.expand_path x }.join ':' ext.debug = true if ENV['JAVA_DEBUG'] end @@ -348,6 +351,21 @@ else spec.files.reject! { |path| File.fnmatch?('ports/*', path) } spec.dependencies.reject! { |dep| dep.name=='mini_portile2' } + + # when pre-compiling a native gem, package all the C headers sitting in ext/nokogiri/include + # which were copied there in the $INSTALLFILES section of extconf.rb. + # (see scripts/test-gem-file-contents and scripts/test-gem-installation for tests) + headers_dir = "ext/nokogiri/include" + + ["libxml2", "libxslt"].each do |lib| + unless File.directory?(File.join(headers_dir, lib)) + raise "#{lib} headers are not present in #{headers_dir}" + end + end + + Dir.glob(File.join(headers_dir, "**", "*.h")).each do |header| + spec.files << header + end end end end diff --git a/scripts/test-gem-file-contents b/scripts/test-gem-file-contents new file mode 100755 index 0000000000..014ec56600 --- /dev/null +++ b/scripts/test-gem-file-contents @@ -0,0 +1,217 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true +# +# this script is intended to run as part of the CI test suite. +# +# it inspects the contents of a nokogiri gem file -- both the files and the gemspec -- to ensure +# we're packaging what we expect, and that we're not packaging anything we don't expect. +# +# this file isn't in the `test/` subdirectory because it's intended to be run standalone against a +# built gem file (and not against the source code or behavior of the gem itself). +# + +require "bundler/inline" + +gemfile do + source "https://rubygems.org" + gem "minitest" + gem "minitest-reporters" +end + +require "yaml" + +def usage_and_exit(message = nil) + puts "ERROR: #{message}" if message + puts "USAGE: #{File.basename(__FILE__)} [options]" + exit(1) +end + +usage_and_exit if ARGV.include?("-h") +usage_and_exit unless gemfile = ARGV[0] +usage_and_exit("#{gemfile} does not exist") unless File.file?(gemfile) +usage_and_exit("#{gemfile} is not a gem") unless /\.gem$/.match(gemfile) +gemfile = File.expand_path(gemfile) + +gemfile_contents = Dir.mktmpdir do |dir| + Dir.chdir(dir) do + unless system("tar -xf #{gemfile} data.tar.gz") + raise "could not unpack gem #{gemfile}" + end + %x(tar -ztf data.tar.gz).split("\n") + end +end + +gemspec = Dir.mktmpdir do |dir| + Dir.chdir(dir) do + unless system("tar -xf #{gemfile} metadata.gz") + raise "could not unpack gem #{gemfile}" + end + YAML.load(%x(gunzip -c metadata.gz)) + end +end + +if ARGV.include?("-v") + puts "---------- gemfile contents ----------" + puts gemfile_contents + puts + puts "---------- gemspec ----------" + puts gemspec.to_ruby + puts +end + +require "minitest/autorun" +require "minitest/reporters" +Minitest::Reporters.use!([Minitest::Reporters::SpecReporter.new]) + +puts "Testing '#{gemfile}' (#{gemspec.platform})" +describe File.basename(gemfile) do + let(:cross_rubies_path) { File.join(File.dirname(__FILE__), "..", ".cross_rubies") } + let(:native_ruby_versions) do + File.read(cross_rubies_path).split("\n").map do |line| + line.split(":").first.split(".").take(2).join(".") # ugh + end.uniq.sort + end + + describe "setup" do + it "gemfile contains some files" do + actual = gemfile_contents.length + assert_operator(actual, :>, 60, "expected gemfile to contain more than #{actual} files") + end + + it "gemspec is a Gem::Specfication" do + assert_equal(Gem::Specification, gemspec.class) + end + end + + describe "all platforms" do + it "contains every ruby file in lib/" do + expected = %x(git ls-files lib).split("\n").grep(/\.rb$/).sort + actual = gemfile_contents.grep(%r{^lib/}).grep(/\.rb$/).sort + assert_equal(expected, actual) + end + end + + describe "ruby platform" do + it "contains the port files" do + actual_ports = gemfile_contents.grep(%r{^ports/}) + assert_equal(1, actual_ports.grep(/libxml2-\d+\.\d+\.\d+\.tar\.gz/).length, + "expected #{actual_ports} to include libxml2") + assert_equal(1, actual_ports.grep(/libxslt-\d+\.\d+\.\d+\.tar\.gz/).length, + "expected #{actual_ports} to include libxslt") + assert_equal(2, actual_ports.length) + end + + it "contains the patch files" do + assert_operator(gemfile_contents.grep(%r{^patches/}).length, :>, 0) + end + + it "contains ext/nokogiri C and header files" do + assert_operator(gemfile_contents.grep(%r{^ext/nokogiri/.*\.c}).length, :>, 20) + assert_operator(gemfile_contents.grep(%r{^ext/nokogiri/.*\.h}).length, :>, 20) + end + + it "does not contain packaged libraries' header files" do + # these files are present after installation if the packaged libraries are used + assert_empty(gemfile_contents.grep(%r{^ext/nokogiri/include/})) + end + + it "does not contain java files" do + assert_empty(gemfile_contents.grep(%r{^ext/java/})) + assert_empty(gemfile_contents.grep(/.*\.jar$/)) + end + + it "depends on mini_portile2" do + assert(gemspec.dependencies.find { |d| d.name == "mini_portile2" }) + end + + it "includes C files in extra_rdoc_files" do + assert_operator(gemspec.extra_rdoc_files.grep(%r{ext/nokogiri/.*\.c$}).length, :>, 10) + end + end if gemspec.platform == Gem::Platform::RUBY + + describe "native platform" do + it "does not contain the port files" do + assert_empty(gemfile_contents.grep(%r{^ports/})) + end + + it "does not contain the patch files" do + assert_empty(gemfile_contents.grep(%r{^patches/})) + end + + it "contains ext/nokogiri C and header files" do + assert_operator(gemfile_contents.grep(%r{^ext/nokogiri/.*\.c}).length, :>, 20) + assert_operator(gemfile_contents.grep(%r{^ext/nokogiri/.*\.h}).length, :>, 20) + end + + it "contains packaged libraries' header files" do + assert_includes(gemfile_contents, "ext/nokogiri/include/libxml2/libxml/tree.h") + assert_includes(gemfile_contents, "ext/nokogiri/include/libxslt/xslt.h") + assert_includes(gemfile_contents, "ext/nokogiri/include/libexslt/exslt.h") + end + + it "does not contain java files" do + assert_empty(gemfile_contents.grep(%r{^ext/java/})) + assert_empty(gemfile_contents.grep(/.*\.jar$/)) + end + + it "does not depend on mini_portile2" do + refute(gemspec.dependencies.find { |d| d.name == "mini_portile2" }) + end + + it "includes C files in extra_rdoc_files" do + assert_operator(gemspec.extra_rdoc_files.grep(%r{ext/nokogiri/.*\.c$}).length, :>, 10) + end + + it "contains expected .so files " do + native_ruby_versions.each do |version| + assert_includes(gemfile_contents, "lib/nokogiri/#{version}/nokogiri.so") + end + refute_includes(gemfile_contents, "lib/nokogiri/nokogiri.so") + assert_equal(native_ruby_versions.length, Dir.glob("lib/nokogiri/**/*.so").length) + end + end if gemspec.platform.is_a?(Gem::Platform) && gemspec.platform.cpu + + describe "java platform" do + it "does not contain the port files" do + assert_empty(gemfile_contents.grep(%r{^ports/})) + end + + it "does not contain the patch files" do + assert_empty(gemfile_contents.grep(%r{^patches/})) + end + + it "contains ext/nokogiri C files" do + assert_operator(gemfile_contents.grep(%r{^ext/nokogiri/.*\.c}).length, :>, 20) + end + + it "does not contain ext/nokogiri header files" do + assert_empty(gemfile_contents.grep(%r{^ext/nokogiri/.*\.h})) + end + + it "does not contain packaged libraries' header files" do + assert_empty(gemfile_contents.grep(%r{^ext/nokogiri/include/})) + end + + it "contains the java jar files" do + actual_jars = gemfile_contents.grep(/.*\.jar$/) + expected_jars = [ + "isorelax", + "jing", + "nekodtd", + "nekohtml", + "nokogiri", + "serializer", + "xalan", + "xercesImpl", + "xml-apis", + ] + expected_jars.each do |jar| + assert_equal(1, actual_jars.grep(%r{/#{jar}\.jar$}).length, "expected to contain #{jar}.jar") + end + end + + it "does not depend on mini_portile2" do + refute(gemspec.dependencies.find { |d| d.name == "mini_portile2" }) + end + end if gemspec.platform == Gem::Platform.new("java") +end diff --git a/scripts/test-gem-installation b/scripts/test-gem-installation new file mode 100755 index 0000000000..a5b3e6b4e8 --- /dev/null +++ b/scripts/test-gem-installation @@ -0,0 +1,107 @@ +#! /usr/bin/env ruby +# frozen_string_literal: true +# +# this script is intended to run as part of the CI test suite. +# +# it inspects the filesystem of a nokogiri gem installation to ensure it's complete and sane, and +# doesn't install anything we don't expect. +# +# this file isn't in the `test/` subdirectory because it's intended to be run standalone against an +# installed gem (and not against the source code or behavior of the gem itself). +# + +# this line needs to come before the bundler bit, to assert that we're running against an +# already-installed version (and not some other version that bundler/inline might install if it came +# first) +gemspec = Gem::Specification.find_by_name('nokogiri') +raise "could not find installed gem" unless gemspec + +require "bundler/inline" + +gemfile do + source "https://rubygems.org" + gem "minitest" + gem "minitest-reporters" + gem "nokogiri" +end + +require 'nokogiri' +require 'yaml' + +if ARGV.include?("-v") + puts "---------- Nokogiri version info ----------" + puts Nokogiri::VERSION_INFO.to_yaml + puts + puts "---------- Nokogiri installed gemspec ----------" + puts gemspec.to_ruby + puts +end + +require "minitest/autorun" +require "minitest/reporters" +Minitest::Reporters.use!([Minitest::Reporters::SpecReporter.new]) + +puts "Testing #{gemspec.full_name} installed in #{gemspec.base_dir}" +describe gemspec.full_name do + let(:nokogiri_ext_dir) { File.join(gemspec.gem_dir, "ext/nokogiri") } + let(:nokogiri_include_dir) { File.join(nokogiri_ext_dir, "include") } + + # representative sample of the files + let(:nokogiri_header_files) { ["nokogiri.h", "xml_document.h", "xml_node.h"] } + let(:packaged_library_header_files) { ["libxml2/libxml/tree.h", "libxslt/xslt.h", "libexslt/exslt.h"] } + + it "loads the same version as the spec we've loaded" do + assert_equal(Nokogiri::VERSION, gemspec.version.to_s) + end + + describe "cruby" do + it "installs nokogiri headers" do + nokogiri_header_files.each do |header| + assert(File.file?(File.join(nokogiri_ext_dir, header)), + "expected #{header} to be installed in #{nokogiri_ext_dir}") + end + end + + describe "native platform" do + it "declares packaged, precompiled libraries" do + assert(Nokogiri::VersionInfo.instance.libxml2_using_packaged?) + assert(Nokogiri::VERSION_INFO["libxml"].key?("source")) + assert_equal("packaged", Nokogiri::VERSION_INFO["libxml"]["source"]) + + assert(Nokogiri::VersionInfo.instance.libxml2_precompiled?) + assert(Nokogiri::VERSION_INFO["libxml"].key?("precompiled")) + assert(Nokogiri::VERSION_INFO["libxml"]["precompiled"]) + end + end if gemspec.platform.is_a?(Gem::Platform) && gemspec.platform.cpu + + describe "library" do + describe "packaged" do + it "declares where headers are installed" do + # this is for nokogumbo and shouldn't be forever + assert_equal(nokogiri_ext_dir, Nokogiri::VERSION_INFO["libxml"]["libxml2_path"], + "expected Nokogiri::VERSION_INFO to point to #{nokogiri_ext_dir}") + end + + it "installs packaged libraries' headers" do + packaged_library_header_files.each do |header| + assert(File.file?(File.join(nokogiri_include_dir, header)), + "expected #{header} to be installed in #{nokogiri_include_dir}") + end + end + end if Nokogiri::VersionInfo.instance.libxml2_using_packaged? + + describe "using system libraries" do + it "doesn't declare where headers are installed" do + refute(Nokogiri::VERSION_INFO["libxml"].key?("libxml2_path")) + end + + it "does not install packaged libraries' headers" do + packaged_library_header_files.each do |header| + dir = File.join(nokogiri_include_dir, File.dirname(header)) + refute(File.directory?(dir), "expected directory #{dir} to not exist") + end + end + end unless Nokogiri::VersionInfo.instance.libxml2_using_packaged? + end + end unless gemspec.platform == Gem::Platform.new("java") +end From ae389fd431fdc3a7e75f5cfe6024be8f62161d10 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 22 Dec 2020 23:16:22 -0500 Subject: [PATCH 6/7] dev: build-gems verifies packaging with test-gem-file-contents --- scripts/build-gems | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build-gems b/scripts/build-gems index 3f8c135387..d2ca50b300 100755 --- a/scripts/build-gems +++ b/scripts/build-gems @@ -24,3 +24,7 @@ bundle exec rake clean bundle exec rake gem:windows bundle exec rake gem:linux cp -v pkg/nokogiri-*{x86,x64}*.gem gems + +for f in gems/*.gem ; do + ./scripts/test-gem-file-contents $f +done From 107cebc13541c342672ee0f4d264e432ef18ec81 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 22 Dec 2020 23:17:32 -0500 Subject: [PATCH 7/7] ci: gem tests check generated gems and installation behavior using test-gem-file-contents and test-gem-installation --- concourse/tasks/gem-test/gem-build-java.sh | 4 ++++ concourse/tasks/gem-test/gem-build.sh | 4 ++++ concourse/tasks/gem-test/gem-install-and-test.sh | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/concourse/tasks/gem-test/gem-build-java.sh b/concourse/tasks/gem-test/gem-build-java.sh index 32106e8c1d..4f5ea5fbbc 100755 --- a/concourse/tasks/gem-test/gem-build-java.sh +++ b/concourse/tasks/gem-test/gem-build-java.sh @@ -20,6 +20,10 @@ bundle exec rake set-version-to-timestamp bundle exec rake java gem +if [ -e ./scripts/test-gem-file-contents ] ; then + ./scripts/test-gem-file-contents pkg/nokogiri*java.gem +fi + mkdir -p ${OUTPUT_DIR} cp -v pkg/nokogiri*java.gem ${OUTPUT_DIR} sha256sum ${OUTPUT_DIR}/* diff --git a/concourse/tasks/gem-test/gem-build.sh b/concourse/tasks/gem-test/gem-build.sh index 8bfc0cb6e0..ca729a9a10 100755 --- a/concourse/tasks/gem-test/gem-build.sh +++ b/concourse/tasks/gem-test/gem-build.sh @@ -32,6 +32,10 @@ else bundle exec rake clean compile bundle exec rake gem + + if [ -e ./scripts/test-gem-file-contents ] ; then + ./scripts/test-gem-file-contents pkg/nokogiri*.gem + fi fi mkdir -p ${OUTPUT_DIR} diff --git a/concourse/tasks/gem-test/gem-install-and-test.sh b/concourse/tasks/gem-test/gem-install-and-test.sh index b7b55e240b..fa64711813 100755 --- a/concourse/tasks/gem-test/gem-install-and-test.sh +++ b/concourse/tasks/gem-test/gem-install-and-test.sh @@ -26,6 +26,10 @@ pushd nokogiri bundle install --local || bundle install bundle info nokogiri + if [ -e ./scripts/test-gem-installation ] ; then + ./scripts/test-gem-installation + fi + bundle exec rake test:cmd > run-test rm -rf lib ext # ensure we can't use the local files bundle exec bash run-test