Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8754 > unrolled thread

Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)

Started byAndreas Tille <andreas@an3as.eu>
First post2016-08-13 08:50 +0200
Last post2016-08-17 15:30 +0200
Articles 10 — 4 participants

Back to article view | Back to linux.debian.maint.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Help for Python mock test suite needed (Was: Any help with problem  of srst2 new versions tests suite failing to call bowtie2) Andreas Tille <andreas@an3as.eu> - 2016-08-13 08:50 +0200
    Re: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2) Scott Kitterman <debian@kitterman.com> - 2016-08-13 18:50 +0200
      Re: Help for Python mock test suite needed (Was: Any help with  problem of srst2 new versions tests suite failing to call bowtie2) Andreas Tille <andreas@an3as.eu> - 2016-08-14 00:30 +0200
        Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-14 02:50 +0200
          Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-14 08:20 +0200
            Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-14 21:10 +0200
              Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-15 12:00 +0200
                Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-15 22:30 +0200
                  Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-17 14:00 +0200
                    Re: Help for Python mock test suite needed Barry Warsaw <barry@debian.org> - 2016-08-17 15:30 +0200

#8754 — Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)

FromAndreas Tille <andreas@an3as.eu>
Date2016-08-13 08:50 +0200
SubjectHelp for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)
Message-ID<s5AVz-5B0-1@gated-at.bofh.it>
Hi,

I've got no help on the Debian Med packaging list.  Is there any hint
how I could track down a test Python suite issue what exact command
was called and failed?

Thanks for any hint

      Andreas.

On Tue, Aug 09, 2016 at 11:32:40PM +0200, Andreas Tille wrote:
> Hi,
> 
> I tried to update srst2[1] package to new upstream version.
> Unfortunately its runtime test produces failures when calling bowtie2.  
> I just added some naive debugging code writing the actual system call
> to a file - but this has not lead to a final solution even if I think
> the invalid option -foo was wrong.
> 
> Any more complete hint from a possibly bowtie2 user would be helpful
> 
>      Andreas.
> 
> 
> [1] svn://anonscm.debian.org/debian-med/trunk/packages/srst2/trunk/
> 
> -- 
> http://fam-tille.de
> 
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging
> 

-- 
http://fam-tille.de

[toc] | [next] | [standalone]


#8756 — Re: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)

FromScott Kitterman <debian@kitterman.com>
Date2016-08-13 18:50 +0200
SubjectRe: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)
Message-ID<s5Kid-3N8-7@gated-at.bofh.it>
In reply to#8754
On Saturday, August 13, 2016 08:40:34 AM Andreas Tille wrote:
> Hi,
> 
> I've got no help on the Debian Med packaging list.  Is there any hint
> how I could track down a test Python suite issue what exact command
> was called and failed?
> 
> Thanks for any hint
> 
>       Andreas.
> 
> On Tue, Aug 09, 2016 at 11:32:40PM +0200, Andreas Tille wrote:
> > Hi,
> > 
> > I tried to update srst2[1] package to new upstream version.
> > Unfortunately its runtime test produces failures when calling bowtie2.
> > I just added some naive debugging code writing the actual system call
> > to a file - but this has not lead to a final solution even if I think
> > the invalid option -foo was wrong.
> > 
> > Any more complete hint from a possibly bowtie2 user would be helpful
> > 
> >      Andreas.
> > 
> > [1] svn://anonscm.debian.org/debian-med/trunk/packages/srst2/trunk/

A link to a build log showing the test failure might be helpful.

Scott K

[toc] | [prev] | [next] | [standalone]


#8761 — Re: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)

FromAndreas Tille <andreas@an3as.eu>
Date2016-08-14 00:30 +0200
SubjectRe: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2)
Message-ID<s5PBf-7sM-3@gated-at.bofh.it>
In reply to#8756
Hi Scott,

On Sat, Aug 13, 2016 at 12:41:42PM -0400, Scott Kitterman wrote:
> > > 
> > > Any more complete hint from a possibly bowtie2 user would be helpful
> > > 
> > >      Andreas.
> > > 
> > > [1] svn://anonscm.debian.org/debian-med/trunk/packages/srst2/trunk/
> 
> A link to a build log showing the test failure might be helpful.

There is no such link.  If it helps I could migrate from SVN to Git which
might lower the barrier for reproducing the issue.  The interesting part
of the build log is

cd tests && python test_slurm_srst2.py && python test_srst2.py 
...........
----------------------------------------------------------------------
Ran 11 tests in 0.040s

