[DRE-maint] Bug#674324: ruby-net-sftp: FTBFS: test failed
Cédric Boutillier
boutil at debian.org
Sun Oct 14 14:26:36 UTC 2012
Package: ruby-net-sftp
Followup-For: Bug #674324
Hi!
I investigated this a little bit further. Here are my findings so far.
There is a kind of conflict between two tests:
- test_from_buffer_should_correctly_parse_buffer_and_return_attribute_object
from test/protocol/04/test_attributes.rb
- test_parse_attrs_packet_should_use_correct_attributes_class
from test/protocol/01/test_base.rb
which occurs with versions of ruby-mocha posterior to the commit I
mentionned above.
When run independently the tests pass. When the tests are run together,
the method :from_buffer is not restored completely in its initial state
after the call to expects method on
Net::SFTP::Protocol::V01::Attributes: The method :from_buffer called on
a child class of Net::SFTP::Protocol::V01::Attributes (e.g.
Net:SFTP::Protocol::V04::Attributes) should return an object from the
child class. But after the expect statement, it returns a
Net::SFTP::Protol::V01::Attributes object, which is the cause of
different results in computations, and thus results in test failure.
[The same problem occurs when expects alters :from_buffer for
Net::SFTP::Protocol::V04::Attributes and :from_buffer is called from
test/protocol/06/test_attributes.rb]
Attached a condensed test file which shows the issue, which could be run
once the source package is unpacked and the patches applied with
testrb -I test/ path/to/test-failure.rb
from the root directory of the source package.
Commenting the first test class of the file makes the second test pass.
Since all the tests pass ok when run separately, it is not really a bug in
ruby-net-sftp per se. Just tests broken by some subtle modification of
ruby-mocha.
If it turns out that my diagnostic is correct, I would propose the
following:
- clone this bug, with severity important (or even normal) to
ruby-mocha, indicating that it affects ruby-net-sftp
- close this one by commenting the tests
'test_parse_attrs_packet_should_use_correct_attributes_class' and wait
for the bug in ruby-mocha to be closed to reactivate them.
I am preparing a toy example reproducing this bug to send to ruby-mocha
upstream.
Cheers,
Cédric
_
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-failure.rb
Type: application/x-ruby
Size: 1376 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20121014/0de2ebf8/attachment.rb>
More information about the Pkg-ruby-extras-maintainers
mailing list