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

Open
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).

@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)

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 <arnaud.ferraris@collabora.com>
@a-wai a-wai force-pushed the tast-coverage-support branch from 33af620 to 2725ea2 Compare August 22, 2025 09:26
@a-wai
Copy link
Contributor Author

a-wai commented Aug 22, 2025

staging-skip as the new version (relying on gcov scripts to be present in the Docker container) needs #2955 to be merged and deployed to production, and #2956 to be deployed to staging.

Please remove staging-skip from both this PR and #2956 once #2955 is deployed in production.

@a-wai a-wai marked this pull request as ready for review August 22, 2025 09:31
@a-wai
Copy link
Contributor Author

a-wai commented Aug 22, 2025

Note: previous version (which downloaded the scripts from the internet) has been successfully tested on staging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-skip Don't test automatically on staging.kernelci.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant