diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 4b60d55d..724ba054 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -8,6 +8,7 @@ on: branches: - master - development + - "*_baseline" jobs: test: diff --git a/SplitPushManagerUT.xctestplan b/SplitPushManagerUT.xctestplan index cb5d5680..fcd78c99 100644 --- a/SplitPushManagerUT.xctestplan +++ b/SplitPushManagerUT.xctestplan @@ -79,6 +79,13 @@ "FlushTests", "FolderApiKeyTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -163,6 +170,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitStreamingUT.xctestplan b/SplitStreamingUT.xctestplan index 836f193e..7f27be0f 100644 --- a/SplitStreamingUT.xctestplan +++ b/SplitStreamingUT.xctestplan @@ -76,6 +76,7 @@ "FlushTests", "FolderApiKeyTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -155,6 +156,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitTests/Impressions/ImpressionsToggleTest.swift b/SplitTests/Impressions/ImpressionsToggleTest.swift index ddd60e75..64ddab89 100644 --- a/SplitTests/Impressions/ImpressionsToggleTest.swift +++ b/SplitTests/Impressions/ImpressionsToggleTest.swift @@ -158,10 +158,6 @@ class ImpressionsToggleTest: XCTestCase { sdkReadyExpectation.fulfill() } - client.on(event: SplitEvent.sdkReadyTimedOut) { - sdkReadyExpectation.fulfill() - } - exps.append(sseExp) wait(for: exps, timeout: 5) @@ -240,7 +236,6 @@ class ImpressionsToggleTest: XCTestCase { return IntegrationHelper.emptySplitChanges(since: 99999, till: 99999) } return splitJson - } private func buildStreamingHandler() -> TestStreamResponseBindingHandler { diff --git a/SplitTests/Integration/Cache/InitialCacheTest.swift b/SplitTests/Integration/Cache/InitialCacheTest.swift index fb6fe825..c8d3eaeb 100644 --- a/SplitTests/Integration/Cache/InitialCacheTest.swift +++ b/SplitTests/Integration/Cache/InitialCacheTest.swift @@ -353,10 +353,10 @@ class InitialCacheTest: XCTestCase { var treatmentCache = "" var treatmentReady = "" - var readyCacheNotFired = false + var readyCacheNotFired = true client.on(event: SplitEvent.sdkReadyFromCache) { treatmentCache = client.getTreatment(self.splitName) - readyCacheNotFired = true + readyCacheNotFired = false } client.on(event: SplitEvent.sdkReady) { @@ -377,8 +377,6 @@ class InitialCacheTest: XCTestCase { XCTAssertFalse(readyCacheNotFired) } - - private func getChanges(for hitNumber: Int) -> Data { if hitNumber < jsonChanges.count { return Data(self.jsonChanges[hitNumber].utf8) diff --git a/SplitTests/Integration/Cache/ReadyFromCacheTest.swift b/SplitTests/Integration/Cache/ReadyFromCacheTest.swift index ec1bad12..52845f1a 100644 --- a/SplitTests/Integration/Cache/ReadyFromCacheTest.swift +++ b/SplitTests/Integration/Cache/ReadyFromCacheTest.swift @@ -154,7 +154,7 @@ class ReadyFromCacheTest: XCTestCase { } func testNotExistingSplitsAndConnectionOk() { - // When NO feature flags and connection available, ready from cache should NOT be fired and Ready should be fired + // When NO feature flags and connection available, ready from cache should be fired alongside Ready let splitDatabase = TestingHelper.createTestDatabase(name: "ready_from_cache_test", queue: dbqueue) let session = HttpSessionMock() let reqManager = HttpRequestManagerTestDispatcher(dispatcher: buildTestDispatcher(), @@ -201,7 +201,7 @@ class ReadyFromCacheTest: XCTestCase { wait(for: [readyExp], timeout: 3) let treatmentReady = client.getTreatment(splitName) - XCTAssertFalse(cacheReadyFired) + XCTAssertTrue(cacheReadyFired) XCTAssertTrue(readyFired) XCTAssertFalse(timeoutFired) XCTAssertEqual("control", treatmentCache) diff --git a/SplitTests/Integration/Cache/RolloutCacheManagerIntegrationTest.swift b/SplitTests/Integration/Cache/RolloutCacheManagerIntegrationTest.swift index e8e5f230..7153935e 100644 --- a/SplitTests/Integration/Cache/RolloutCacheManagerIntegrationTest.swift +++ b/SplitTests/Integration/Cache/RolloutCacheManagerIntegrationTest.swift @@ -1,8 +1,252 @@ import XCTest +@testable import Split final class RolloutCacheManagerIntegrationTest: XCTestCase { - override func setUpWithError() throws { + private var httpClient: HttpClient! + private let apiKey = IntegrationHelper.dummyApiKey + private let userKey = "key" + private var firstSplitHit: Bool! + private var streamingBinding: TestStreamResponseBinding? + private var notificationHelper: NotificationHelperStub? + private var testDb: SplitDatabase! + private var enableRequest: Bool! + private let lock = NSLock() + override func setUp() { + let session = HttpSessionMock() + let reqManager = HttpRequestManagerTestDispatcher(dispatcher: buildTestDispatcher(), + streamingHandler: buildStreamingHandler()) + httpClient = DefaultHttpClient(session: session, requestManager: reqManager) + notificationHelper = NotificationHelperStub() + testDb = TestingHelper.createTestDatabase(name: "test") + firstSplitHit = true + enableRequest = false + } + + func testExpirationPeriodIsUsed() { + test(timestampDaysAgo: getTimestampDaysAgo(days: 1), configBuilder: RolloutCacheConfiguration.builder().set(expirationDays: 1)) + } + + func testClearOnInitClearCacheOnStartup() { + test(timestampDaysAgo: getTimestampDaysAgo(days: 0), configBuilder: RolloutCacheConfiguration.builder().set(clearOnInit: true)) + } + + func testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed() { + // preload DB with update timestamp of now + preloadDB(updateTimestamp: getTimestampDaysAgo(days: 0), lastClearTimestamp: 0, changeNumber: 8000) + + // Track initial values + let initialFlags = testDb.splitDao.getAll() + let initialSegments = testDb.mySegmentsDao.getBy(userKey: userKey) + let initialLargeSegments = testDb.myLargeSegmentsDao.getBy(userKey: userKey) + let initialChangeNumber = testDb.generalInfoDao.longValue(info: .splitsChangeNumber) + + // Initialize SDK + let factory = getFactory(rolloutConfig: RolloutCacheConfiguration.builder().set(clearOnInit: true).build()) + sleep(1) + + // Track intermediate values + let intermediateFlags = testDb.splitDao.getAll() + let intermediateSegments = testDb.mySegmentsDao.getBy(userKey: userKey) + let intermediateLargeSegments = testDb.myLargeSegmentsDao.getBy(userKey: userKey) + let intermediateChangeNumber = testDb.generalInfoDao.longValue(info: .splitsChangeNumber) + + // Resume server responses after tracking DB values + lock.lock() + enableRequest = true + lock.unlock() + + // Wait for ready + let readyExp = XCTestExpectation(description: "SDK READY Expectation") + factory.client.on(event: SplitEvent.sdkReady) { + readyExp.fulfill() + } + wait(for: [readyExp], timeout: 15) + + // Destroy factory + let destroyExp = XCTestExpectation(description: "Destroy Expectation") + factory.client.destroy(completion: { + destroyExp.fulfill() + }) + + wait(for: [destroyExp], timeout: 15) + + // Initialize SDK again + lock.lock() + enableRequest = false + lock.unlock() + + preloadDB(updateTimestamp: nil, lastClearTimestamp: nil, changeNumber: nil) + let factory2 = getFactory(rolloutConfig: RolloutCacheConfiguration.builder().set(clearOnInit: true).build()) + sleep(1) + + // Track intermediate values + let factory2Flags = testDb.splitDao.getAll() + let factory2Segments = testDb.mySegmentsDao.getBy(userKey: userKey) + let factory2LargeSegments = testDb.myLargeSegmentsDao.getBy(userKey: userKey) + let factory2ChangeNumber = testDb.generalInfoDao.longValue(info: .splitsChangeNumber) + + // initial values + XCTAssertEqual(1, initialFlags.count) + XCTAssertEqual(2, initialSegments?.segments.count ?? 0) + XCTAssertFalse(initialSegments?.segments.isEmpty ?? true) + XCTAssertFalse(initialLargeSegments?.segments.isEmpty ?? true) + XCTAssertEqual(8000, initialChangeNumber) + + // values after clear + XCTAssertEqual(0, intermediateFlags.count) + XCTAssertTrue(intermediateSegments?.segments.isEmpty ?? true) + XCTAssertTrue(intermediateLargeSegments?.segments.isEmpty ?? true) + XCTAssertEqual(-1, intermediateChangeNumber) + + // values after second init (values were reinserted into DB); no clear should have happened + XCTAssertEqual(1, factory2Flags.count) + XCTAssertEqual(2, factory2Segments?.segments.count ?? 0) + XCTAssertFalse(factory2Segments?.segments.isEmpty ?? true) + XCTAssertFalse(factory2LargeSegments?.segments.isEmpty ?? true) + XCTAssertEqual(99999, factory2ChangeNumber) + XCTAssertTrue(0 < testDb.generalInfoDao.longValue(info: .rolloutCacheLastClearTimestamp) ?? -1) + } + + private func test(timestampDaysAgo: Int64, configBuilder: RolloutCacheConfiguration.Builder) { + let oldTimestamp = timestampDaysAgo + preloadDB(updateTimestamp: oldTimestamp, lastClearTimestamp: 0, changeNumber: 8000) + // Track initial values + let initialFlags = testDb.splitDao.getAll() + let initialSegments = testDb.mySegmentsDao.getBy(userKey: userKey) + let initialLargeSegments = testDb.myLargeSegmentsDao.getBy(userKey: userKey) + let initialChangeNumber = testDb.generalInfoDao.longValue(info: .splitsChangeNumber) + + // Initialize SDK + let factory = getFactory(rolloutConfig: configBuilder.build()) + + let readyExp = XCTestExpectation(description: "SDK READY Expectation") + factory.client.on(event: SplitEvent.sdkReady) { + readyExp.fulfill() + } + + // Track final values + verify(factory: factory, readyExp: readyExp, initialFlags: initialFlags, initialSegments: initialSegments, initialLargeSegments: initialLargeSegments, initialChangeNumber: initialChangeNumber) + } + + private func preloadDB(updateTimestamp: Int64?, lastClearTimestamp: Int64?, changeNumber: Int64?) { + let split = TestingHelper.buildSplit(name: "test_split", treatment: "test_treatment") + testDb.splitDao.insertOrUpdate(split: split) + if let updateTimestamp = updateTimestamp { + testDb.generalInfoDao.update(info: .splitsUpdateTimestamp, longValue: updateTimestamp) + } + if let lastClearTimestamp = lastClearTimestamp { + testDb.generalInfoDao.update(info: .rolloutCacheLastClearTimestamp, longValue: lastClearTimestamp) + } + if let changeNumber = changeNumber { + testDb.generalInfoDao.update(info: .splitsChangeNumber, longValue: changeNumber) + } + testDb.mySegmentsDao.update(userKey: userKey, change: SegmentChange(segments: ["s1", "s2"], changeNumber: nil)) + testDb.myLargeSegmentsDao.update(userKey: userKey, change: SegmentChange(segments: ["l1", "l2"], changeNumber: nil)) + } + + private func loadSplitsChangeFile() -> String { + guard let splitJson = FileHelper.readDataFromFile(sourceClass: self, name: "splitchanges_1", type: "json") else { + return IntegrationHelper.emptySplitChanges(since: 99999, till: 99999) + } + return splitJson + } + + private func verify(factory: SplitFactory, readyExp: XCTestExpectation, initialFlags: [Split], initialSegments: SegmentChange?, initialLargeSegments: SegmentChange?, initialChangeNumber: Int64?) { + let finalFlags = testDb.splitDao.getAll() + let finalSegments = testDb.mySegmentsDao.getBy(userKey: userKey) + let finalLargeSegments = testDb.myLargeSegmentsDao.getBy(userKey: userKey) + let finalChangeNumber = testDb.generalInfoDao.longValue(info: .splitsChangeNumber) + + // Resume responses after tracking DB Values + lock.lock() + enableRequest = true + lock.unlock() + + // Wait for ready + wait(for: [readyExp], timeout: 15) + + // Verify + XCTAssertEqual(1, initialFlags.count) + XCTAssertEqual(2, initialSegments?.segments.count ?? 0) + XCTAssertFalse(initialSegments?.segments.isEmpty ?? true) + XCTAssertFalse(initialLargeSegments?.segments.isEmpty ?? true) + XCTAssertEqual(8000, initialChangeNumber) + XCTAssertEqual(0, finalFlags.count) + XCTAssertTrue(finalSegments?.segments.isEmpty ?? true) + XCTAssertTrue(finalLargeSegments?.segments.isEmpty ?? true) + XCTAssertEqual(-1, finalChangeNumber) + XCTAssertTrue(0 < testDb.generalInfoDao.longValue(info: .rolloutCacheLastClearTimestamp) ?? -1) + } + + private func getTimestampDaysAgo(days: Int) -> Int64 { + return Date.secondsToDays(seconds: Date.now() - Int64(days * 86400)) + } + + private func getFactory(rolloutConfig: RolloutCacheConfiguration) -> SplitFactory { + let splitConfig: SplitClientConfig = SplitClientConfig() + splitConfig.logLevel = .verbose + splitConfig.streamingEnabled = false + splitConfig.featuresRefreshRate = 1 + + let key: Key = Key(matchingKey: userKey) + let builder = DefaultSplitFactoryBuilder() + _ = builder.setHttpClient(httpClient) + _ = builder.setReachabilityChecker(ReachabilityMock()) + _ = builder.setTestDatabase(testDb) + _ = builder.setNotificationHelper(notificationHelper!) + let factory = builder.setApiKey(apiKey).setKey(key) + .setConfig(splitConfig).build()! + + return factory + } + + private func buildTestDispatcher() -> HttpClientTestDispatcher { + return { request in + self.lock.lock() + while !self.enableRequest { + self.lock.unlock() + Thread.sleep(forTimeInterval: 0.5) + self.lock.lock() + } + self.lock.unlock() + + if request.isSplitEndpoint() { + if self.firstSplitHit { + self.firstSplitHit = false + return TestDispatcherResponse(code: 200, data: Data(IntegrationHelper.emptySplitChanges(since: -1, till: 99999).utf8)) + } + return TestDispatcherResponse(code: 200, data: Data(IntegrationHelper.emptySplitChanges(since: 99999, till: 99999).utf8)) + } + + if request.isMySegmentsEndpoint() { + return TestDispatcherResponse(code: 200, data: Data(IntegrationHelper.emptyMySegments.utf8)) + } + + if request.isAuthEndpoint() { + return TestDispatcherResponse(code: 200, data: Data(IntegrationHelper.dummySseResponse().utf8)) + } + + if request.isImpressionsEndpoint() { + return TestDispatcherResponse(code: 200) + } + + if request.isImpressionsCountEndpoint() { + return TestDispatcherResponse(code: 200) + } + + if request.isUniqueKeysEndpoint() { + return TestDispatcherResponse(code: 200) + } + return TestDispatcherResponse(code: 404) + } + } + + private func buildStreamingHandler() -> TestStreamResponseBindingHandler { + return { request in + self.streamingBinding = TestStreamResponseBinding.createFor(request: request, code: 200) + return self.streamingBinding! + } } } diff --git a/SplitTests/Integration/Recorder/TelemetryTest.swift b/SplitTests/Integration/Recorder/TelemetryTest.swift index 0f80c230..fb75392f 100644 --- a/SplitTests/Integration/Recorder/TelemetryTest.swift +++ b/SplitTests/Integration/Recorder/TelemetryTest.swift @@ -113,8 +113,8 @@ class TelemetryTest: XCTestCase { XCTAssertEqual(0, timeUntilReadyBefore) XCTAssertEqual(0, timeUntilReadyFromCacheBefore) XCTAssertTrue(timeUntilReady > 0) - XCTAssertEqual(0, timeUntilReadyFromCache) - XCTAssertFalse(readyFromCacheFired) + XCTAssertTrue(0 < timeUntilReadyFromCache && timeUntilReadyFromCache <= timeUntilReady) + XCTAssertTrue(readyFromCacheFired) let semaphore = DispatchSemaphore(value: 0) client.destroy(completion: { diff --git a/SplitTests/SplitEventsManagerTest.swift b/SplitTests/SplitEventsManagerTest.swift index 9f66d293..11d8603a 100644 --- a/SplitTests/SplitEventsManagerTest.swift +++ b/SplitTests/SplitEventsManagerTest.swift @@ -262,6 +262,39 @@ class SplitEventsManagerTest: XCTestCase { eventManager.stop() } + + func testSdkReadyFromCacheWithoutFlagCachedValues() { + + let config: SplitClientConfig = SplitClientConfig() + let eventManager: SplitEventsManager = DefaultSplitEventsManager(config: config) + eventManager.start() + + eventManager.notifyInternalEvent(SplitInternalEvent.mySegmentsLoadedFromCache) + eventManager.notifyInternalEvent(SplitInternalEvent.myLargeSegmentsLoadedFromCache) + eventManager.notifyInternalEvent(SplitInternalEvent.attributesLoadedFromCache) + + eventManager.notifyInternalEvent(SplitInternalEvent.mySegmentsUpdated) + eventManager.notifyInternalEvent(SplitInternalEvent.myLargeSegmentsUpdated) + eventManager.notifyInternalEvent(SplitInternalEvent.splitsUpdated) + var shouldStop = false + let expectation = XCTestExpectation(description: "SDK Ready triggered") + queue.async { + while !shouldStop { + sleep(UInt32(self.intervalExecutionTime)) + if eventManager.eventAlreadyTriggered(event: SplitEvent.sdkReady) { + shouldStop = true; + expectation.fulfill() + } + } + } + wait(for: [expectation], timeout: expectationTimeOut) + + XCTAssertTrue(eventManager.eventAlreadyTriggered(event: SplitEvent.sdkReadyFromCache), "SDK Ready should from cache be triggered"); + XCTAssertTrue(eventManager.eventAlreadyTriggered(event: SplitEvent.sdkReady), "SDK Ready should be triggered"); + XCTAssertFalse(eventManager.eventAlreadyTriggered(event: SplitEvent.sdkReadyTimedOut), "SDK Time out shouldn't be triggered"); + + eventManager.stop() + } // MARK: Helpers func currentTimestamp() -> Int { diff --git a/SplitTests/Storage/GeneralInfoStorageTest.swift b/SplitTests/Storage/GeneralInfoStorageTest.swift index 4fc37f28..7c512060 100644 --- a/SplitTests/Storage/GeneralInfoStorageTest.swift +++ b/SplitTests/Storage/GeneralInfoStorageTest.swift @@ -44,4 +44,28 @@ final class GeneralInfoStorageTest: XCTestCase { func testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil() throws { XCTAssertEqual(generalInfoStorage.getRolloutCacheLastClearTimestamp(), 0) } + + func testSetSplitsFilterQueryStringSetsValueOnDao() throws { + generalInfoStorage.setSplitsFilterQueryString(filterQueryString: "query") + + XCTAssertEqual(generalInfoDao.updatedString, ["splitsFilterQueryString": "query"]) + } + + func testGetSplitsFilterQueryStringGetsValueFromDao() throws { + generalInfoDao.update(info: .splitsFilterQueryString, stringValue: "query") + + XCTAssertEqual(generalInfoStorage.getSplitsFilterQueryString(), "query") + } + + func testSetFlagsSpecSetsValueOnDao() throws { + generalInfoStorage.setFlagSpec(flagsSpec: "2.2") + + XCTAssertEqual(generalInfoDao.updatedString, ["flagsSpec": "2.2"]) + } + + func testGetFlagsSpecGetsValueFromDao() throws { + generalInfoDao.update(info: .flagsSpec, stringValue: "2.1") + + XCTAssertEqual(generalInfoStorage.getFlagSpec(), "2.1") + } } diff --git a/SplitTests/Streaming/FeatureFlagsSynchronizerTest.swift b/SplitTests/Streaming/FeatureFlagsSynchronizerTest.swift index e6d5f6d8..66aa413b 100644 --- a/SplitTests/Streaming/FeatureFlagsSynchronizerTest.swift +++ b/SplitTests/Streaming/FeatureFlagsSynchronizerTest.swift @@ -29,6 +29,7 @@ class FeatureFlagsSynchronizerTest: XCTestCase { var synchronizer: FeatureFlagsSynchronizer! var broadcasterChannel: SyncEventBroadcasterStub! var generalInfoStorage: GeneralInfoStorageMock! + var telemetryStorageStub: TelemetryStorageStub! override func setUp() { synchronizer = buildSynchronizer() @@ -47,8 +48,10 @@ class FeatureFlagsSynchronizerTest: XCTestCase { splitsStorage = SplitsStorageStub() broadcasterChannel = SyncEventBroadcasterStub() generalInfoStorage = GeneralInfoStorageMock() + telemetryStorageStub = TelemetryStorageStub() splitsStorage.update(splitChange: ProcessedSplitChange(activeSplits: [], archivedSplits: [], changeNumber: 100, updateTimestamp: 100)) + generalInfoStorage.setFlagSpec(flagsSpec: "1.2") let storageContainer = SplitStorageContainer(splitDatabase: TestingHelper.createTestDatabase(name: "pepe"), splitsStorage: splitsStorage, @@ -58,7 +61,7 @@ class FeatureFlagsSynchronizerTest: XCTestCase { impressionsCountStorage: PersistentImpressionsCountStorageStub(), eventsStorage: EventsStorageStub(), persistentEventsStorage: PersistentEventsStorageStub(), - telemetryStorage: TelemetryStorageStub(), + telemetryStorage: telemetryStorageStub, mySegmentsStorage: MySegmentsStorageStub(), myLargeSegmentsStorage: MySegmentsStorageStub(), attributesStorage: AttributesStorageStub(), @@ -71,7 +74,7 @@ class FeatureFlagsSynchronizerTest: XCTestCase { splitConfig = SplitClientConfig() splitConfig.syncEnabled = syncEnabled if let splitFilters = splitFilters { - var builder = SyncConfig.builder() + let builder = SyncConfig.builder() for splitFilter in splitFilters { builder.addSplitFilter(splitFilter) } @@ -80,13 +83,15 @@ class FeatureFlagsSynchronizerTest: XCTestCase { splitConfig.sync = SyncConfig.builder().addSplitFilter(SplitFilter.byName(["SPLIT1"])).build() } + let filterBuilder = FilterBuilder(flagSetsValidator: DefaultFlagSetsValidator(telemetryProducer: telemetryStorageStub)) + let queryString = try? filterBuilder.add(filters: splitFilters ?? []).build() synchronizer = DefaultFeatureFlagsSynchronizer(splitConfig: splitConfig, storageContainer: storageContainer, syncWorkerFactory: syncWorkerFactory, broadcasterChannel: broadcasterChannel, syncTaskByChangeNumberCatalog: updateWorkerCatalog, - splitsFilterQueryString: "", - flagsSpec: "", + splitsFilterQueryString: queryString ?? "", + flagsSpec: "1.2", splitEventsManager: eventsManager) return synchronizer } @@ -211,10 +216,11 @@ class FeatureFlagsSynchronizerTest: XCTestCase { XCTAssertTrue(deleted.contains("tset2")) XCTAssertTrue(deleted.contains("apre_tset3")) XCTAssertEqual(9, deleted.count) + XCTAssertEqual("&sets=set3,set4", generalInfoStorage.getSplitsFilterQueryString()) XCTAssertEqual(1, broadcasterChannel.pushedEvents.filter { $0 == .splitLoadedFromCache }.count) } - func testLoadSplitsWhenFlagsSetsHasChangedClearsAllFeatureFlags() { + func testLoadSplitsWhenFlagsSetsHasChangedClearsAllFeatureFlagsAndUpdatesFlagsSpec() { let names = ["test1", "test2", "test3", "test4"] for name in names { @@ -229,6 +235,7 @@ class FeatureFlagsSynchronizerTest: XCTestCase { ThreadUtils.delay(seconds: 0.5) XCTAssertTrue(persistentSplitsStorage.clearCalled) + XCTAssertEqual("1.2", generalInfoStorage.getFlagSpec()) XCTAssertEqual(1, broadcasterChannel.pushedEvents.filter { $0 == .splitLoadedFromCache }.count) } diff --git a/SplitiOSStreaming.xctestplan b/SplitiOSStreaming.xctestplan index c0781759..68a44037 100644 --- a/SplitiOSStreaming.xctestplan +++ b/SplitiOSStreaming.xctestplan @@ -168,6 +168,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSStreaming_1.xctestplan b/SplitiOSStreaming_1.xctestplan index b8bc78c0..b9270f8b 100644 --- a/SplitiOSStreaming_1.xctestplan +++ b/SplitiOSStreaming_1.xctestplan @@ -83,6 +83,13 @@ "FlushTests", "FolderApiKeyTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -168,6 +175,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSStreaming_2.xctestplan b/SplitiOSStreaming_2.xctestplan index 4762309a..748f49e7 100644 --- a/SplitiOSStreaming_2.xctestplan +++ b/SplitiOSStreaming_2.xctestplan @@ -83,6 +83,13 @@ "FlushTests", "FolderApiKeyTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -168,6 +175,21 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SemverIntegrationTest", "SemverTest", "SingleSyncTest", diff --git a/SplitiOSUnit.xctestplan b/SplitiOSUnit.xctestplan index 8a1a3ad3..21b2aed5 100644 --- a/SplitiOSUnit.xctestplan +++ b/SplitiOSUnit.xctestplan @@ -85,6 +85,13 @@ "FlagSetsIntegrationTests", "FlushTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -155,6 +162,25 @@ "PushManagerEventBroadcasterTest", "PushNotificationManagerTest", "ReadyFromCacheTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSUnit_1.xctestplan b/SplitiOSUnit_1.xctestplan index fadf95db..7c4119f7 100644 --- a/SplitiOSUnit_1.xctestplan +++ b/SplitiOSUnit_1.xctestplan @@ -69,6 +69,13 @@ "FilterBuilderTest", "FlagSetsIntegrationTests", "FlushTests", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -113,6 +120,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSUnit_2.xctestplan b/SplitiOSUnit_2.xctestplan index 927bfb1e..e1a851dd 100644 --- a/SplitiOSUnit_2.xctestplan +++ b/SplitiOSUnit_2.xctestplan @@ -80,6 +80,13 @@ "FlagSetsCacheTests", "FlagSetsIntegrationTests", "FlushTests", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -159,6 +166,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSUnit_3.xctestplan b/SplitiOSUnit_3.xctestplan index 8673830f..9a4a6e8d 100644 --- a/SplitiOSUnit_3.xctestplan +++ b/SplitiOSUnit_3.xctestplan @@ -85,6 +85,13 @@ "FlagSetsIntegrationTests", "FlushTests", "GeneralInfoDaoTest", + "GeneralInfoStorageTest", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testGetUpdateTimestampGetsValueFromDao()", + "GeneralInfoStorageTest\/testGetUpdateTimestampReturnsZeroIfEntityIsNil()", + "GeneralInfoStorageTest\/testSetRolloutCacheLastClearTimestampSetsValueOnDao()", + "GeneralInfoStorageTest\/testSetUpdateTimestampSetsValueOnDao()", "GreaterThanOrEqualToSemverMatcherTest", "HashedImpressionDaoTest", "HashedImpressionsStorageTests", @@ -162,6 +169,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SemverIntegrationTest", "SemverTest", diff --git a/SplitiOSUnit_4.xctestplan b/SplitiOSUnit_4.xctestplan index 2f54c09d..ce77df7f 100644 --- a/SplitiOSUnit_4.xctestplan +++ b/SplitiOSUnit_4.xctestplan @@ -160,6 +160,25 @@ "ReconnectBackoffCounterTest", "RecorderFlusherCheckerTests", "RegexTest", + "RolloutCacheConfigurationTest", + "RolloutCacheConfigurationTest\/testClearOnInitIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testDefaultValues()", + "RolloutCacheConfigurationTest\/testExpirationIsCorrectlySet()", + "RolloutCacheConfigurationTest\/testNegativeExpirationIsSetToDefault()", + "RolloutCacheManagerIntegrationTest", + "RolloutCacheManagerIntegrationTest\/testClearOnInitClearCacheOnStartup()", + "RolloutCacheManagerIntegrationTest\/testExpirationPeriodIsUsed()", + "RolloutCacheManagerIntegrationTest\/testRepeatedInitWithClearOnInitSetToTrueDoesNotClearIfMinDaysHasNotElapsed()", + "RolloutCacheManagerTest", + "RolloutCacheManagerTest\/testDefaultValueForLastClearTimestampClearsCacheWhenClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testDefaultValueForUpdateTimestampDoesNotClearCache()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStorageOnlyOnceWhenExecutedConsecutively()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsTrue()", + "RolloutCacheManagerTest\/testValidateCacheCallsClearOnStoragesWhenExpirationIsSurpassed()", + "RolloutCacheManagerTest\/testValidateCacheCallsListener()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotCallClearOnStoragesWhenExpirationIsNotSurpassedAndClearOnInitIsFalse()", + "RolloutCacheManagerTest\/testValidateCacheDoesNotUpdateLastClearTimestampWhenStoragesAreNotCleared()", + "RolloutCacheManagerTest\/testValidateCacheUpdatesLastClearTimestampWhenStoragesAreCleared()", "SdkUpdateStreamingTest", "SegmentsSyncHelperTests", "SegmentsSyncHelperTests\/testCdnByPassNoTillChange()",