Skip to content

config: runtime: tests: tast: enable code coverage support #2940

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

a-wai
Copy link
Contributor

@a-wai a-wai commented Aug 7, 2025

Other tests for which we enabled code coverage support run directly on the DUT and are therefore easy to process using additional common test definitions. However, for Tast tests, we execute commands from a container and need to use SSH for executing commands on the DUT which actually runs ChromeOS.

For this reason, we can't re-use the existing gcov-related utility templates for Tast test and need to re-implement the whole logic separately:

  • provide scripts for:
    • resetting coverage data before running the test
    • packing coverage data once the test is complete
  • copy those scripts to the DUT using SCP and execute them when needed through SSH
  • retrieve coverage data from DUT and upload it to storage

All those commands need to be fail-safe, hence the (ab)use of || true so we end up proprely shutting down the DUT (not doing so leads to filesystem corruption, requiring the DUT to be reflashed).

Other tests for which we enabled code coverage support run directly on
the DUT and are therefore easy to process using additional common test
definitions. However, for Tast tests, we execute commands from a
container and need to use SSH for executing commands on the DUT which
actually runs ChromeOS.

For this reason, we can't re-use the existing gcov-related utility
templates for Tast test and need to re-implement the whole logic
separately:
* provide scripts for:
  * resetting coverage data before running the test
  * packing coverage data once the test is complete
* copy those scripts to the DUT using SCP and execute them when needed
  through SSH
* retrieve coverage data from DUT and upload it to storage

All those commands need to be fail-safe, hence the (ab)use of `|| true`
so we end up proprely shutting down the DUT (not doing so leads to
filesystem corruption, requiring the DUT to be reflashed).

Signed-off-by: Arnaud Ferraris <[email protected]>
@a-wai
Copy link
Contributor Author

a-wai commented Aug 7, 2025

Draft for now as it needs more testing on staging (only manually tested by hand-editing job definitions in LAVA so far)

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