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

Support finding suite class that is not defined in the main module. #948

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

mhaoli
Copy link
Collaborator

@mhaoli mhaoli commented Dec 2, 2024

Background: Current implementation only searches for the test suite class in the __main__ module. But projects like BeToCQ are running in a different approach, which causes that test suite class is not in the __main__ module.

Change: When suite class is not found in the main module, search for it in the module of the caller of suite_runner.run_suite_class.


This change is Reviewable

@mhaoli mhaoli added this to the Mobly Release 1.13 milestone Dec 2, 2024
@mhaoli mhaoli self-assigned this Dec 2, 2024
xianyuanjia
xianyuanjia previously approved these changes Dec 2, 2024
Copy link
Collaborator

@xianyuanjia xianyuanjia left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mhaoli and @xpconanfan)


mobly/suite_runner.py line 185 at r1 (raw file):

    if len(stacks) < 2:
      logging.debug(
          f'Failed to get the caller stack of run_suite_class. Got stacks: %s',

Nit: this is not a f-string

Code quote:

f

Copy link
Collaborator Author

@mhaoli mhaoli left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @xianyuanjia and @xpconanfan)


mobly/suite_runner.py line 185 at r1 (raw file):

Previously, xianyuanjia wrote…

Nit: this is not a f-string

Thanks. DONE.

Copy link
Collaborator

@xianyuanjia xianyuanjia left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 1 of 3 files reviewed, all discussions resolved (waiting on @xpconanfan)

@mhaoli mhaoli merged commit 130f6d9 into google:master Dec 13, 2024
7 of 8 checks passed
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.

2 participants