Skip to content
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 failing cus of error: type 'MockRtcEngine' is not a subtype of type 'RtcEngineImpl' in type cast #1420

Closed
lewooz opened this issue Nov 3, 2023 · 5 comments
Labels
waiting for customer response waiting for customer response, or closed by no-reponse bot

Comments

@lewooz
Copy link
Contributor

lewooz commented Nov 3, 2023

Before v6.2.3 I could easily mock RtcEngine class and run tests but after updating to the most recent version my tests are no longer working. This is the error I am getting:

image

I am using mocktail package to mock RtcEngine and stub it's methods. When I downgrade to 6.2.2 everything works fine.

Any help would be greatly appreciated.

@littleGnAl
Copy link
Collaborator

The createAgoraRtcEngine returns the RtcEngineImpl underlying

return impl.RtcEngineImpl.create();

How does your test case look like, maybe it's not a good way to mock the RtcEngine interface if your test case is combined with the AgoraVideoView.

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Nov 7, 2023
@lewooz
Copy link
Contributor Author

lewooz commented Nov 7, 2023

I am getting the error when each widget test is finished which means I am getting the error only when the AgoraVideoView is getting disposed. This is how I am mocking the RtcEngine:
image

As I said I am not having issues with 6.2.2. A change made in 6.2.3 is the cause of the issue. My hunch is that the problem might be happening because extension methods can not be stubbed.

@github-actions github-actions bot removed the waiting for customer response waiting for customer response, or closed by no-reponse bot label Nov 7, 2023
@littleGnAl
Copy link
Collaborator

If the rendering is not a matter of your test, I think you'd better mock VideoViewController and pass it to your AgoraVideoView implementation.

@littleGnAl littleGnAl added the waiting for customer response waiting for customer response, or closed by no-reponse bot label Nov 8, 2023
Copy link
Contributor

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting for customer response waiting for customer response, or closed by no-reponse bot
Projects
None yet
Development

No branches or pull requests

2 participants