-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Update unit tests for one-isolate branch #716
Comments
This is something I might be able to help with. If you would like help implementing the tests, are there any special instructions? Note to self: link to tests |
Sure! You are welcome to take a stab at it while I take on another task. Now that we have a platform interface, you ought to be able to mock that with a mock implementation of that interface or mockito instead of trying to mock the method channel. Let me know if you have any questions. |
(update): today-tomorrow will end the _IsolateAudioHandler and add a bunch of integration tests for it with flutter_isolate, or unit, if that's feasible, will see |
Ok, so I'm looking at this today and I guess I don't really know how to start. I would need a walk-through but by that time one of you might be able to finish. I'm still willing to try, but I'd probably at least need a more detailed list of steps to follow. |
Synchronizing subjects between isolates is much harder task than I first thought initally.. What I currenly have is that I tried on both ends to listen to both stream and port that receives messages from the other isolate, but this obviously leads to that messages are sent back and forth infinitely by this scheme:
Any thoughts? |
Tests for the isolate are mostly done, except for subjects |
Ah, that's easy, I will just filter these messages out lol |
@suragch I will give you some steps a bit later, once I'm done with what I'm currently doing, since this will give a ground for other tests, such as MockBaseAudioHandler |
@suragch I pushed my changes in #735, you can check them out for example, I'm testing IsolateAudioHandler there. Other unit tests will require writing something similar, but with other handlers. You can also checkout #726 if you want Here are some sections we will need to cover Platform connectionI think that we will need to expose the
Other handlers
Data classesClasses like MediaItem, Rating, PlaybackState, etc. - ensure they are translated into platform messages and they generally work correctly I think you should still wait a little bit though, until @ryanheise can review my PRs |
@nt4f04uNd Thank you for your outline. That was really helpful. I started some work on this. I added tests for |
Awesome @suragch ! Can you create a draft pull request? I can then use GitHub's facilities to do a review. |
@ryanheise I'm planning to test the data classes. Do you think we should add tests for enums and enum-like classes as well? |
All we really need is to test each method has the expected outcome - enums themselves don't have methods, so I think their coverage would be incidental rather than the focus of specific unit tests. |
@nt4f04uNd If you are testing the data classes, one thing to note is |
I also have a platform connection tests written locally which are based of #735 |
I meant to keep working on this but got busy with work. What is the current status of the unit test updates? Is there something I can do? |
Hi @suragch , thanks so much for your previous work on this which has now been merged. Full coverage is not ultra urgent, as I would be happy to include the current level of testing in the next stable release and then chip away at it after that. But if you're interested to know what's left to be done, you can run |
Is your feature request related to a problem? Please describe.
The unit tests are not in working order on the one-isolate branch.
Describe the solution you'd like
Migrate the unit tests to work with the new audio_service API.
Describe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: