-
Notifications
You must be signed in to change notification settings - Fork 184
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
KeyboardInterrupt terminates log non-gracefully #498
Comments
Thanks for reporting! We actually have a plan to improve sigterm handling, including releasing the controller objects properly in this situation. Would you be willing to tell us more about your use case? It sounds like you are running Mobly with a larger system that expects the records in results to be consistent? |
We're looking to integrate with Jenkins using XML reporting, for regularly run UI tests. The ideal case likely would have been xmlrunner compatability as a test runner, but I've made a yaml-xml converter which is sufficient for our needs. The KeyboardInterrupt isn't a particularly expected use case for us, but I happened to run into this while developing the xml converter and figured it merited an issue. The other use case I found myself wanting (and which might merit another issue) is a way to pass args into the BaseTest class's instantiation or its call to setup_class() - it can grab a var(s) from the config file, but we'd like to be able to override the config value with a cmd line flag as well. Since test_runner keeps the class object to itself, I worked around this with global vars for now, which is quite ugly. |
|
We simply call test_runner.main() in a larger python script as in some of the examples, with some cli args passed into it via string. test_runner.main() kills itself with sys.exit (if a test failed) when its done, I catch that and then simply convert the yaml log directly to xml as best I can, using python's xml.etree.ElementTree module; not trying to follow the xmlrunner format very closely. I'll open an issue for the cli args passing |
Ah, that's good to know. While We made sure the So you can implement your own We didn't advertise this in github bc it has not been asked by external users. Now that we see the usage, we will try to add more docs on that. |
After a testsuite is halted due to keyboardinterrupt, the ControllerInfo summary in the yaml log file will have 0 in all categories (even Requested) regardless of prior test results. Also, the current test will have mostly null values recorded, and any unrun testcases will not have entries.
It would be nice if all results received prior to the interrupt were properly recorded.
It would also be nice if all the tests that never got to be started were listed as skipped with an appropriate explanation.
Finally it's up to you whether or not the current test should have an explicit fail, a skip, or leave it with the nulls, since any of those is a more subjective choice (can the test really be said to 'fail' when it was interrupted? Perhaps not). But it would be nice if the current test log entry mentioned in some way that it stopped due to a keyboard interrupt and not due to its own or Mobly's fault.
The text was updated successfully, but these errors were encountered: