Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/instrumented.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- 'development'
- '*_baseline'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'kotlin-android'
apply from: 'spec.gradle'

ext {
splitVersion = '5.3.0-rc1'
splitVersion = '5.3.0-rc2'
}

android {
Expand Down
165 changes: 165 additions & 0 deletions src/androidTest/assets/splitchanges_prerequisites.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"ff": {
"s": -1,
"t": 1602796638344,
"d": [
{
"name": "always_on_if_prerequisite",
"trafficTypeName": "user",
"changeNumber": 5,
"seed": -790401604,
"trafficAllocation": 0,
"trafficAllocationSeed": 1828377380,
"status": "ACTIVE",
"killed": false,
"defaultTreatment": "off",
"prerequisites": [
{
"n": "rbs_test_flag",
"ts": [
"v1"
]
}
],
"conditions": [
{
"matcherGroup": {
"combiner": "AND",
"matchers": [
{
"keySelector": {
"trafficType": "user",
"attribute": null
},
"matcherType": "ALL_KEYS",
"negate": false,
"userDefinedSegmentMatcherData": null,
"whitelistMatcherData": null,
"unaryNumericMatcherData": null,
"betweenMatcherData": null
}
]
},
"partitions": [
{
"treatment": "on",
"size": 100
}
],
"label": "default rule"
}
]
},
{
"name": "rbs_test_flag",
"trafficTypeName": "user",
"trafficAllocation": 100,
"trafficAllocationSeed": 1828377380,
"seed": -286617921,
"status": "ACTIVE",
"killed": false,
"defaultTreatment": "off",
"algo": 2,
"conditions": [
{
"conditionType": "ROLLOUT",
"matcherGroup": {
"combiner": "AND",
"matchers": [
{
"keySelector": {
"trafficType": "user"
},
"matcherType": "IN_RULE_BASED_SEGMENT",
"negate": false,
"userDefinedSegmentMatcherData": {
"segmentName": "test_rule_based_segment"
}
}
]
},
"partitions": [
{
"treatment": "v1",
"size": 100
},
{
"treatment": "v2",
"size": 0
}
],
"label": "in rule based segment test_rule_based_segment"
},
{
"conditionType": "ROLLOUT",
"matcherGroup": {
"combiner": "AND",
"matchers": [
{
"keySelector": {
"trafficType": "user"
},
"matcherType": "ALL_KEYS",
"negate": false
}
]
},
"partitions": [
{
"treatment": "v1",
"size": 0
},
{
"treatment": "v2",
"size": 100
}
],
"label": "default rule"
}
],
"configurations": {},
"sets": [],
"impressionsDisabled": false
}
]
},
"rbs": {
"s": -1,
"t": 100,
"d": [
{
"name": "test_rule_based_segment",
"status": "ACTIVE",
"trafficTypeName": "user",
"excluded": {
"keys": [
"mauro@split.io",
"gaston@split.io"
],
"segments": []
},
"conditions": [
{
"matcherGroup": {
"combiner": "AND",
"matchers": [
{
"keySelector": {
"trafficType": "user"
},
"matcherType": "ENDS_WITH",
"negate": false,
"whitelistMatcherData": {
"whitelist": [
"@split.io"
]
}
}
]
}
}
]
}
]
}
}
1 change: 1 addition & 0 deletions src/androidTest/java/helper/IntegrationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@ public static class ServicePath {
public static final String UNIQUE_KEYS = "keys/cs";
public static final String COUNT = "testImpressions/count";
public static final String IMPRESSIONS = "testImpressions/bulk";
public static final String AUTH = "v2/auth";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
import java.util.concurrent.atomic.AtomicBoolean;

import helper.DatabaseHelper;
import helper.FileHelper;
import helper.IntegrationHelper;
import io.split.android.client.ServiceEndpoints;
import io.split.android.client.SplitClient;
import io.split.android.client.SplitClientConfig;
import io.split.android.client.SplitFactory;
import io.split.android.client.api.Key;
import io.split.android.client.dtos.SplitChange;
import io.split.android.client.events.SplitEvent;
import io.split.android.client.utils.Json;
import io.split.android.client.utils.logger.Logger;
import io.split.android.client.utils.logger.SplitLogLevel;
import okhttp3.mockwebserver.Dispatcher;
Expand All @@ -44,12 +41,14 @@ public class InitializationTest {
private MockWebServer mWebServer;

private AtomicBoolean mEventSent;
private CountDownLatch mEventLatch;

@Before
public void setUp() {
setupServer();
mRequestCountdownLatch = new CountDownLatch(1);
mEventSent = new AtomicBoolean(false);
mEventLatch = new CountDownLatch(1);
}

@Test
Expand All @@ -72,8 +71,7 @@ public void immediateClientRecreation() throws InterruptedException {
factory.client(new Key("new_key")).on(SplitEvent.SDK_READY, new TestingHelper.TestEventTask(secondReadyLatch));
boolean awaitReady2 = secondReadyLatch.await(5, TimeUnit.SECONDS);

// Wait for events to be posted
Thread.sleep(500);
mEventLatch.await(5, TimeUnit.SECONDS);

assertTrue(readyAwait);
assertTrue(awaitReady2);
Expand Down Expand Up @@ -171,6 +169,7 @@ public MockResponse dispatch(RecordedRequest request) throws InterruptedExceptio
}
} else if (request.getPath().contains("/" + IntegrationHelper.ServicePath.EVENTS)) {
mEventSent.set(true);
mEventLatch.countDown();
return new MockResponse().setResponseCode(200);
} else if (request.getPath().contains("/" + IntegrationHelper.ServicePath.COUNT)) {
return new MockResponse().setResponseCode(200);
Expand Down
Loading
Loading