OK
.............FF..
======================================================================
FAIL: test_run_bowtie_with_defaults (__main__.TestRunBowtie)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "test_srst2.py", line 213, in test_run_bowtie_with_defaults
    run_mock.assert_called_once_with(expected_bowtie2_command)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'run_command' to be called once. Called 0 times.

======================================================================
FAIL: test_run_bowtie_with_overide (__main__.TestRunBowtie)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "test_srst2.py", line 180, in test_run_bowtie_with_overide
    run_mock.assert_called_once_with(expected_bowtie2_command)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'run_command' to be called once. Called 0 times.

----------------------------------------------------------------------
Ran 17 tests in 0.060s

FAILED (failures=2)


Kind regards

       Andreas.


-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#8762 — Re: Help for Python mock test suite needed

FromBen Finney <ben+debian@benfinney.id.au>
Date2016-08-14 02:50 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s5RMJ-mo-3@gated-at.bofh.it>
In reply to#8761
Andreas Tille <andreas@an3as.eu> writes:

> Hi Scott,
>
> On Sat, Aug 13, 2016 at 12:41:42PM -0400, Scott Kitterman wrote:
> > > > 
> > > > Any more complete hint from a possibly bowtie2 user would be helpful
> > > > 
> > > >      Andreas.
> > > > 
> > > > [1] svn://anonscm.debian.org/debian-med/trunk/packages/srst2/trunk/
> > 
> > A link to a build log showing the test failure might be helpful.
>
> There is no such link.

You could make one:

* Build the package using Sbuild (you are doing this already to ensure
  the build works cleanly, right?)

* Take the output from the Sbuild run.

* Paste that file on <URL:http://paste.debian.net/>.

* Reply here with the link to that complete build log.

This is an essential tool of collaborating on packaging: Ensure your
builds are initiated in their entirety with a single command, and all
output is captured for later inspect. This is why it's important to use
Sbuild or something equivalent.

-- 
 \      “Science embraces facts and debates opinion; religion embraces |
  `\    opinion and debates the facts.” —Tom Heehler, _The Well-Spoken |
_o__)                                                       Thesaurus_ |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#8763 — Re: Help for Python mock test suite needed

FromAndreas Tille <andreas@an3as.eu>
Date2016-08-14 08:20 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s5WW6-45C-1@gated-at.bofh.it>
In reply to#8762
On Sun, Aug 14, 2016 at 10:39:37AM +1000, Ben Finney wrote:
> > There is no such link.
> 
> You could make one:
> 
> * Build the package using Sbuild (you are doing this already to ensure
>   the build works cleanly, right?)

I actually uses pbuilder / cowbuilder for this purpose.
 
> * Take the output from the Sbuild run.

I made sure my pbuilder log has LC_ALL=C.

> * Paste that file on <URL:http://paste.debian.net/>.

https://paste.debian.net/789238/

> * Reply here with the link to that complete build log.

Done.  Hope this helps.

> This is an essential tool of collaborating on packaging: Ensure your
> builds are initiated in their entirety with a single command, and all
> output is captured for later inspect. This is why it's important to use
> Sbuild or something equivalent.

I admit I assumed that reproducing the log by doing a local build would
be more interesting but I'm perfectly fine by providing the log as well.
:-)

Kind regards

     Andreas.

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#8767 — Re: Help for Python mock test suite needed

FromBen Finney <ben+debian@benfinney.id.au>
Date2016-08-14 21:10 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s68Xg-3DL-19@gated-at.bofh.it>
In reply to#8763
Andreas Tille <andreas@an3as.eu> writes:

> https://paste.debian.net/789238/

That appears to be a simple failure when the test suite is run. The
assertions, as reported, are in the ‘test_srst2’ module:

=====
[…]
  File "test_srst2.py", line 213, in test_run_bowtie_with_defaults
    run_mock.assert_called_once_with(expected_bowtie2_command)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'run_command' to be called once. Called 0 times.

[…]

  File "test_srst2.py", line 180, in test_run_bowtie_with_overide
    run_mock.assert_called_once_with(expected_bowtie2_command)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'run_command' to be called once. Called 0 times.
=====

The tracebacks tell you what test case functions are emitting failures:

  File "test_srst2.py", line 213, in test_run_bowtie_with_defaults
  File "test_srst2.py", line 180, in test_run_bowtie_with_overide

Within those test case functions you can see the exact command that was
expected to be run. The assertion is that ‘srst2.run_command’ is
expected to be called (with specific arguments), but is not called,
hence the assertion fails.

-- 
 \     “Don't be afraid of missing opportunities. Behind every failure |
  `\         is an opportunity somebody wishes they had missed.” —Jane |
_o__)                                          Wagner, via Lily Tomlin |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#8771 — Re: Help for Python mock test suite needed

