Skip to content

Add key frame to asserts#1010

Open
skyyaoyao wants to merge 2 commits into
google:masterfrom
skyyaoyao:add-key-frame-to-asserts
Open

Add key frame to asserts#1010
skyyaoyao wants to merge 2 commits into
google:masterfrom
skyyaoyao:add-key-frame-to-asserts

Conversation

@skyyaoyao

Copy link
Copy Markdown

Description

This PR automatically captures key frame data (action, timestamp, and details) upon any Mobly assertion failure and injects it into the test records.

By injecting this into the assertion's extras dictionary, we ensure the metadata is seamlessly captured into the test_summary.yaml for downstream parsers, without requiring manual tracking or adding overhead to passing assertions.

A new _add_key_frame helper is implemented and tied into both standard unittest wrappers (_call_unittest_assertion) and direct Mobly assertions (fail()).

Testing Done

  • Verified the key_frame block successfully serializes into test_summary.yaml logs upon assertion failures with real Mobly test.
  • Re-ran the full Mobly py-test suite (pytest tests/mobly). Updated the internal base_test_test.py tests that rigorously expected actual_record.extras to be None to instead gracefully accept the injected key_frame data on failures.

Yao Yao added 2 commits July 14, 2026 09:45
Automatically captures key frame data (action, timestamp, details) upon any Mobly assertion failure and injects it into the extras dictionary to ensure it is captured in the test_summary.yaml file.
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.

1 participant