CoBrALab / qbatch

The Unlicense
27 stars 13 forks source link

qstat xml parsing can't handle empty joblist #82

Closed gdevenyi closed 8 years ago

gdevenyi commented 8 years ago

If qstat -x returns nothing, ET parsing fails, triggering an exception and breaking qbatch.

  File "<string>", line unknown
ParseError: no element found: line 1, column 0

qbatch stops at this point, but it should probably check for qstat -x having no output or at least warn that no dependencies are possible because of no jobs running.

pipitone commented 8 years ago

Good catch. Let's write a test for this and then a fix. :-)

I agree a warning here makes sense... perhaps only under verbose mode?

gdevenyi commented 8 years ago

Test is hard since Travis doesn't have a real qstat...

Yes, warn on verbose makes sense

pipitone commented 8 years ago

Test is hard since Travis doesn't have a real qstat...

Yeah, either factor out the call to qstat so that there is a testable function that only inspects the output, or mock the call to subprocess or mock qstat (kinda cool actually).

Overkill?

gdevenyi commented 8 years ago

Overkill for now.

Fixed by #86