-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix #22: Add Gravatar utility functions #29
Conversation
b372467
to
b95b76e
Compare
ktlint_function_naming_ignore_when_annotated_with = Composable | ||
max_line_length=120 |
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.
❤️
# IntelliJ/Android Studio exceptions | ||
!/.idea/codeStyles/ | ||
!/.idea/fileTemplates/ | ||
!/.idea/inspectionProfiles/ | ||
!/.idea/scopes/ | ||
!/.idea/codeStyleSettings.xml | ||
!/.idea/encodings.xml | ||
!/.idea/copyright/ | ||
# Enforce plugins | ||
!/.idea/externalDependencies.xml | ||
# Checkstyle configuration | ||
!/.idea/checkstyle-idea.xml | ||
|
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.
❓Why do we not want to track those files? Some of them allow us to share some code styles for the Android Studio autoformatting. The code will be validated by Ktlint, but I think some of them could be useful. I usually use gitignore.io to see what they suggest. In our case this
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.
Note that we want to track those above ^, but I don't I want to track everything for .idea/
(eg. .idea/deploymentTargetDropDown.xml
isn't useful IMO because it changes depending on the tests you run in AS)
I took it wpandroid, I haven't checked everything, but I'm fine using another list.
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.
🤦🏼♂️ My bad, I didn't notice the !
... Sorry.
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class GravatarUtilsInstrumentedTest { |
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.
android.net.Uri
but all of them look like a unit test to me. Should we try to add Robolectric and/or mock the Uri.Builder? We don't have DI yet, which complicates things; maybe we should dedicate some time to it?
We don't need to take care of this right now. We can merge and keep working on improving our testing possibilities.
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.
Yeah I was thinking of add Robolectric, but it seemed like an overkill for this. We'll likely have connected tests anyway so why not having them here to test the full path.
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.
I don't think we'll need several connected tests, at least for the non-UI part.
My main concern is about the execution time. Now, it is insignificant, but if we implement the majority of the tests as instrumented tests, the execution time will increase rapidly.
But as I mentioned, we can iterate. 🙂
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.
Good point about speed, I removed connected tests and I setup up Robolectric tests in 3d20326
return emailAddressToGravatarUri(email, defaultAvatarImage, size).toString() | ||
} | ||
|
||
fun emailAddressToGravatarUri( |
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.
❓Could it make sense to trim the email here, too, and verify it's not empty? Verify that it's a well-formatted e-mail could be going too far?
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.
I doubt we want to go too far here, we can check for empty string, but we shouldn't check if the e-mail address is valid.
Note this is still a draft PR (but we can't use them in free private repo), I opened it to test github actions. |
432fed4
to
76c8f83
Compare
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.
Note this is still a draft PR (but we can't use them in free private repo)
TIL
- Maybe we can add the title DRAFT - PR Title or create a draft
label. Wdyt?
Sorry if I was too fast with my comment, I thought the PR was ready and you were waiting the review. Let me know when is ready.
# IntelliJ/Android Studio exceptions | ||
!/.idea/codeStyles/ | ||
!/.idea/fileTemplates/ | ||
!/.idea/inspectionProfiles/ | ||
!/.idea/scopes/ | ||
!/.idea/codeStyleSettings.xml | ||
!/.idea/encodings.xml | ||
!/.idea/copyright/ | ||
# Enforce plugins | ||
!/.idea/externalDependencies.xml | ||
# Checkstyle configuration | ||
!/.idea/checkstyle-idea.xml | ||
|
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.
🤦🏼♂️ My bad, I didn't notice the !
... Sorry.
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class GravatarUtilsInstrumentedTest { |
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.
I don't think we'll need several connected tests, at least for the non-UI part.
My main concern is about the execution time. Now, it is insignificant, but if we implement the majority of the tests as instrumented tests, the execution time will increase rapidly.
But as I mentioned, we can iterate. 🙂
76c8f83
to
653364b
Compare
653364b
to
9953113
Compare
No worries, that's a good pre-review :). Adding |
I wanted to remove the Note: if we want to add connected tests back to CI, we can revert this commit b2de8a5 @hamorillo can you do another pass on this one? |
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.
🚀 LGTM!
Fix #22 and fix #11 (by adding some tests)