Skip to content

Commit

Permalink
Added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzmauro committed May 14, 2024
1 parent a86d003 commit 25a7b42
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Suite/Sdk/SdkClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ public function testClientSemverMatchers()
$this->validateLastImpression($redisClient, 'between_semver_flag', 'user1', 'off');

//Assertions InListSemver
//
$this->assertEquals('v1', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '6.7.8')));
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'v1');
$this->assertEquals('v1', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '1.1.1-alpha')));
Expand All @@ -330,6 +329,10 @@ public function testClientSemverMatchers()
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'off');
$this->assertEquals('off', $splitSdk->getTreatment('user1', 'inlist_semver_flag', array('version' => '8.6.0-rc.2')));
$this->validateLastImpression($redisClient, 'inlist_semver_flag', 'user1', 'off');

// Assertions UnSupported
$this->assertEquals('control', $splitSdk->getTreatment('user1', 'semver_demo_test', array('version' => '2.2.2')));
$this->validateLastImpression($redisClient, 'semver_demo_test', 'user1', 'control');
}

public function testClientWithUnsupportedMatcher()
Expand Down
44 changes: 44 additions & 0 deletions tests/Suite/Sdk/files/splitChanges.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,50 @@
]
}
]
},
{
"changeNumber": 1715263640336,
"trafficTypeName": "user",
"name": "semver_demo_test",
"trafficAllocation": 100,
"trafficAllocationSeed": -109105559,
"seed": 1836161355,
"status": "ACTIVE",
"killed": false,
"defaultTreatment": "off",
"algo": 2,
"conditions": [
{
"conditionType": "WHITELIST",
"matcherGroup": {
"combiner": "AND",
"matchers": [
{
"keySelector": null,
"matcherType": "ALL_KEYS",
"negate": false,
"userDefinedSegmentMatcherData": null,
"whitelistMatcherData": null,
"unaryNumericMatcherData": null,
"betweenMatcherData": null,
"dependencyMatcherData": null,
"booleanMatcherData": null,
"stringMatcherData": null,
"betweenStringMatcherData": null
}
]
},
"partitions": [
{
"treatment": "control",
"size": 100
}
],
"label": "targeting rule type unsupported by sdk"
}
],
"configurations": {},
"sets": []
}
],
"since": -1,
Expand Down

0 comments on commit 25a7b42

Please sign in to comment.