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

Re: gem2deb running tests during build



Hello,

>Hello Manas,
>
>Try to skip the test , using export DH_RUBY_IGNORE_TESTS = all and
>checking
>> it in sbuild if its running well.
>>
>
>Thank you, that solved. But i'm just wondering now, what would be the
>better approach, to ignore tests or to override the build target and
>prepare the environment to run the tests?

We should try to run the tests and if it is very hard, then only we should ignore it.

Agreed.
 
>The process of "preparing the environment" consist of:
>
>>     mkdir -p /tmp/fakehome/.wpscan
>>     # unzip before tests because tests need data
>>     unzip -o data.zip -d /tmp/fakehome/.wpscan/
>>     HOME=/tmp/fakehome RUBYLIB=$(CURDIR)/lib ruby
>debian/ruby-tests.rb
>>

Add override_dh_auto_test target to rules and add these commands.

The weird thing is the tests are being run on dh_auto_install, not on auto_test, at least that's what i understand from the build log:

Failed examples:

rspec ./spec/lib/common/models/wp_version/findable_spec.rb:178 # WpVersion::Findable ::find_from_stylesheets_numbers invalid url returns nil

ERROR: Test "ruby2.5" failed. Exiting.
dh_auto_install: dh_ruby --install /<<PKGBUILDDIR>>/debian/wpscan returned exit code 1
make[1]: *** [debian/rules:17: override_dh_auto_install] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:4: binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2

Anyway, i'll probably ignore tests since i could not fix it by overriding auto_test and i don't know how to override just the test in auto_install, at least for the first release.

Thanks

--
Samuel Henrique <samueloph>

Reply to: