-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Improve integration tests for public API #328
Comments
I would like to try write these tests. |
@CleverShovel Great, you're welcome! |
@gavv Is this normal that in roc_library directory there are files like test_context.cpp, test_sender.cpp and others and I will add test_context.h and others but they will not related to these cpp? |
Good catch. Since this issue was created, the file layout in tests was changed a bit. According to the new layout, these files should be named like |
@gavv Does each item from the list in issue description mean concrete tests or only a parameter to combine? |
Well, it's just a list of features to be covered somehow. Obviously, we can't create a test for every possible combination of these features because there were too much tests. So, likely, we should create one or a few test for every specific item. E.g., for |
@gavv As far as I can see for parallel test of multiple senders and one receiver I should add another one |
You can connect multiple senders to the same endpoint(s). The receiver will mix them. You need to adjust the received stream checking to expect the stream mixed from multiple senders. The hard thing here is that you don't known how the streams from different senders are shifted. One possible way to deal with it is to make the first sender produce stream like 10, 20, 30, ..., and the second sender 1, 2, 3, ... Then you'll read from the receiver something like 25, 36, 47, ... and from that you can deduce the original sequences of both senders and check them separately. |
https://travis-ci.org/github/gavv/roc/jobs/671349254 https://travis-ci.org/github/gavv/roc/jobs/671349250 @CleverShovel Could you please take a look? |
@gavv ok, I'll check test more carefully |
@gavv When I debugged the test in |
This looks very strange. If receiver produces samples out of range
Yes, adding such a check is legit and makes sense. But the range is [-1; 1].
IIRC it was added for reason. Maybe @alexandremgo can provide some details on this. |
I think the problem with I guess we should change the flow to the following:
|
BTW, note that this test likely will work incorrectly under a debugger because of its real-time nature. (Though receiver should not produce numbers out of [-1; 1] range anyway). |
An interesting detail: both failures on travis were on sample |
@CleverShovel Hi, do you have any further plans on this? |
@gavv Sorry for long delay, I'm was busy. I try to find time for this by the end of this month. |
Great! |
Unassigning so that someone can continue the work during hacktoberfest. @CleverShovel feel free to let me know if you want to be re-assigned though. |
I've created separate issues for remaining tests: |
Currently we have 3 integrations tests for our C API:
We need to cover more parameter combinations:
Before adding more tests, it would be also nice to extract Context, Sender, Receiver, and Proxy from test_sender_receiver.cpp into separate files in src/tests/roc_library (i.e. test_context.h, test_sender.h, and so on).
This work can be split into multiple PRs, one or a few tests per PR.
The text was updated successfully, but these errors were encountered: