-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Strict test ordering in new ztest API #41880
Comments
I'm working on a migration of the chromium tests that does this too. Here's how to set it up... test_state.h
main.c
phase0.c
|
Another thing if you don't want to make it one suite per set of tests is to combine them into one |
Can this issue be closed? Was the above enough to get you unblocked? |
Frankly speaking, i am not convinced. I know that it may be cleaner but it is less intuitive and it's a regression (in terms of ease of use) compared to what we had. I'm afraid that if it is more cumbersome to setup more complex test scenario user will simple skip adding test like that. If we take example mention in the issue we had following sequence:
So it was quite obvious, we have ordering, some tests are in user space other not. Comparing that to using predicate, implementing weak |
I'm sorry, I can't say that this is a regression. By definition unit tests should NEVER depend on the order. We've even added a shuffle feature for developers to be able to find these kinds of conditions and label tests as flaky. A strict dependency on the order means that it's actually one test. @aaronemassey can you discuss this in the testing working group tomorrow? |
I agree that it's not good approach. It's just that legacy ztest had that and it was used. Mainly for userspace test setup. It would be good to provide user friendly alternative. The proposal above is not that intuitive but if nothing better is proposed than it's ok for me to close it. |
Is your feature request related to a problem? Please describe.
Currently there are tests which rely on strict order execution. This is mainly related to user space test preparation where non-user test is executed before user test. In order to allow transition to new API it must be somehow supported. Example:
zephyr/tests/kernel/workq/user_work/src/main.c
Line 189 in 4446272
Describe the solution you'd like
Strict ordering (adding line number to section name? Don't like it) or extend
ZTEST_USER
to accept some test specificsetup_fn
.The text was updated successfully, but these errors were encountered: