Skip to content

Fix run-pass list failure exit status - #2648

Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/run-pass-list-exit-code
Open

Fix run-pass list failure exit status#2648
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/run-pass-list-exit-code

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Describe your changes

olive run-pass --list-passes catches errors while loading the pass configuration, prints an error, and then returns normally. The CLI therefore exits with status 0 even though the requested operation failed, which can make scripts and CI treat a failure as success.

This change preserves the existing diagnostics but exits with status 1 when pass configuration loading fails.

Tests

Adds a regression test that simulates a configuration-loading failure and asserts a non-zero exit status.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary. No documentation change required.

Copilot AI lite review requested due to automatic review settings September 3, 2026 18:23
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is small and targeted, and it includes a regression test validating the corrected non-zero exit behavior.

Pull request overview

This PR fixes olive run-pass --list-passes so that failures while loading pass configuration produce a non-zero process exit status, preventing CI/scripts from treating a failed operation as successful.

Changes:

  • Exit with status code 1 when pass configuration loading fails during --list-passes.
  • Add a regression test that simulates configuration-loading failure and asserts a non-zero exit code.
File summaries
File Description
olive/cli/run_pass.py Raises SystemExit(1) on pass config load failure so the CLI returns a failure status.
test/cli/test_run_pass_exit_status.py Adds a regression test for non-zero exit status on --list-passes failure.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +21 to +22
with pytest.raises(SystemExit) as exc_info:
command._list_passes()
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