Skip to content

Improve handling of push token / profile updates #237

Improve handling of push token / profile updates

Improve handling of push token / profile updates #237

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / Xcode test results succeeded Nov 30, 2023 in 0s

Xcode test results

Testing workspace klaviyo-swift-sdk with scheme klaviyo-swift-sdk-Package

Summary

TotalSuccess PassedFailure FailedSkipped SkippedExpected Failure Expected Failure⏱️ Time
1261260001.50s

Test Summary

KlaviyoSwiftTests

  • Device: iPhone 14, 17.0.1 (21A342)
  • SDK: Simulator - iOS 16.4, 16.4
TestTotalSuccessFailureSkippedExpected Failure
test-class APIRequestErrorHandlingTests1212000
test-class AppLifeCycleEventsTests1111000
test-class ArchivalSystemTest11000
test-class ArchivalUtilsTests88000
test-class EncodableTests55000
test-class FileUtilsTests22000
test-class KlaviyoAPITests77000
test-class KlaviyoSDKTests1111000
test-class KlaviyoStateTests1111000
test-class LegacyTests1010000
test-class NetworkSessionTests33000
test-class StateChangePublisherTests33000
test-class StateManagementEdgeCaseTests1919000
test-class StateManagementTests2121000
test-class Tests22000

Failure Failures

All tests passed 🎉


Code Coverage

Coverage Covered Executable
KlaviyoSwift 62.40 % 2345 3758
  Store.swift 58.07 % 187 322
  Misc.swift 34.93 % 51 146
  Cancellation.swift 86.18 % 212 246
  APIRequestErrorHandling.swift 98.36 % 60 61
  ConcurrencySupport.swift 3.03 % 4 132
  SDKRequestIterator.swift 0.00 % 0 135
  StateManagement.swift 87.22 % 423 485
  ArchivalUtils.swift 100.00 % 42 42
  KlaviyoModels.swift 100.00 % 86 86
  KlaviyoEnvironment.swift 42.70 % 38 89
  AppContextInfo.swift 56.16 % 41 73
  ReachabilitySwift.swift 18.94 % 43 227
  Publisher.swift 46.15 % 66 143
  Klaviyo.swift 57.35 % 160 279
  InternalAPIModels.swift 88.26 % 203 230
  KlaviyoState.swift 72.12 % 238 330
  Effect.swift 39.86 % 116 291
  AppLifeCycleEvents.swift 100.00 % 78 78
  StateChangePublisher.swift 55.88 % 19 34
  Create.swift 90.21 % 129 143
  KlaviyoAPI.swift 93.18 % 82 88
  FileUtils.swift 95.65 % 22 23
  LoggerClient.swift 0.00 % 0 1
  NetworkSession.swift 60.81 % 45 74
KlaviyoSwiftExtension 0.00 % 0 0
KlaviyoSwiftTests 72.87 % 5782 7935
  APIRequestErrorHandlingTests.swift 100.00 % 312 312
  SDKRequestIterator.swift 0.00 % 0 135
  Cancellation.swift 86.18 % 212 246
  KlaviyoModels.swift 100.00 % 86 86
  AppContextInfo.swift 56.16 % 41 73
  KlaviyoTestUtils.swift 89.81 % 97 108
  StateChangePublisher.swift 55.88 % 19 34
  FileUtils.swift 95.65 % 22 23
  StateManagement.swift 87.22 % 423 485
  Publisher.swift 46.15 % 66 143
  StateChangePublisherTests.swift 99.18 % 242 244
  InternalAPIModels.swift 88.26 % 203 230
  ArchivalUtilsTests.swift 100.00 % 128 128
  LegacyTests.swift 95.80 % 274 286
  KlaviyoAPITests.swift 96.93 % 221 228
  Effect.swift 39.86 % 116 291
  KlaviyoState.swift 72.12 % 238 330
  LoggerClient.swift 0.00 % 0 1
  KlaviyoAPI.swift 93.18 % 82 88
  ConcurrencySupport.swift 3.03 % 4 132
  Create.swift 90.21 % 129 143
  TestData.swift 100.00 % 11 11
  TestStore.swift 36.50 % 388 1063
  StateManagementTests.swift 100.00 % 575 575
  ArchivalUtils.swift 100.00 % 42 42
  StateManagementEdgeCaseTests.swift 100.00 % 327 327
  SimpleMockURLProtocol.swift 100.00 % 12 12
  ReachabilitySwift.swift 18.94 % 43 227
  AppLifeCycleEvents.swift 100.00 % 78 78
  Store.swift 58.07 % 187 322
  NetworkSessionTests.swift 100.00 % 22 22
  AppLifeCycleEventsTests.swift 96.03 % 242 252
  FileUtilsTests.swift 84.78 % 39 46
  EncodableTests.swift 100.00 % 53 53
  KlaviyoEnvironment.swift 42.70 % 38 89
  NetworkSession.swift 60.81 % 45 74
  KlaviyoStateTests.swift 97.17 % 309 318
  Tests.swift 89.47 % 34 38
  KlaviyoSDKTests.swift 98.05 % 151 154
  Misc.swift 34.93 % 51 146
  APIRequestErrorHandling.swift 98.36 % 60 61
  Klaviyo.swift 57.35 % 160 279
