Skip to content

testlib: Mark test as SKIP if dependencies are missing #79

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

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

smuppand
Copy link
Contributor

This patch updates the check_dependencies function in functestlib.sh to gracefully skip tests when required tools are missing. Instead of failing the test (and reporting as FAIL in CI/LAVA), the test is now marked as SKIP when one or more dependencies are not present in the environment.

Key changes:

  • check_dependencies now checks for all required commands and logs a warning for each missing dependency.
  • If any dependency is missing, the test is marked as SKIP in the .res file, log_skip is called, and the script exits with code 0.
  • No changes are required to individual run.sh scripts; all existing calls to check_dependencies automatically benefit from this update.
  • This improves CI/LAVA reporting by distinguishing between genuine test failures and infrastructure/setup issues.

This change will reduce noise from false negatives in test dashboards and make it clear when failures are due to missing dependencies rather than actual test or system issues.

@smuppand smuppand requested review from mwasilew and vnarapar June 11, 2025 11:07
testname="${TESTNAME:-UnknownTest}"
log_skip "$testname SKIP: missing dependencies:$missing_cmds"
echo "$testname SKIP" > "./$testname.res"
exit 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit 1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit 1 ?

AFAIK, If you use exit 1, most CI/test systems will treat it as a FAIL, not SKIP.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's correct as far as I can tell. In the LAVA test plan here we use || true to avoid this problem. I'm fine leaving it like it is.

- Updated check_dependencies to SKIP tests with missing tools
- CI/LAVA now reports SKIP (not FAIL) when commands are absent

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@mwasilew mwasilew merged commit edfad16 into qualcomm-linux:main Jun 11, 2025
6 checks passed
@smuppand smuppand deleted the skip-deps-patch branch June 11, 2025 15:33
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