Skip to content
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

Ensure that WorkChain._do_step return None, int or ExitCode #1704

Merged
merged 1 commit into from
Jun 30, 2018

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jun 29, 2018

Fixes #1693

In the case where the return value of the stepper was not of type
None, int or ExitCode, yet the stepper considered itself to be finished,
for example when the last step was executed, the return value of the
stepper would be returned, which could have any type. However, the
result of _do_step should only be an exit status, i.e. int or ExitCode.
To fix this, we explicitly check the return value of the stepper and
convert any type other than int or ExitCode to None.

In the case where the return value of the stepper was not of type
None, int or ExitCode, yet the stepper considered itself to be finished,
for example when the last step was executed, the return value of the
stepper would be returned, which could have any type. However, the
result of _do_step should only be an exit status, i.e. int or ExitCode.
To fix this, we explicitly check the return value of the stepper and
convert any type other than int or ExitCode to None.
@sphuber sphuber requested a review from muhrin June 29, 2018 15:56
@codecov-io
Copy link

Codecov Report

Merging #1704 into develop will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1704      +/-   ##
===========================================
+ Coverage    57.14%   57.15%   +<.01%     
===========================================
  Files          275      275              
  Lines        33931    33931              
===========================================
+ Hits         19390    19393       +3     
+ Misses       14541    14538       -3
Impacted Files Coverage Δ
aiida/work/processes.py 95.2% <0%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5c5a86...f2a1fa0. Read the comment docs.

Copy link
Contributor

@muhrin muhrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

très bien

@sphuber sphuber merged commit ca9d1fd into aiidateam:develop Jun 30, 2018
@sphuber sphuber deleted the fix_1693_do_step_return_dict branch June 30, 2018 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on_finish can get an (empty) dictionary which shouldn't happen
3 participants