The Wayback Machine - https://web.archive.org/web/20220501152745/https://github.com/TeamNewPipe/NewPipe/issues/8080
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

Open
5 tasks done
Stypox opened this issue Mar 20, 2022 · 6 comments
Open
5 tasks done

Add more tests for methods involving the database #8080

Stypox opened this issue Mar 20, 2022 · 6 comments
Assignees
Labels
codequality good first issue

Comments

@Stypox
Copy link

@Stypox 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 codequality labels Mar 20, 2022
@Stypox
Copy link
Author

@Stypox Stypox commented Mar 23, 2022

Also e.g. #2758 should be testable

@SydneyDrone
Copy link

@SydneyDrone SydneyDrone commented Apr 7, 2022

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

@ktprograms ktprograms commented Apr 9, 2022

@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

@SydneyDrone SydneyDrone commented Apr 10, 2022

@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
Author

@Stypox 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

@SydneyDrone SydneyDrone 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/)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality good first issue
3 participants