fix: job run command exits with status code 1 on failure. #134
+152
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Description of new changes
Fix #128
This pull request fixes the behavior of the job run command so that it properly exits with status code 1 when a job fails, and adds comprehensive unit tests to verify error handling. The main changes focus on error reporting and test coverage for job failures.
Error handling improvements:
wait_for_job_completioninfab_cmd_job_utils.pyto raise aFabricCLIErrorwithERROR_JOB_FAILEDwhen a job status is'Failed', ensuring the CLI exits with code 1 on failure.Testing enhancements:
test_jobs.pyto verify that job failures (including with a timeout) correctly raiseFabricCLIErrorand result in exit code 1, improving confidence in error handling for failed jobs.FabricCLIErrorintest_jobs.pyto support new failure-handling tests.