-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Windows, test mode requires an extra line after the summary line #981
Comments
This is an interesting edge case. One of the last minute changes to #962 was to remove the explicit call sending SIGINT when the success/failure line was detected, in favour of soft-requesting the end of streaming the first time you process a line when a success criterion has been detected. This means that the test suite won't terminate itself unless there is at least one additional line after the success criterion. The test suite will also terminate if the test process itself fails. However, in the case of the GUI tests where an app is being started in the background, the test process won't stop, because it's a running app. So - because the test suite doesn't produce a line of output after the success line, and the main process doesn't stop on its own, the test suite never terminates. The immediate workaround: Put an additional line of output in the test suite. Possible fixes:
I think (2) makes the most sense; I'm not wild about the tuple return value, but I'm not sure I see a cleaner option, and a tuple isn't that bad as a log filter return value. |
Maybe a little half-baked....but the streamer could require (or allow) |
Are you suggesting that streamer would invokes Alternatively, we'd need to rejigger the whole of the streaming mechanism to make the filter function take control of consuming the log input - which I'm not sure would be any different from making the |
Basically. The motivation for a generator here would be to continue allowing the streamer to be responsible for printing while returning control back to Another (even more half-baked :) idea is to allow |
Thinking about this some more, the other upside to using |
Describe the bug
The app in beeware/toga#1687 contains a call to exit the app once the tests are complete. This line should not be necessary, because
briefcase run --test
should exit once the pytest summary line is detected. But if you comment it out, Briefcase prints the summary line:and then hangs until you manually close the window. Only then does it print:
and then Briefcase exits.
I suspect this may be something to do with the way the LogFilter sets its
success
attribute but doesn't check it until the following iteration. Sure enough, if you add aprint
afterpytest.main
, the extra line does not appear, butbriefcase run --test
now exits correctly, and kills the app as well.Environment:
The text was updated successfully, but these errors were encountered: