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

Add more tests for methods involving the database #8080

Closed
5 tasks done
Stypox opened this issue Mar 20, 2022 · 8 comments · Fixed by #8456
Closed
5 tasks done

Add more tests for methods involving the database #8080

Stypox opened this issue Mar 20, 2022 · 8 comments · Fixed by #8456
Assignees
Labels
codequality Improvements to the codebase to improve the code quality good first issue Easy/simple issues perfect for newcomers to get involved in the project

Comments

@Stypox
Copy link
Member

Stypox commented Mar 20, 2022

Checklist

  • This issue contains only one bug.
  • I am able to reproduce the bug with the latest version.
  • I have read and understood the contribution guidelines.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.

Affected version

Every version, but in particular this issue was opened after #2335

The problem

We should add more tests for methods that query/use the database, after mocking the NewPipeExtractor. These kind of tests would not be too difficult to do (android tests would, instead, I think), but would anyway allow us to ensure things work correctly faster. For example we could start by adding a test for the SubscriptionManager.rememberAllStreams() method introduced in #2335, see #2335 (comment).

@Stypox Stypox added good first issue Easy/simple issues perfect for newcomers to get involved in the project codequality Improvements to the codebase to improve the code quality labels Mar 20, 2022
@Stypox
Copy link
Member Author

Stypox commented Mar 23, 2022

Also e.g. #2758 should be testable

@SydneyDrone
Copy link
Contributor

I would like to work on this issue. I'm new to open source, so can someone walk me through the process ?

@ktprograms
Copy link
Contributor

@SydneyDrone Sure, I'd be glad to.

Do you have experience with Git?

The general process is:

  • Fork the repo in GitHub
  • Clone your fork
  • Create a feature branch
  • Make your changes and commit them
  • Push the feature branch to your fork
  • Make a pull request from your feature branch to NewPipe's dev branch

@SydneyDrone
Copy link
Contributor

@ktprograms Sorry my mistake:(
I have no problem using git, but it's the first time for me to write database tests, so if there is a quickstart maybe I can finish it more quickly.

@Stypox
Copy link
Member Author

Stypox commented Apr 10, 2022

@SydneyDrone you could for example copy this other database test into a new file and then make changes based on it: https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt

Put the newly created file in the same java package as the file it is supposed to test (just under androidTest/ instead of main/)

@SydneyDrone
Copy link
Contributor

@SydneyDrone you could for example copy this other database test into a new file and then make changes based on it: https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt

Put the newly created file in the same java package as the file it is supposed to test (just under androidTest/ instead of main/)

@Stypox Thank you, I'll give it a shot.

@MustkimKhatik
Copy link

@SydneyDrone you are working on this issue right now ?

@SydneyDrone
Copy link
Contributor

@MustkimKhatik Yes, I'm currently working on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality good first issue Easy/simple issues perfect for newcomers to get involved in the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants