Skip to content

Conversation

@amytsengtw
Copy link
Contributor

Ensures that Mobly returns a non-zero exit code when TestAbortAll is raised,
preventing CI/CD systems from incorrectly reporting success.

Fixes #960

Copy link
Collaborator

@xpconanfan xpconanfan left a comment

Choose a reason for hiding this comment

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

please add a corresponding unit test

Copy link
Collaborator

@xpconanfan xpconanfan left a comment

Choose a reason for hiding this comment

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

Please add a test for this scenario
There are other tests in test_runner_test already

ok = runner.results.is_all_pass and ok
except signals.TestAbortAll:
pass
ok = False
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's stay consistent with the next block in terms of the order between the two lines

@amytsengtw
Copy link
Contributor Author

Fixed the testbed_name typo and added a self-contained unit test test_main_exits_with_error_on_test_abort_all. The test now creates its own temporary config to verify the exit code when signals.TestAbortAll is raised. Ready for another review

expected_info_dict['Controller Info'], info.controller_info
)

def test_main_exits_with_error_on_test_abort_all(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this test next to the other test_main_* tests and try to maintain a reasonable order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobly exits with status code 0 after TestAbortAll

2 participants