-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: plumb SDK test data branch through to URL used for test config #137
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import android.util.Log; | ||
import androidx.annotation.Nullable; | ||
import androidx.test.core.app.ApplicationProvider; | ||
import androidx.test.platform.app.InstrumentationRegistry; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👀 |
||
import cloud.eppo.BaseEppoClient; | ||
import cloud.eppo.EppoHttpClient; | ||
import cloud.eppo.android.cache.LRUAssignmentCache; | ||
|
@@ -68,8 +69,15 @@ public class EppoClientTest { | |
private static final String TAG = logTag(EppoClient.class); | ||
private static final String DUMMY_API_KEY = "mock-api-key"; | ||
private static final String DUMMY_OTHER_API_KEY = "another-mock-api-key"; | ||
private static final String TEST_HOST = | ||
|
||
// Use branch if specified by env variable `TEST_DATA_BRANCH`. | ||
private static final String TEST_BRANCH = | ||
InstrumentationRegistry.getArguments().getString("TEST_DATA_BRANCH"); | ||
Comment on lines
+74
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool did not know about |
||
private static final String TEST_HOST_BASE = | ||
"https://us-central1-eppo-qa.cloudfunctions.net/serveGitHubRacTestFile"; | ||
private static final String TEST_HOST = | ||
TEST_HOST_BASE + (TEST_BRANCH != null ? "/b/" + TEST_BRANCH : ""); | ||
|
||
private static final String INVALID_HOST = "https://thisisabaddomainforthistest.com"; | ||
private final ObjectMapper mapper = new ObjectMapper().registerModule(module()); | ||
@Mock AssignmentLogger mockAssignmentLogger; | ||
|
@@ -781,7 +789,7 @@ private void waitForPopulatedCache() { | |
while (!cachePopulated) { | ||
if (System.currentTimeMillis() > waitEnd) { | ||
throw new InterruptedException( | ||
"Cache file never populated; assuming configuration error"); | ||
"Cache file never populated or smaller than expected 8000 bytes; assuming configuration error"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wasted a bunch of time trying to figure this out (my test data branch had a very small config). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is this "expected 8000 bytes" coming from? first time I'm hearing about it I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a check below that checks for a minimum cache file size of 8k There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
long expectedMinimumSizeInBytes = | ||
8000; // Last time this test was updated, cache size was 11,506 bytes | ||
|
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.
cleaning up names for consistency with other repos