Skip to content

[FLoC] Change FLoC instrumental tests to be unit tests. #1058

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

Merged
merged 67 commits into from
Dec 14, 2019

Conversation

diwu-arete
Copy link
Contributor

No description provided.

cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
implementation by file implementation.
@codecov
Copy link

codecov bot commented Dec 14, 2019

Codecov Report

Merging #1058 into floc-master will increase coverage by 0.45%.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##             floc-master    #1058      +/-   ##
=================================================
+ Coverage          57.09%   57.54%   +0.45%     
- Complexity          6211     6245      +34     
=================================================
  Files                644      644              
  Lines              31526    31526              
  Branches            4317     4317              
=================================================
+ Hits               17999    18142     +143     
+ Misses             12097    11949     -148     
- Partials            1430     1435       +5
Impacted Files Coverage Δ Complexity Δ
...oogle/firebase/database/core/view/QueryParams.java 73.49% <0%> (-1.21%) 80% <0%> (-1%)
...a/com/google/firebase/database/core/WriteTree.java 76.24% <0%> (-1.11%) 53% <0%> (-1%)
.../java/com/google/firebase/storage/StorageTask.java 80.66% <0%> (+0.6%) 92% <0%> (ø) ⬇️
.../com/google/firebase/storage/StorageException.java 56.36% <0%> (+3.63%) 24% <0%> (+1%) ⬆️
...n/java/com/google/firebase/storage/UploadTask.java 75.45% <0%> (+4.02%) 49% <0%> (+3%) ⬆️
...segmentation/remote/SegmentationServiceClient.java 8.23% <0%> (+8.23%) 0% <0%> (ø) ⬇️
...google/firebase/database/snapshot/BooleanNode.java 100% <0%> (+15.38%) 14% <0%> (+2%) ⬆️
...n/java/com/google/firebase/segmentation/Utils.java 57.14% <0%> (+57.14%) 2% <0%> (+2%) ⬆️
...le/firebase/segmentation/FirebaseSegmentation.java 65% <0%> (+65%) 12% <0%> (+12%) ⬆️
...segmentation/SetCustomInstallationIdException.java 83.33% <0%> (+83.33%) 3% <0%> (+3%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd0a4fa...b5bd948. Read the comment docs.

import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;

/** Instrumented tests for {@link CustomInstallationIdCache} */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Update the javadocs.

Comment on lines +202 to +206
TestOnCompleteListener<Void> onCompleteListener = new TestOnCompleteListener<>();
firebaseSegmentation
.setCustomInstallationId(CUSTOM_INSTALLATION_ID)
.addOnCompleteListener(taskExecutor, onCompleteListener);
onCompleteListener.await();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: We can move this into an initialization method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, first, I don't think we can put this entire block into initialization() since it's not always the same in every test case.

If you meant that move TestOnCompleteListener onCompleteListener = new TestOnCompleteListener<>() into initialization, I also think putting here is better since it's a whole logic block with the two lines below. Also, if a test case uses onCompleteListener more than once, then putting it in initialization is also not perfect.

@diwu-arete diwu-arete merged commit 6e37fb9 into floc-master Dec 14, 2019
@firebase firebase locked and limited conversation to collaborators Jan 14, 2020
@kaibolay kaibolay deleted the arete-floc branch September 14, 2022 17:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants