[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFH: jekyll fails autopkgtest but succeeds all tests on build time



On Sun, Jan 05, 2020 at 09:42:05PM +0100, Daniel Leidert wrote:
> Hi there,
> 
> I was recently working on jekyll to fix the issues preventing a bunch of
> packages from migrating to testing. During this I observed that autopkgtest
> fails with the same issue locally and on salsa.debian.org [1] although the
> build running the same testset succeeds [2]. It is possible, that this is
> related to #846115 [3,4].
> 
> The only obvious difference is that in autopkgtest RUBYLIB is set to the
> current path and GEM_PATH= is empty.
> 
> Can someone experienced please help to sort out the situation?

I tried it from git locally, and the one test that errors out under autopkgtest
is:

Error:
Minitest::Result#test_: folded YAML string should ignore newlines in that string entirely from the template file. :
LoadError: The Configuration file '/tmp/autopkgtest-lxc.nruytu7m/downtmp/build.YUe/src/lib/site_template/_config.yml' could not be found.

This is a common issue: note that the test is trying to open a file under lib/,
which is moved away under autopkgtest to avoid loading any code from the source
tree, since autopkgtest is supposed to test the installed packages.

You need to patch the test in a way that the file can be found in the source
tree during the build, and in installed package on autopkgtest. one way of
doing it is using Gem.find_files:

$ pwd
/home/terceiro/src/debian/ruby-team/jekyll
$ ruby -Ilib -e "puts Gem.find_files('site_template/_config.yml')"
/home/terceiro/src/debian/ruby-team/jekyll/lib/site_template/_config.yml
/usr/lib/ruby/vendor_ruby/site_template/_config.yml
$ ruby -e "puts Gem.find_files('site_template/_config.yml')"
/usr/lib/ruby/vendor_ruby/site_template/_config.yml
$

i.e. in this case, you can use Gem.find_files(...).first

Now, `site_template` is kind of a gratuitous namespace grab, perhaps it would
be better to switch jekyll to a rubygems layout install, and/or ideally
convinging upstream to move that under jakyll/

Attachment: signature.asc
Description: PGP signature


Reply to: