-
Notifications
You must be signed in to change notification settings - Fork 17
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
Test and update the wizard
module
#466
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #466 +/- ##
==========================================
+ Coverage 77.41% 79.32% +1.90%
==========================================
Files 26 27 +1
Lines 3626 3685 +59
==========================================
+ Hits 2807 2923 +116
+ Misses 819 762 -57
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
@yakutovicha thanks! only some minor requests.
BTW, Is that possible to address #343 here?
The issue seems caused from when the accordion widget has all steps folder, the selected_index
can be None
, when status of a step widget is reset, it triggers widget update and hint at the exception.
# last step success and reset (To mimic new workflow in QeApp)
assert s1.state == s1.State.SUCCESS
widget.accordion.selected_index = None
s1.state = s1.State.INIT # this will trigger the update method and hint the problem
aiidalab_widgets_base/wizard.py
Outdated
if not testing: # pytest is hanging if we start a thread | ||
threading.Thread(target=spinner_thread).start() |
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.
if not testing: # pytest is hanging if we start a thread | |
threading.Thread(target=spinner_thread).start() | |
self.spinner_thread = threading.Thread(target=spinner_thread).start() |
The thread can be stop and joined in the test explicitly. It is also good to leave a handler attribute to get control of inner thread.
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.
How would you do that? I tried the following, but it didn't work:
self.spinner_thread._stop()
The only working option I could think of is do something like so:
self._run_update_thread = True
def spinner_thread():
while self._run_update_thread:
time.sleep(0.1)
self._update_titles()
threading.Thread(target=spinner_thread).start()
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.
Did you try self.spinner_thread.join()
this will wait for the thread to stop and finish. We did it here https://github.com/aiidalab/aiidalab/blob/50498b08ea77937cb8af0e8d753446dd17b6d637/tests/test_appclass.py#L87-L104
we can try together.
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.
Did you try
self.spinner_thread.join()
this will wait for the thread to stop and finish. We did it here https://github.com/aiidalab/aiidalab/blob/50498b08ea77937cb8af0e8d753446dd17b6d637/tests/test_appclass.py#L87-L104 we can try together.
The problem is that the current loop is infinite:
while True:
....
So there is no reason for it to stop. And calling _stop()
didn't stop it, it just excepted.
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.
fixed in 35756f1
Co-authored-by: Jusong Yu <jusong.yeu@gmail.com>
…com/aiidalab/aiidalab-widgets-base into chore/test-and-update-wizard-module
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.
Thanks Looks all good to me.
fixes #461
fixes #343