Skip to content

Commit b042692

Browse files
authored
Changes to support new AP02 region (#73)
* Add support for CDP_ENDPOINT env for intergration test. Update inline documentation for new ap02 endpoints
1 parent f6add5b commit b042692

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

TreasureData.xcodeproj/xcshareddata/xcschemes/TreasureData.xcscheme

+17-16
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "NO">
30-
<Testables>
31-
<TestableReference
32-
skipped = "NO">
33-
<BuildableReference
34-
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "6B73809D192A09160097D56E"
36-
BuildableName = "TreasureDataTests.xctest"
37-
BlueprintName = "TreasureDataTests"
38-
ReferencedContainer = "container:TreasureData.xcodeproj">
39-
</BuildableReference>
40-
</TestableReference>
41-
</Testables>
4230
<MacroExpansion>
4331
<BuildableReference
4432
BuildableIdentifier = "primary"
@@ -54,6 +42,11 @@
5442
value = "$(API_MASTER_KEY)"
5543
isEnabled = "YES">
5644
</EnvironmentVariable>
45+
<EnvironmentVariable
46+
key = "CDP_ENDPOINT"
47+
value = "$(CDP_ENDPOINT)"
48+
isEnabled = "YES">
49+
</EnvironmentVariable>
5750
<EnvironmentVariable
5851
key = "API_ENDPOINT"
5952
value = "$(API_ENDPOINT)"
@@ -75,8 +68,18 @@
7568
isEnabled = "YES">
7669
</EnvironmentVariable>
7770
</EnvironmentVariables>
78-
<AdditionalOptions>
79-
</AdditionalOptions>
71+
<Testables>
72+
<TestableReference
73+
skipped = "NO">
74+
<BuildableReference
75+
BuildableIdentifier = "primary"
76+
BlueprintIdentifier = "6B73809D192A09160097D56E"
77+
BuildableName = "TreasureDataTests.xctest"
78+
BlueprintName = "TreasureDataTests"
79+
ReferencedContainer = "container:TreasureData.xcodeproj">
80+
</BuildableReference>
81+
</TestableReference>
82+
</Testables>
8083
</TestAction>
8184
<LaunchAction
8285
buildConfiguration = "Debug"
@@ -97,8 +100,6 @@
97100
ReferencedContainer = "container:TreasureData.xcodeproj">
98101
</BuildableReference>
99102
</MacroExpansion>
100-
<AdditionalOptions>
101-
</AdditionalOptions>
102103
</LaunchAction>
103104
<ProfileAction
104105
buildConfiguration = "Release"

TreasureData/TreasureData.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,19 @@ typedef void (^ErrorHandler)(NSString* _Nonnull errorCode, NSString* _Nullable e
7070
* AWS East https://cdp.in.treasuredata.com
7171
* AWS Tokyo https://cdp-tokyo.in.treasuredata.com
7272
* AWS EU https://cdp-eu01.in.treasuredata.com
73-
* IDCF https://cdp-idcf.in.treasuredata.com
73+
* AWS Asia Pacific (Seoul) https://cdp-ap02.in.treasuredata.com
7474
*/
7575
@property(nonatomic, strong) NSString * _Nullable cdpEndpoint;
7676

7777
#pragma mark - Initialization
7878

7979
/**
8080
* Assign the target API endpoint, default is "https://in.treasuredata.com".
81+
* Possible values:
82+
* AWS East https://in.treasuredata.com
83+
* AWS Tokyo https://tokyo.in.treasuredata.com
84+
* AWS EU https://eu01.in.treasuredata.com
85+
* AWS Asia Pacific (Seoul) https://ap02.in.treasuredata.com
8186
* This have to be call before `initializeWithApiKey(apiKey:)`, otherwise it won't have effect.
8287
* @param apiEndpoint for the in effect endpoint (`+[TreasureData initializeApiEndpoint:]`).
8388
*/

TreasureDataTests/IntegrationTests.swift

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class IntegrationTests: XCTestCase {
1414
static var api: TDAPI!
1515
static var apiKey: String!
1616
static var collectorEndpoint: String!
17+
static var cdpEndpoint: String!
1718

1819
static let TargetDatabase = "ios_it"
1920
static var sessionPrefix = uuid()
@@ -33,6 +34,9 @@ class IntegrationTests: XCTestCase {
3334
guard let collectorEndpoint = ProcessInfo.processInfo.environment["COLLECTOR_ENDPOINT"] else {
3435
fatalError("Missing env COLLECTOR_ENDPOINT")
3536
}
37+
guard let cdpEndpoint = ProcessInfo.processInfo.environment["CDP_ENDPOINT"] else {
38+
fatalError("Missing env CDP_ENDPOINT")
39+
}
3640
// Syntax: AUDIENCE_TOKENS=token1,token2
3741
guard let audienceTokensString = ProcessInfo.processInfo.environment["AUDIENCE_TOKENS"] else {
3842
fatalError("Missing env AUDIENCE_TOKENS")
@@ -44,6 +48,7 @@ class IntegrationTests: XCTestCase {
4448

4549
IntegrationTests.apiKey = apiKey
4650
IntegrationTests.collectorEndpoint = collectorEndpoint
51+
IntegrationTests.cdpEndpoint = cdpEndpoint
4752
IntegrationTests.audienceTokens = audienceTokensString.split(separator: ",").map { String($0) }
4853
let keyValueStrings = userSegmentKeysString.split(separator: ",").map { String($0) }
4954
keyValueStrings.forEach { keyValueString in
@@ -65,6 +70,7 @@ class IntegrationTests: XCTestCase {
6570
TreasureData.initializeApiEndpoint(IntegrationTests.collectorEndpoint)
6671
sdkClient = TreasureData(apiKey: IntegrationTests.apiKey)
6772
sdkClient.defaultDatabase = IntegrationTests.TargetDatabase
73+
sdkClient.cdpEndpoint = IntegrationTests.cdpEndpoint
6874
tempTables = []
6975
}
7076

scripts/ci_test

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ xcodebuild \
1717
API_MASTER_KEY="$API_MASTER_KEY" \
1818
API_ENDPOINT="$API_ENDPOINT" \
1919
COLLECTOR_ENDPOINT="$COLLECTOR_ENDPOINT" \
20+
CDP_ENDPOINT="$CDP_ENDPOINT" \
2021
AUDIENCE_TOKENS="$AUDIENCE_TOKENS" \
2122
USER_SEGMENT_KEYS="$USER_SEGMENT_KEYS" \
2223
test \

0 commit comments

Comments
 (0)