Repository tests #49

Closed
opened 2022-09-07 07:06:19 +00:00 by davidoskky · 3 comments
Contributor

Since the repository is taking care of most of the logic, it appears to be the best place to start introducing tests.
Moreover, since it does not depend on the Android implementation, these can be unit tests.

I'll start working on this since it doesn't appear to me that there are any more important tasks to do that stop the F-Droid publication.
This will likely take me some time; I'll open a draft PR when I can so that if you wish you can also take a look.

I don't know how the CI is setup on here; I hope it'll just pick them up and work.

Since the repository is taking care of most of the logic, it appears to be the best place to start introducing tests. Moreover, since it does not depend on the Android implementation, these can be unit tests. I'll start working on this since it doesn't appear to me that there are any more important tasks to do that stop the F-Droid publication. This will likely take me some time; I'll open a draft PR when I can so that if you wish you can also take a look. I don't know how the CI is setup on here; I hope it'll just pick them up and work.
Author
Contributor

I had a first look and there are some difficulties: the repository depends on the ConnectivityStatus library which cannot be directly mocked as far as I can see.

I had a first look and there are some difficulties: the repository depends on the ConnectivityStatus library which cannot be directly mocked as far as I can see.
Owner

Hi,

I use a private droneci instance as ci/cd tool.

It's not public (yet ?) as I use it for other personal projects.

You could try and add a test step in the .drone.yml file, and I'll check if it works when it's merged.

I had a first look and there are some difficulties: the repository depends on the ConnectivityStatus library which cannot be directly mocked as far as I can see.

Can the ConnectivityStatus library be replaced with a mock that returns true or false ?

Hi, I use a private [droneci](https://www.drone.io/) instance as ci/cd tool. It's not public (yet ?) as I use it for other personal projects. You could try and add a test step in the `.drone.yml` file, and I'll check if it works when it's merged. > I had a first look and there are some difficulties: the repository depends on the ConnectivityStatus library which cannot be directly mocked as far as I can see. Can the ConnectivityStatus library be replaced with a mock that returns true or false ?
Author
Contributor

I have checked, the library can be mocked; I'll thus proceed by mocking all the dependencies of the repository.

I have checked, the library can be mocked; I'll thus proceed by mocking all the dependencies of the repository.
AmineB added this to the A little better milestone 2022-09-12 19:16:52 +00:00
AmineB added this to the Dev project 2022-09-13 14:32:44 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Louvorg/ReaderForSelfoss-multiplatform#49
No description provided.