Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
41 stars 5 forks source link

Remove TestHelpers dependency from GravatarUI #298

Closed kean closed 4 months ago

kean commented 4 months ago

This PR removes TestHelpers dependency from GravatarUI that was breaking release builds because of the following @testable import:

@testable import Gravatar

extension ImageDownloadService {
    static func mock(with session: URLSessionProtocol, cache: ImageCaching? = nil) -> ImageDownloadService {
        let client = URLSessionHTTPClient(urlSession: session)
        let service = ImageDownloadService(client: client, cache: cache)
        return service
    }
}

Error:

<head></head>
❌ /opt/ci/builds/builder/automattic/wordpress-ios/DerivedData/SourcePackages/checkouts/Gravatar-SDK-iOS/Sources/TestHelpers/ImageDownloadService+Extension.swift:1:18: module 'Gravatar' was not compiled for testing
--
  | @testable import Gravatar

Note: required for WP-iOS migration to SPM 🙇

pinarol commented 4 months ago

If you need this for WP side I think we should merge it to the release branch though. And make a new patch release.

pinarol commented 4 months ago

Our latest tag is 2.0.1, we should better branch off from there and merge this fix there. I can do this on Mon if that's OK.

kean commented 4 months ago

Our latest tag is 2.0.1, we should better branch off from there and merge this fix there. I can do this on Mon if that's OK.

That sounds great, thank you!

pinarol commented 4 months ago

Closing this one in favor of: https://github.com/Automattic/Gravatar-SDK-iOS/pull/300