-
Notifications
You must be signed in to change notification settings - Fork 182
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
Record suite info in test summary yaml. #949
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this impact any downstream parsing of the results? Would the new entries be ignored by default?
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @mhaoli and @xpconanfan)
mobly/records.py
line 734 at r1 (raw file):
"""A record representing the suite info in test summary.""" KEY_SUITE_CLASS_NAME = 'Suite Class Name'
Could simplify to Suite Name.
Code quote:
KEY_SUITE_CLASS_NAME
mobly/records.py
line 739 at r1 (raw file):
def __init__(self, suite_class_name): self.suite_class_name = suite_class_name self.timestamp = time.time()
Would it be better to record a begin and end time instead? So we can report the total execution time of a suite.
Code quote:
self.timestamp = time.time()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some verification and think this CL should be safe. I'd love to know if you suggest other things to be checked.
I ran a mobly_mh_test successfully, consulted Yao about the result parsing logic, did code search to find possible breakage. I only found that a warning will be printed on MH side, I'll ask MH team about how to fix it.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @xianyuanjia and @xpconanfan)
mobly/records.py
line 734 at r1 (raw file):
Previously, xianyuanjia wrote…
Could simplify to Suite Name.
I'm considering suite name may contain more info than only suite class name. Pinged you to discuss offline.
mobly/records.py
line 739 at r1 (raw file):
Previously, xianyuanjia wrote…
Would it be better to record a begin and end time instead? So we can report the total execution time of a suite.
Good idea. DONE.
Do you really need a new class for a string and two timestamps?
Also, why adding a field to the test report when most situations don't
involve suite?
Could you do this without modifying the records module?
…On Tue, Dec 3, 2024, 10:05 PM Minghao Li ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In mobly/records.py
<#949 (comment)>:
>
- def __init__(self, suite_class_name):
- self.suite_class_name = suite_class_name
- self.timestamp = time.time()
+ KEY_SUITE_CLASS = 'Suite Class'
The test suite class that inherits from base_suite.BaseSuite.
If "Suite Class" is not clear enough, I modified it to "Test Suite Class".
—
Reply to this email directly, view it on GitHub
<#949 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARDNZNL6BSEBKWZLSNXTTT2DWUC7AVCNFSM6AAAAABS3LVKAKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINZVGYZDQMJXGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I just thought this is a proper way to record mobly internal info to summary file. If we want to avoid modifying the |
Since the suite info is only created by suite runner, would it make sense
to have the suite runner to simply append a section in the results yaml at
the end?
Also, would it make sense to summarize other info in the suite info? Like
suite version, total pass/fail
…On Tue, Dec 3, 2024, 10:32 PM Minghao Li ***@***.***> wrote:
Do you really need a new class for a string and two timestamps? Also, why
adding a field to the test report when most situations don't involve suite?
Could you do this without modifying the records module?
I just thought this is a proper way to record mobly internal info to
summary file.
If we want to avoid modifying the records module, I can record the suite
info with record type UserData. Modifying.
—
Reply to this email directly, view it on GitHub
<#949 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARDNZKMTAZBAFFADW2PC532DWXHNAVCNFSM6AAAAABS3LVKAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJUGU3DQMJXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…o BaseSuite and record it to test summary
c2a8049
to
929cfe8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved comments in this thread.
Reviewable status: 0 of 5 files reviewed, 5 unresolved discussions (waiting on @xianyuanjia and @xpconanfan)
mobly/records.py
line 734 at r1 (raw file):
Previously, mhaoli (Minghao Li) wrote…
I'm considering suite name may contain more info than only suite class name. Pinged you to discuss offline.
Added a field 'Suite Name' which is either the suite class name or a user defined suite name. But I didn't remove field Test Suite Class
as I think we need to keep this info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 5 files at r4, 3 of 3 files at r6, all commit messages.
Reviewable status: 4 of 5 files reviewed, 7 unresolved discussions (waiting on @mhaoli and @xpconanfan)
mobly/base_suite.py
line 56 at r6 (raw file):
"""The name of this suite. By default, use the name of the test class. User can overwrite to return
suite class?
Code quote:
test class
mobly/base_suite.py
line 73 at r6 (raw file):
A dict of suite information. Keys and values must be serializable. """ return {}
There is no implementation here. Is this intentional? If so, please leave a TODO.
Code quote:
return {}
mobly/suite_runner.py
line 114 at r6 (raw file):
_end_time: int | None def __init__(self, test_suite_class):
Is there anywhere that indicates clearly that this record only works for suite classes and not suites directly assembled via run_suite
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 5 files reviewed, 7 unresolved discussions (waiting on @xianyuanjia and @xpconanfan)
mobly/base_suite.py
line 56 at r6 (raw file):
Previously, xianyuanjia wrote…
suite class?
Good catch. DONE.
mobly/base_suite.py
line 73 at r6 (raw file):
Previously, xianyuanjia wrote…
There is no implementation here. Is this intentional? If so, please leave a TODO.
This is intentional. This method is for users to override to record customized info to test summary, e.g. suite version. By default, it just returns an empty dict.
Modified docstring to clarify this.
mobly/suite_runner.py
line 114 at r6 (raw file):
Previously, xianyuanjia wrote…
Is there anywhere that indicates clearly that this record only works for suite classes and not suites directly assembled via
run_suite
?
Good point, clarified this point in docstring of this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 1 of 5 files reviewed, 4 unresolved discussions (waiting on @xpconanfan)
# Optional interfaces that users can override to record customized suite | ||
# information to test summary. | ||
|
||
def get_suite_name(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this just be part of the suite info?
why should it be a separate getter method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test suites can return any custom values in suite info
, our infra won't parse it and just write it to summary file.
So I created separate getter methods for fields that our infra needs to parse.
""" | ||
return self.__class__.__name__ | ||
|
||
def get_run_identifier(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is "run identifier"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for key run context that will be displayed as part of the title in our result viewer.
Through this we can include info like the phone brand and phone model.
Record the suite class name in summary yaml. No information will be added if the test is triggered by
suite_runner.run_suite
.To record suite info, this PR adds a new test summary entry type
SuiteInfo
and record classSuiteInfoRecord
.This change is