Total 69.50 % 8127 11693

Details

Test Details

KlaviyoSwiftTestsback

APIRequestErrorHandlingTests back

SuccessFailureSkippedExpected Failure⏱️
12 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testMissingOrInvalidResponse()
Successtest-method testRateLimitErrorWithExistingBackoffRetry()
Successtest-method testRateLimitErrorWithExistingRetry()
Successtest-method testSendRequestDataDecodingError()
Successtest-method testSendRequestFailureIncrementsRetryCount()
Successtest-method testSendRequestFailureWithBackoff()
Successtest-method testSendRequestHttpFailureDequesRequest()
Successtest-method testSendRequestInternalError()
Successtest-method testSendRequestInternalRequestError()
Successtest-method testSendRequestInvalidData()
Successtest-method testSendRequestMaxRetries()
Successtest-method testSendRequestUnknownError()

AppLifeCycleEventsTests back

SuccessFailureSkippedExpected Failure⏱️
11 (100%)0 (0%)0 (0%)0 (0%)0.00s
Successtest-method testAppBackgroundGetsStopAction()
Successtest-method testAppBackgroundStopsReachability()
Successtest-method testAppBecomeActiveGetsStartAction()
Successtest-method testAppBecomesActiveStartsReachibility()
Successtest-method testAppTerminateGetsStopAction()
Successtest-method testAppTerminateStopsReachability()
Successtest-method testReachabilityNotificationStatusHandled()
Successtest-method testReachabilityStartFailureIsHandled()
Successtest-method testReachabilityStatusNilThenNotNil()
Successtest-method testReachaibilityNotificationGetsRightAction()
Successtest-method testStartReachabilityCalledOnSubscription()

ArchivalSystemTest back

SuccessFailureSkippedExpected Failure⏱️
1 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testArchiveUnarchive()

ArchivalUtilsTests back

SuccessFailureSkippedExpected Failure⏱️
8 (100%)0 (0%)0 (0%)0 (0%)0.00s
Successtest-method testArchiveFails()
Successtest-method testArchiveUnarchive()
Successtest-method testArchiveWriteFails()
Successtest-method testUnarchive()
Successtest-method testUnarchiveInvalidData()
Successtest-method testUnarchiveUnableToRemoveFile()
Successtest-method testUnarchiveUnarchiveFails()
Successtest-method testUnarchiveWhereFileDoesNotExist()

EncodableTests back

SuccessFailureSkippedExpected Failure⏱️
5 (100%)0 (0%)0 (0%)0 (0%)0.00s
Successtest-method testEventPayload()
Successtest-method testKlaviyoRequest()
Successtest-method testKlaviyoState()
Successtest-method testProfilePayload()
Successtest-method testTokenPayload()

FileUtilsTests back

SuccessFailureSkippedExpected Failure⏱️
2 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testFilePathForData()
Successtest-method testRemoveItemWithError()

KlaviyoAPITests back

SuccessFailureSkippedExpected Failure⏱️
7 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testEncodingError()
Successtest-method testInvalidStatusCode()
Successtest-method testInvalidURL()
Successtest-method testNetworkError()
Successtest-method testSuccessfulResponseWithEvent()
Successtest-method testSuccessfulResponseWithProfile()
Successtest-method testSuccessfulResponseWithStoreToken()

KlaviyoSDKTests back

SuccessFailureSkippedExpected Failure⏱️
11 (100%)0 (0%)0 (0%)0 (0%)1.04s
Successtest-method testCreateEvent()
Successtest-method testCreateEventFromDocumentation()
Successtest-method testHandlePushNotification()
Successtest-method testInitializeSDk()
Successtest-method testKlaviyoSDKInit()
Successtest-method testPropertyGetters()
Successtest-method testSetExternalId()
Successtest-method testSetFirstName()
Successtest-method testSetProfile()
Successtest-method testSetPushToken()
Successtest-method testUnhandlePushNotification()

KlaviyoStateTests back

