Skip to content

Commit 125f43c

Browse files
wangjoshuahkellyroach-optimizely
authored andcommitted
merge master (#231)
* revert get enabled features sorted (#229) * coveralls code coverage (#221) * coveralls added * enable code coverage * add style guide (#233)
1 parent 788f68f commit 125f43c

File tree

7 files changed

+36
-37
lines changed

7 files changed

+36
-37
lines changed

.slather.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage_service: coveralls
2+
xcodeproj: OptimizelySDKiOS/OptimizelySDKiOS.xcodeproj
3+
scheme: OptimizelySDKiOS
4+
workspace: OptimizelySDK.xcworkspace
5+
configuration: Release

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ env:
1111
- SCHEME=OptimizelySDKiOS-Universal TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=9.3 NAME='iPhone 6s'
1212
- SCHEME=OptimizelySDKTVOS TEST_SDK=appletvsimulator PLATFORM='tvOS Simulator' OS=10.2 NAME='Apple TV 1080p'
1313
- SCHEME=OptimizelySDKTVOS-Universal TEST_SDK=appletvsimulator PLATFORM='tvOS Simulator' OS=9.2 NAME='Apple TV 1080p'
14+
before_install:
15+
- gem install slather --no-rdoc --no-ri --no-document --quiet
1416
script:
1517
- pod spec lint --quick
16-
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then xcodebuild test -quiet -workspace OptimizelySDK.xcworkspace -scheme $SCHEME -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -sdk $TEST_SDK -destination "platform=$PLATFORM,OS=$OS,name=$NAME" | egrep -B 10 -A 10 "(error|warning|failed|crash|exit|FAILED|Failing|failures)"; fi
18+
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then xcodebuild test -quiet -workspace OptimizelySDK.xcworkspace -scheme $SCHEME -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -sdk $TEST_SDK -destination "platform=$PLATFORM,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES | egrep -B 10 -A 10 "(error|warning|failed|crash|exit|FAILED|Failing|failures)"; fi
1719
after_success:
20+
- slather
1821
- sleep 5 # https://github.com/travis-ci/travis-ci/issues/4725
1922

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We welcome contributions and feedback! All contributors must sign our [Contribut
2020

2121
## Style
2222

23-
TBD
23+
We follow the [Ray Wenderlich style guide](https://github.com/raywenderlich/objective-c-style-guide) since they have put a lot of thought into making their code more legible. While we aim for our Optimizely SDK to be performant and bug free, we also want all customers and third party developers read and understand our code easily.
2424

2525
## License
2626

OptimizelySDKCore/OptimizelySDKCore/Optimizely.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ - (NSString *)getFeatureVariableString:(nullable NSString *)featureKey
363363
[enabledFeatures addObject:featureKey];
364364
}
365365
}
366-
NSArray *enabledFeaturesSorted = [enabledFeatures sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
367-
return enabledFeaturesSorted;
366+
return enabledFeatures;
368367
}
369368

370369
#pragma mark trackEvent methods

OptimizelySDKCore/OptimizelySDKCoreTests/OptimizelyTest.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -964,15 +964,6 @@ -(void)testGetEnabledFeaturesWithSomeFeaturesEnabledForUser {
964964
XCTAssertEqualObjects(features, enabledFeatures);
965965
}
966966

967-
// should return sorted feature array as some feature is enabled for user
968-
-(void)testGetEnabledFeaturesSortedWithSomeFeaturesEnabledForUser {
969-
NSArray<NSString *> *sortedEnabledFeatures = @[@"booleanFeature", @"booleanSingleVariableFeature", @"multiVariateFeature"];
970-
NSArray<NSString *> *unSortedEnabledFeatures = @[ @"multiVariateFeature", @"booleanFeature", @"booleanSingleVariableFeature"];
971-
NSArray<NSString *> *features = [self.optimizely getEnabledFeatures:kUserId attributes:self.attributes];
972-
XCTAssertEqualObjects(features, sortedEnabledFeatures);
973-
XCTAssertNotEqualObjects(features, unSortedEnabledFeatures);
974-
}
975-
976967
#pragma mark - Helper Methods
977968

978969
- (id)getOptimizelyMockForFeatureVariableType:(NSString *)featureVariableType variableKey:(NSString *)variableKey expectedReturn:(NSString *)expectedReturn {

OptimizelySDKCore/OptimizelySDKCoreTests/TestData/test_data_10_experiments.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -713,29 +713,6 @@
713713
"experimentIds": [],
714714
"variables": []
715715
},
716-
{
717-
"id": "155559",
718-
"key": "multiVariateFeature",
719-
"groupId": "",
720-
"rolloutId": "",
721-
"experimentIds": [
722-
"6358043287"
723-
],
724-
"variables": [
725-
{
726-
"id": "155560",
727-
"key": "firstLetter",
728-
"type": "string",
729-
"defaultValue": "H"
730-
},
731-
{
732-
"id": "155561",
733-
"key": "restOfName",
734-
"type": "string",
735-
"defaultValue": "arry"
736-
}
737-
]
738-
},
739716
{
740717
"id": "155549",
741718
"key": "booleanFeature",
@@ -788,6 +765,29 @@
788765
}
789766
]
790767
},
768+
{
769+
"id": "155559",
770+
"key": "multiVariateFeature",
771+
"groupId": "",
772+
"rolloutId": "",
773+
"experimentIds": [
774+
"6358043287"
775+
],
776+
"variables": [
777+
{
778+
"id": "155560",
779+
"key": "firstLetter",
780+
"type": "string",
781+
"defaultValue": "H"
782+
},
783+
{
784+
"id": "155561",
785+
"key": "restOfName",
786+
"type": "string",
787+
"defaultValue": "arry"
788+
}
789+
]
790+
},
791791
{
792792
"id": "155666",
793793
"key": "doubleSingleVariableFeature",

OptimizelySDKiOS/OptimizelySDKiOS.xcodeproj/xcshareddata/xcschemes/OptimizelySDKiOS.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES">
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
codeCoverageEnabled = "YES">
3132
<Testables>
3233
<TestableReference
3334
skipped = "NO">

0 commit comments

Comments
 (0)