This is an archive of the discontinued LLVM Phabricator instance.

[lit] Fix UnboundLocalError for invalid shtest redirects
ClosedPublic

Authored by mgorny on Jul 25 2017, 2:35 PM.

Details

Summary

Replace the incorrect variable reference when invalid redirect is used.
This fixes the following issue:

File "/usr/src/llvm/utils/lit/lit/TestRunner.py", line 316, in processRedirects
  raise InternalShellError(cmd, "Unsupported redirect: %r" % (r,))

UnboundLocalError: local variable 'r' referenced before assignment

which in turn broke shtest-shell.py and max-failures.py lit tests.

The breakage was introduced during refactoring in rL307310.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Jul 25 2017, 2:35 PM
modocache accepted this revision.Jul 25 2017, 2:38 PM

Nice catch, thanks!

You reminded me that I need to follow up on the comments on https://reviews.llvm.org/D27701, in order to get the lit tests running continuously, so that failures like this won't be introduced in the future.

This revision is now accepted and ready to land.Jul 25 2017, 2:38 PM

Yes, I had a similar idea but I think we need to get the tests to pass first. Do you want me to continue bisecting bugs or are you planning to do some yourself? I've found one caused by D35091 but I don't see an obvious solution there, so any help would be appreciated.

@mgorny Thanks for all your help here! Personally I think the best course of action would be to:

  1. Mark tests that began failing with D35091 as XFAIL
  2. Mark tests that fail on Windows as XFAIL: windows
  3. Un-revert or reimplement rL257221, so that lit tests run continuously
  4. Remove the XFAILs one by one

I'd be happy to send the diffs for this tonight or tomorrow, or feel free to beat me to it.

Please do it. I've got my plate full. I'm going just to finish complaining on the patches that broke stuff and hopefully get some good out of that.

This revision was automatically updated to reflect the committed changes.

OK, @mgorny, I sent up diffs for the above! I wrote down the details as a comment on https://bugs.llvm.org/show_bug.cgi?id=33704. Thanks!