SuccessFailureSkippedExpected Failure⏱️
11 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testBackgroundStates()
Successtest-method testFullKlaviyoStateEncodingDecodingIsEqual()
Successtest-method testInvalidEventPropertiesOnData()
Successtest-method testLoadNewKlaviyoState()
Successtest-method testLoadWithRequestMigration()
Successtest-method testMigrateInvalidDataSkipped()
Successtest-method testPushEnablementStates()
Successtest-method testSaveKlaviyoStateWithMissingApiKeyLogsError()
Successtest-method testStateFileExistsInvalidData()
Successtest-method testStateFileExistsInvalidJSON()
Successtest-method testValidStateFileExists()

LegacyTests back

SuccessFailureSkippedExpected Failure⏱️
10 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testInvalidLegacyEventCustomerPropertiesHasNoEffect()
Successtest-method testInvalidLegacyEventPropertiesStillUpdatesState()
Successtest-method testInvalidLegacyProfileDoesntUpdateState()
Successtest-method testLegacyEventOpenedPush()
Successtest-method testLegacyEventRequestSetsIdentifiers()
Successtest-method testLegacyEventsAndProfilesAreLoggedAfterInitialization()
Successtest-method testLegacyEventUnitialized()
Successtest-method testLegacyProfileMissingAnonymousId()
Successtest-method testLegacyProfileRequestSetsEmail()
Successtest-method testLegacyProfileUnitializedUpdatesPendingProfiles()

NetworkSessionTests back

SuccessFailureSkippedExpected Failure⏱️
3 (100%)0 (0%)0 (0%)0 (0%)0.39s
Successtest-method testCreateEmphemeralSesionHeaders()
Successtest-method testDefaultUserAgent()
Successtest-method testSessionDataTask()

StateChangePublisherTests back

SuccessFailureSkippedExpected Failure⏱️
3 (100%)0 (0%)0 (0%)0 (0%)0.00s
Successtest-method testQuickStateUpdatesTriggerOnlyOneSaves()
Successtest-method testStateChangeDuplicateAreRemoved()
Successtest-method testStateChangePublisher()

StateManagementEdgeCaseTests back

SuccessFailureSkippedExpected Failure⏱️
19 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testCompleteInitializationWhileAlreadyInitialized()
Successtest-method testCompleteInitializationWithExistingIdentifiers()
Successtest-method testEnqueueEventUninitialized()
Successtest-method testInitializeWhileInitializing()
Successtest-method testNetworkStatusChangedUninitialized()
Successtest-method testSendRequestBeforeInitialization()
Successtest-method testSetEmailMissingAnonymousIdStillSetsEmail()
Successtest-method testSetEmailUninitialized()
Successtest-method testSetExternalIdMissingAnonymousIdStillSetsExternalId()
Successtest-method testSetExternalIdUninitialized()
Successtest-method testSetPhoneNumberMissingApiKeyStillSetsPhoneNumber()
Successtest-method testSetPhoneNumberUninitialized()
Successtest-method testSetProfileUnitialized()
Successtest-method testSetPushTokenUninitialized()
Successtest-method testSetPushTokenWithMissingAnonymousId()
Successtest-method testStartUninitialized()
Successtest-method testStopInitializing()
Successtest-method testStopUninitialized()
Successtest-method testTokenRequestMissingApiKey()

StateManagementTests back

SuccessFailureSkippedExpected Failure⏱️
21 (100%)0 (0%)0 (0%)0 (0%)0.01s
Successtest-method testEmptyQueueDoesNotFlush()
Successtest-method testEnqueueEvent()
Successtest-method testEnqueueEventWithIdentifiers()
Successtest-method testFlushQueueDuringExponentialBackoff()
Successtest-method testFlushQueueExponentialBackoffGoesToSize()
Successtest-method testFlushQueueWithMultipleRequests()
Successtest-method testFlushUninitializedQueueDoesNotFlush()
Successtest-method testFlushWithPendingProfile()
Successtest-method testInitializeSubscribesToAppropriatePublishers()
Successtest-method testInitialize()
Successtest-method testNetworkConnectivityChanges()
Successtest-method testQueueThatIsFlushingDoesNotFlush()
Successtest-method testSendRequestWhenNotFlushing()
Successtest-method testSendRequestWithNoRequestsInFlight()
Successtest-method testSetEmail()
Successtest-method testSetExternalId()
Successtest-method testSetPhoneNumber()
Successtest-method testSetProfileWithExistingProperties()
Successtest-method testSetPushTokenMultipleTimes()
Successtest-method testSetPushToken()
Successtest-method testStopWithRequestsInFlight()

Tests back

SuccessFailureSkippedExpected Failure⏱️
2 (100%)0 (0%)0 (0%)0 (0%)0.00s
Successtest-method testServerProdURL()
Successtest-method testSetupEmailIsOverridden()