-
Notifications
You must be signed in to change notification settings - Fork 91
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
Separating report_target application in interactive mode #1034
Separating report_target application in interactive mode #1034
Conversation
testplan/testing/multitest/base.py
Outdated
getattr(self, "parent", None) | ||
and hasattr(self.parent, "cfg") | ||
and self.parent.cfg.interactive_port is not None | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied over the condition so that possible refactorization catches both occurrences, there should be better ways to test interactivity.
I suggest that we address the performance issues more thoroughly, there are 3 of them:
|
Except for 2 I agree. The default on came from business requirement, let me reach you offline with that. |
…t between interactive and batch execution modes.
def add_created_environment(self, env_uid): | ||
"""Add an environment from the created environment maker instance.""" | ||
self.target.add_environment(self._created_environments[env_uid]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All kinds of unused functions, we can restore from history if needed at some point.
continue | ||
else: | ||
new_report[multitest.uid][suite.uid].entries[ | ||
case_index | ||
] = suite[case.uid] | ||
except KeyError: | ||
except (KeyError, IndexError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We checked and this was breaking testcase removal, the reloader would not handle the IndexError that is thrown by lists, we only continued here originally upon KeyError.
@@ -467,7 +454,7 @@ def get_test_context(self): | |||
testcase_instance, None | |||
) | |||
if data is not None: | |||
testcase.__xfail__ = { | |||
testcase.__func__.__xfail__ = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a side effect from report_target, it was turning the bound method into a free function, but here we need to access now the func attribute.
Bug / Requirement Description
The report_target decorator is applied in test_context every time the interactive mode accesses it. This results in an overhead during startup, and also runtime.
Solution description
For now we are moving to the runner method with report_target in interactive mode. Longer term we need to make reapplication dependent on the reload.
Checklist: