Conversation
ActivityIT first one separate annotations to keep track and easier create screenshots Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
|
Issues
======
+ Solved 2
- Added 2
Complexity increasing per file
==============================
- src/main/java/com/nextcloud/client/di/ActivitiesModule.java 1
See the complete overview on Codacy |
| ((retryCount++)) | ||
| done | ||
|
|
||
| sed -i s'#<bool name="is_beta">true</bool>#<bool name="is_beta">false</bool>#'g src/main/res/values/setup.xml |
There was a problem hiding this comment.
|
|
||
| scripts/wait_for_emulator.sh | ||
|
|
||
| sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml |
There was a problem hiding this comment.
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14494.apk |
|
stable-Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
|
master-Unit test failed, but no output was generated. Maybe a preliminary stage failed. |
Codacy397Lint
SpotBugs (new)
SpotBugs (master)
|
There was a problem hiding this comment.
If I understand it correctly, we have a specialized app to conduct screenshot tests, right?
And we want to swap network I/O layer to eliminate reliance on live server?
Swapping big compinents for tests is the right approach to do it. Ideally, we'd like to swap 1 component to achieve it, but with network ops spread between independent *Operation classes, doing it at HTTP client level seems to be a reasonable choice.
However, this will be really tedious and fragile to mock, as mock responses would have to track server changes. Of course this could be worked out as well with suitable refactoring, but the question about cost to benefit ratio must be answered first.
| import static com.owncloud.android.ui.activity.ContactsPreferenceActivity.TAG; | ||
|
|
||
| public class LocalActivitiesRepository implements ActivitiesRepository { | ||
| String json = "{\n" + |
There was a problem hiding this comment.
Kotlin allows to use """ to denote raw strings that do not need any escaping. It's really handy for stuff like that and regexps.
| this.capability = capability; | ||
| this.clientFactory = clientFactory; | ||
| try { | ||
| this.client = clientFactory.createNextcloudClient(currentAccountProvider.getUser()); |
There was a problem hiding this comment.
Wouldn't that cause NPE somewhere down the line?
|
|
||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Target(ElementType.METHOD) | ||
| public @interface ScreenshotWithServerTest { |
There was a problem hiding this comment.
Why is it called with server?
| } | ||
|
|
||
| @VisibleForTesting | ||
| public void setupDagger() { |
There was a problem hiding this comment.
We can make it protected.
Yes.
I have two approaches…
My intention was to have a reproducable state, and ideally no external components (e.g. docker) needed (this is true for option 1/2). |
True.
So if there are api changes on server they would first be captured by library. But as you said, I am really uncertain about time effort with this interceptor approach… |

Testing
Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.
unit tests
instrumented tests
UI tests