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

If command was not successful, exit with code 1, ENHANCEMENTS #97

Merged
merged 7 commits into from
Dec 8, 2024

Conversation

hannahbast
Copy link
Member

@hannahbast hannahbast commented Dec 5, 2024

Enhancing the earlier (accidental) commit df63614 which already contained the core of this change

@hannahbast hannahbast requested a review from Qup42 December 5, 2024 02:25
Copy link
Member

@Qup42 Qup42 left a comment

Choose a reason for hiding this comment

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

Tested it out and it works so far. As we're making the exit code more consistent right now, I raised some points that also fall under that umbrella. If the current behavior is intentional, you can just ignore that point.

  • StatusCommand::execute is missing a return statement at the end of the function. this results in an incorrect exit code (this is also the cause for the job failure)
  • stop.py::103 is stop unsuccessful if nothing was running? I would argue that stop is successful iff all running processes/containers of the current Qleverfile were stopped. If none are running, then stop is successful.
  • (unimportant) LogCommand::excute::56 the exit code of subprocess.call could be checked
  • add_text_index.py::70 failure testing if the binary exists and works is ignored
  • clear_cache.py::79 the return of calling CacheStatsCommand is ignored
  • example_queries.py::233 return value of ClearCacheCommand is ignored (though this seems intential due to the log muting)
  • start.py::75 return of calling StopCommand is ignored
  • start.py::192 failure setting the index description is ignored
  • start.py::203 failure setting the text description is ignored
  • start.py::212 return calling WarmupCommand is ignored
  • stop.py::76 failure getting process info is ignored (though this looks ok to me; the failure seems to not be critical)

Comment on lines 270 to 273
if not args.show:
ret_value &= self.execute_space(args)

return ret_value
return True
Copy link
Member

Choose a reason for hiding this comment

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

This breaks the command. The &= no longer work, because the variable is not defined before. The return values of execute_space and execute_time are also ignored.

@hannahbast hannahbast changed the title If command was not successful, exit with code 1 If command was not successful, exit with code 1, ENHANCEMENTS Dec 8, 2024
@hannahbast hannahbast merged commit d4e07a5 into main Dec 8, 2024
3 of 4 checks passed
@hannahbast
Copy link
Member Author

@Qup42 Thanks a lot for the very useful suggestions, I considered them all

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.

2 participants