Skip to content

Conversation

@charlotteliang
Copy link
Contributor

Move the following token class tests from IID to Messaging
TokenInfo
TokenOperation
TokenStore
Utilities
#no-changelog

@google-cla google-cla bot added the cla: yes label Mar 24, 2021
@charlotteliang
Copy link
Contributor Author

@paulb777 I think chen/fm-master is corrupted, and chen/token-add-test has the right latest version of code.

@charlotteliang
Copy link
Contributor Author

Looks like github UI now reflected that it's fixed by itself magically.

@google-oss-bot
Copy link

google-oss-bot commented Mar 24, 2021

Coverage Report

Affected SDKs

  • FirebaseMessaging-iOS-FirebaseMessaging.framework

    SDK overall coverage changed from 62.08% (67d52ac) to 64.11% (a443b0c) by +2.02%.

    Click to show coverage changes in 21 files.
    Filename Base (67d52ac) Head (a443b0c) Diff
    FIRMessaging.m 68.63% 52.62% -16.00%
    FIRMessagingAPNSInfo.m ? 87.23% ?
    FIRMessagingAuthKeychain.m ? 88.64% ?
    FIRMessagingAuthService.m ? 86.67% ?
    FIRMessagingBackupExcludedPlist.m ? 91.78% ?
    FIRMessagingCheckinPreferences.m ? 98.18% ?
    FIRMessagingCheckinService.m ? 89.80% ?
    FIRMessagingCheckinStore.m ? 79.87% ?
    FIRMessagingKeychain.m ? 93.89% ?
    FIRMessagingPendingTopicsList.m 90.65% 89.93% -0.72%
    FIRMessagingPubSub.m 53.01% 53.85% +0.83%
    FIRMessagingRemoteNotificationsProxy.m 62.97% 73.64% +10.67%
    FIRMessagingRmqManager.m 58.95% 58.57% -0.38%
    FIRMessagingSyncMessageManager.m 76.92% 73.08% -3.85%
    FIRMessagingTokenDeleteOperation.m ? 9.64% ?
    FIRMessagingTokenFetchOperation.m ? 75.32% ?
    FIRMessagingTokenInfo.m ? 82.78% ?
    FIRMessagingTokenManager.m ? 43.21% ?
    FIRMessagingTokenOperation.m ? 96.84% ?
    FIRMessagingTokenStore.m ? 69.03% ?
    FIRMessagingUtilities.m 44.23% 59.89% +15.65%

Test Logs

Copy link
Contributor

@maksymmalyhin maksymmalyhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on CI green, but I didn't review all the tests in too much details assuming that these are mostly existing tests moved to FCM. Please let me know if you need more detailed review for some part of the changes.

[super tearDown];
}

- (void)testTokenInfoCreationWithInvalidArchive {
Copy link
Contributor

@maksymmalyhin maksymmalyhin Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what we are actually testing by this test? Looks like only behaviour of deprecated [NSKeyedUnarchiver unarchiveObjectWithData:badData] method is tested. I would consider removing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

FIRMessagingTokenInfo *info = self.validTokenInfo;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSData *archive = [NSKeyedArchiver archivedDataWithRootObject:info];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: I would suggest using GULSecureCoding to avoid using deprecated API when unnecessary (here and at similar places).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's on my todo list next because we did introduce the NSCoding from IID to Messaging that we should migrate to NSSecureCoding.

@charlotteliang charlotteliang merged commit 162e754 into chen/fm-master Mar 25, 2021
@charlotteliang charlotteliang deleted the chen/token-add-test branch March 25, 2021 18:45
@firebase firebase locked and limited conversation to collaborators Apr 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants