Skip to content

Add error handling for exit code of Chocolatey #7575

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

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

thomasspriggs
Copy link
Contributor

@thomasspriggs thomasspriggs commented Mar 3, 2023

This PR adds error handling for exit code of Chocolatey. The enables jobs to fail fast when dependency installation fails rather than failing later when the dependency needed is missing. Error handling was tested -

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Powershell does not automatically exit a script when an `.exe` returns a
non-successful exit code. This is due to a lack of exit code
standardisation across programs for the Windows platform. Therefore we
need to check for the particular exit code of an `.exe` in order to
report it to the github actions platform. Note that exit codes from
`.exe` invocations are placed in `$LastExitCode` and exit codes from
Powershell cmdlets such as `Write-Output` are placed in the separate
`$?` variable.
@thomasspriggs thomasspriggs force-pushed the tas/chocolate_error branch 2 times, most recently from 362ae12 to 8ccaf19 Compare March 3, 2023 12:42
@thomasspriggs thomasspriggs marked this pull request as ready for review March 3, 2023 12:44
@thomasspriggs thomasspriggs requested a review from a team as a code owner March 3, 2023 12:44
@thomasspriggs thomasspriggs merged commit ec46ac8 into diffblue:develop Mar 3, 2023
@thomasspriggs thomasspriggs deleted the tas/chocolate_error branch March 3, 2023 14:33
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