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

Re: Speedbump while running tests for ruby-omniauth-rails-csrf-protection



Hi again,

On Wed, Oct 26, 2022 at 12:41:57AM +0530, Nilesh Patra wrote:
> On Tue, Oct 25, 2022 at 10:55:41PM +0530, Abraham Raji wrote:
> > > Are you building in a clean chroot? And can you push your package somewhere?
> > > (The pasted logs don't give much clue)
> > I'm building in a sid container that I've created for packaging. I
> > haven't done much with the package, I just generated the files with
> > gem2deb and imported them to a git repo. I have pushed everything
> > here[1].
> 
> As far as I understand, in the tests it is trying to initialize an inline
> gemfile with a "bundler/inline" and then trying to run rails app on top
> of that.
> And probably while initializing a rails app, a bundler install local is
> called which is likely why it tries to do so.
> 
> I tried patching out the silence warnings lines, [...]

I guess this is a more complicated route. The easier path is to
simply install test deps with a B-D
Here's what I did to get the build going:

1. The `git` calls in gemspec need to be patched to something sensible as git
is not guaranteed in build time, more context at[2]. So I patched it with:

-  spec.files       = `git ls-files`.split("\n")
-  spec.test_files  = `git ls-files -- test/*`.split("\n")
+  spec.files       = Dir.glob('**/*').reject { |f| f.match(%r{^(debian|test|spec|features)/}) }
+  spec.test_files  = spec.files.grep(%r{^(test|spec|features)/})

2. Add in a build-deps on "ruby-rails <!nocheck>" (as this is mentioned also in internal gemspec)

post this, it built+tested just fine.

> > [1]: https://salsa.debian.org/abraham/ruby-omniauth-rails-csrf-protection
[2]: https://lists.debian.org/debian-ruby/2017/12/msg00005.html

Hope this helps.

-- 
Best,
Nilesh

Attachment: signature.asc
Description: PGP signature


Reply to: