-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Extract export database logic into own class #5059
Conversation
- Separate it from the UI. - Add happy path unit test.
f5c65c3
to
f7f0029
Compare
I added the setting |
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.
We definitely need more tests, so I like this. I tested on my device and it works; I also run the test locally and it works. Thank you!
private lateinit var newpipeDb: File | ||
private lateinit var newpipeSettings: File | ||
|
||
@Before |
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.
Well from refactoring too much stuff around, i apparently created a beforeClass
method annotated @Before
. I'll fix this later on in my next PR.
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.
Please create a separate PR for this
@@ -131,6 +129,8 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro | |||
newpipeSettings = new File(homeDir + "/databases/newpipe.settings"); | |||
newpipeSettings.delete(); | |||
|
|||
manager = new ContentSettingsManager(homeDir); |
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.
That causes the build to fail. Can you fix that, please?
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.
Oh, how is this possible? I ran the tests successfully on my machine...
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.
WOW, i see where this is coming from. PR coming
TeamNewPipe#5176 changed `homeDir` from type `String` to `File`. TeamNewPipe#5059 was based on `homeDir` being a `String`. It was incorrectly auto-resolved by git.
TeamNewPipe#5176 changed `homeDir` from type `String` to `File`. TeamNewPipe#5059 was based on `homeDir` being a `String`. It was incorrectly auto-resolved by git.
TeamNewPipe#5176 changed `homeDir` from type `String` to `File`. TeamNewPipe#5059 was based on `homeDir` being a `String`. It was incorrectly auto-resolved by git.
What is it?
Description of the changes in your PR
With this seperation, unit tests can be introduced. I just added one as proof of concept for now.
If this style is ok i would work on extracting more stuff out.
This also allows cheap unit tests instead of comparatively expensive androidTests.
APK testing
app-debug.zip
Due diligence