-
Notifications
You must be signed in to change notification settings - Fork 425
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
Use and generate mocks for youtube tests #518
Conversation
So any opinions about this? I think #527 is a good example on why this is necessary. Normally a change like that can be easily merged if the tests pass. But the tests suite failed there. No one knows if it's due to the change or unrelated broken/flaky tests. |
I like this approach, as I said in #482. The only thing that I think could be improved is that you always have to remember to put void initNewpipeForTest(@Nullable final String mockResourcePath) { // or maybe have the downloader as argument
YoutubeParsingHelper.resetClientVersionAndKey();
if (mockResourcePath == null) {
NewPipe.init(new DownloaderFactory().getDownloader()); // or whatever the signature is
} else {
NewPipe.init(new DownloaderFactory().getDownloader(mockResourcePath));
}
} |
I personally don't see much difference, since one already has to remember to use the Additionally that specific resetting is only needed for Youtube and not the other services. So if someone used that
|
@Stypox Any update on your opinion about I would like to get this moving |
Sorry, I missed your response above. I didn't think that running code for unrelated services could cause unrelated and misguiding errors, so you are right, it's better to keep things separate. Everything should be well-documented then. |
KurzgesagtAdditional needed to be extracted because it ran a duplicated request.
With mocks time is not a concern anymore
Requires further research
It doesn't make network requests anyway
b0c4fee
to
72ce65d
Compare
28a2e50
to
971128c
Compare
Well this was more annoying than expected. After running with the recording a few times random tests started to fail. I guess youtube was thinking i was doing a DOS against them... @Stypox Where do you want the information, that the |
@XiangRongLin yes, you can do it in a separate one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I think this can be merged after 0.20.10 is done with. Thank you!
I carefully read the contribution guidelines and agree to them.
I removed some and added some other Ignores.
Some tests are not immediatly compatible, see each commit message