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

ci: zephyr: execute (real hardware) HIL tests in matrix jobs #641

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

Conversation

mniestroj
Copy link
Collaborator

@mniestroj mniestroj commented Oct 3, 2024

So far bash 'for' loop was used to iterate through all tests, then build
them and run pytest. This produced massive amount of logs and as a result
was very hard to find a problem when such occurred.

Add job (matrix) that dynamically generates matrix based on the list of
tests to execute. Then use matrix strategy to build those tests and run
pytest on HIL.

Split building and runtime execution into separate steps, so that it
improves:

  • visual feedback in GitHub Actions UI when investigating failed jobs
  • no $EXITCODE handling
  • faster execution of "Re-run failed jobs" when only single test on a
    single platform has failed (it makes it more likely to pass)

This PR slightly increases time of the initial run. However since it is very
common that some of those tests do not pass, it is much faster to restart
subset of tests instead of all of them in a loop. In the end this should
reduce time spent on hardware testing.

Copy link

github-actions bot commented Oct 3, 2024

Visit the preview URL for this PR (updated for commit 3259343):

https://golioth-firmware-sdk-doxygen-dev--pr641-hil-split-mel8rjov.web.app

(expires Thu, 17 Oct 2024 13:13:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

@mniestroj mniestroj force-pushed the hil-split branch 8 times, most recently from 108953f to 1b314fa Compare October 5, 2024 09:31
Copy link

github-actions bot commented Oct 7, 2024

Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
include.golioth 75% 50%
port.linux 53% 28%
port.zephyr 49% 14%
src 70% 31%
Summary 68% (2519 / 3729) 31% (1100 / 3593)

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

see 6 files with indirect coverage changes

So far bash 'for' loop was used to iterate through all tests, then build
them and run pytest. This produced massive amount of logs and as a result
was very hard to find a problem when such occurred.

Add job (matrix) that dynamically generates matrix based on the list of
tests to execute. Then use matrix strategy to build those tests and run
pytest on HIL.

Split building and runtime execution into separate steps, so that it
improves:
 * visual feedback in GitHub Actions UI when investigating failed jobs
 * no $EXITCODE handling
 * faster execution of "Re-run failed jobs" when only single test on a
   single platform has failed (it makes it more likely to pass)

Signed-off-by: Marcin Niestroj <[email protected]>
@mniestroj mniestroj changed the title Hil split ci: zephyr: execute (real hardware) HIL tests in matrix jobs Oct 10, 2024
@mniestroj mniestroj marked this pull request as ready for review October 10, 2024 15:55
@mniestroj mniestroj requested review from sam-golioth and szczys and removed request for sam-golioth October 10, 2024 15:55
@sam-golioth
Copy link
Contributor

Can we get some rough numbers on how much time this adds for a complete test run (ignoring retries)? Let's also identify areas where we can cut down on the per-test overhead. Some of the ones that come to mind (but there could be others):

  • erasing the board after each run
  • Setting up python/west dependencies

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.

2 participants