FromAndreas Tille <andreas@an3as.eu>
Date2016-08-15 12:00 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s6mQx-3Wz-5@gated-at.bofh.it>
In reply to#8767
On Mon, Aug 15, 2016 at 05:00:52AM +1000, Ben Finney wrote:
> > https://paste.debian.net/789238/
> 
> That appears to be a simple failure when the test suite is run. The
> assertions, as reported, are in the ‘test_srst2’ module:
> 
> =====
> […]
>   File "test_srst2.py", line 213, in test_run_bowtie_with_defaults
>     run_mock.assert_called_once_with(expected_bowtie2_command)
>   File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
>     raise AssertionError(msg)
> AssertionError: Expected 'run_command' to be called once. Called 0 times.
> 
> […]
> 
>   File "test_srst2.py", line 180, in test_run_bowtie_with_overide
>     run_mock.assert_called_once_with(expected_bowtie2_command)
>   File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 947, in assert_called_once_with
>     raise AssertionError(msg)
> AssertionError: Expected 'run_command' to be called once. Called 0 times.
> =====
> 
> The tracebacks tell you what test case functions are emitting failures:
> 
>   File "test_srst2.py", line 213, in test_run_bowtie_with_defaults
>   File "test_srst2.py", line 180, in test_run_bowtie_with_overide
> 
> Within those test case functions you can see the exact command that was
> expected to be run. The assertion is that ‘srst2.run_command’ is
> expected to be called (with specific arguments), but is not called,
> hence the assertion fails.

Yes, this is what I guessed from the log.  However, how can I find out
why exactly the command is not called?

Kind regards

      Andreas.

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#8773 — Re: Help for Python mock test suite needed

FromBen Finney <ben+debian@benfinney.id.au>
Date2016-08-15 22:30 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s6wGd-1PM-15@gated-at.bofh.it>
In reply to#8771
Andreas Tille <andreas@an3as.eu> writes:

> Yes, this is what I guessed from the log.  However, how can I find out
> why exactly the command is not called?

That seems to be a question to take up with the upstream developer, or
just normal Python debugging.

Unless I'm misunderstanding, this doesn't appear to be a problem
specific to a Debian build environment, so I would guess it fails even
when simply running the test suite in a normal development environment.

So you can use the full power of your development environment to hunt
the problem: an interactive debugging session, etc. Use your Python
skills :-)

-- 
 \         “Broken promises don't upset me. I just think, why did they |
  `\                                         believe me?” —Jack Handey |
_o__)                                                                  |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#8778 — Re: Help for Python mock test suite needed

FromAndreas Tille <andreas@an3as.eu>
Date2016-08-17 14:00 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s77FM-wB-7@gated-at.bofh.it>
In reply to#8773
On Tue, Aug 16, 2016 at 06:23:43AM +1000, Ben Finney wrote:
> Andreas Tille <andreas@an3as.eu> writes:
> 
> > Yes, this is what I guessed from the log.  However, how can I find out
> > why exactly the command is not called?
> 
> That seems to be a question to take up with the upstream developer,

Yes.

> or just normal Python debugging.

This exactly was my question:  Is there any advise how to inject
sensible debugging code or any other strategies to find out what might
be the problem.

> So you can use the full power of your development environment to hunt
> the problem: an interactive debugging session, etc. Use your Python
> skills :-)

I'm afraid at first I need to enhance my Python skills ...

Kind regards

        Andreas.

-- 
http://fam-tille.de

[toc] | [prev] | [next] | [standalone]


#8779 — Re: Help for Python mock test suite needed

FromBarry Warsaw <barry@debian.org>
Date2016-08-17 15:30 +0200
SubjectRe: Help for Python mock test suite needed
Message-ID<s794R-1zw-9@gated-at.bofh.it>
In reply to#8778
On Aug 17, 2016, at 01:58 PM, Andreas Tille wrote:

>This exactly was my question:  Is there any advise how to inject
>sensible debugging code or any other strategies to find out what might
>be the problem.
>
>> So you can use the full power of your development environment to hunt
>> the problem: an interactive debugging session, etc. Use your Python
>> skills :-)  
>
>I'm afraid at first I need to enhance my Python skills ...

pdb is debugging 101: https://docs.python.org/3/library/pdb.html

Specifically, add this line to the code at the point where you want to start
inspecting the state of the program:

    import pdb; pdb.set_trace()

Now run the test suite and when you hit the breakpoint, you can print values,
inspect object, step through calls, etc.  It may or may not help you solve the
problem, but you'll get a much better sense of what's actually going on, and
it should at least improve the quality of an upstream bug report.

Cheers,
-Barry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web