-
Notifications
You must be signed in to change notification settings - Fork 7.6k
tests: drivers: spi: spi_loopback: skip tests if invalid config #90321
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
tests: drivers: spi: spi_loopback: skip tests if invalid config #90321
Conversation
The spi_loopback_transceive() helper currently only prints a message if a configuration is invalid, continuing the test case as if it succeeded. This results in the test case using the helper trying to validate the result from a spi transaction that was skipped. Fix this by explicitly skipping the test using the ztest framework's ztest_test_skip() function, which skips the entire test case. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
|
So, when I made this PR originally for this tests, I had done skips instead, but there was some kind of Ztest bug that was making a skip cause the test to fail so we decided not to use the skips. I don't know if it got fixed, FYI @djiatsaf-st and @yperess |
ok, will wait to hear back, but |
no , it wasn't a platform bug, it was something with ztest, the test case would skip on the ST parts, and then the whole test suite would fail despite no individual test case failing, so we decided to just make the test pass instead of skip so the PR could merge |
|
@JarmouniA so, seems it is fixed now? We can use |
It appears so, @djiatsaf-st can confirm. |
Sorry, I missed this ping. Yes, I can confirm that ztest_test_skip() will work for the appropriate test. After making some tests on PR #87838 for some STM32 boards, I have this output as an example:
I think to be more complete, we should update the condition to add EFAULT (error number 14) to handle the failed test on the drivers.spi.stm32_spi_dma.loopback scenario:
|
-EFAULT would be an actual fault though? we are only skipping tests for which the hardware can not support the test case, see zephyr/include/zephyr/drivers/spi.h Lines 897 to 901 in 66eb61a
|
Thank you for your reply. I will make the necessary changes in another PR to ensure things work as expected without -EFAULT. That said, I'm okay with changes on this PR 👍 |
ping @tbursztyka :) |
The
spi_loopback_transceive()
helper currently only prints a message if a configuration is invalid, continuing the test case as if it succeeded. This results in the test case using the helper trying to validate the result from a spi transaction that was skipped.Fix this by explicitly skipping the test using the ztest framework's ztest_test_skip() function, which skips the entire test case.
Before this patch:
After this patch
fixes: #90318