Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux support #116

Merged
merged 2 commits into from
May 19, 2022
Merged

Linux support #116

merged 2 commits into from
May 19, 2022

Conversation

vox-humana
Copy link
Contributor

These extra imports allow to use the library in tests on Linux. As an example I've enabled Linux tests in kean/Get library.

Also, removed unrelated warning that swift build showed:

Mocker.swift:79:21: warning: result of call to 'registerClass' is unused
        URLProtocol.registerClass(MockingURLProtocol.self)
                    ^            ~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

@BasThomas BasThomas left a comment

Choose a reason for hiding this comment

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

This is great; thanks @vox-humana!

@BasThomas
Copy link
Contributor

I wonder if we can run a build on Linux to verify that this works as expected and does not break in the future?

@wetransferplatform
Copy link
Collaborator

Messages
📖

View more details on Bitrise

📖 MockerTests: Executed 25 tests (0 failed, 0 retried, 0 skipped) in 1.807 seconds

SwiftLint found issues

Severity File Reason
Warning Mocker.swift:96 Line should be 140 characters or less: currently 149 characters (line_length)
Error MockingURLProtocol.swift:41 Line should be 160 characters or less: currently 166 characters (line_length)
Error MockingURLProtocol.swift:44 Line should be 160 characters or less: currently 200 characters (line_length)
Warning MockingURLProtocol.swift:101 Line should be 140 characters or less: currently 147 characters (line_length)
Error MockingURLProtocol.swift:105 Line should be 160 characters or less: currently 221 characters (line_length)
Error Mock.swift:8 Line should be 160 characters or less: currently 177 characters (line_length)
Warning Mock.swift:76 Line should be 140 characters or less: currently 155 characters (line_length)
Error Mock.swift:108 Line should be 160 characters or less: currently 211 characters (line_length)
Error Mock.swift:111 Line should be 160 characters or less: currently 208 characters (line_length)
Error Mock.swift:120 Line should be 160 characters or less: currently 287 characters (line_length)
Warning Mock.swift:149 Line should be 140 characters or less: currently 142 characters (line_length)
Warning Mock.swift:156 Line should be 140 characters or less: currently 141 characters (line_length)
Error Mock.swift:163 Line should be 160 characters or less: currently 246 characters (line_length)
Error Mock.swift:164 Line should be 160 characters or less: currently 236 characters (line_length)
Warning Mock.swift:175 Line should be 140 characters or less: currently 150 characters (line_length)
Warning Mock.swift:176 Line should be 140 characters or less: currently 153 characters (line_length)
Warning Mock.swift:212 Line should be 140 characters or less: currently 159 characters (line_length)
Error Mock.swift:222 Line should be 160 characters or less: currently 168 characters (line_length)

Code Coverage Report

Name Coverage
Mocker.framework 86.42%

Generated by 🚫 Danger Swift against 9b2a6f7

@kairadiagne
Copy link
Contributor

We should indicate in the README on which platforms the framework is available.

@AvdLee AvdLee merged commit 5b270d7 into WeTransfer:master May 19, 2022
@wetransferplatform
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 2.5.6 🚀

Generated by GitBuddy

@vox-humana
Copy link
Contributor Author

vox-humana commented May 20, 2022

I wonder if we can run a build on Linux to verify that this works as expected and does not break in the future?

@BasThomas I am happy to add a simple Github action. Ideally it should also run tests via swift test, however, tests currently depend on UIKit, so swift test is failing not only on Linux but also on macOS.
As far as I can see the only reason for importing UIKit is comparing images (UIImage) in tests. I think tests might just compare NSData instead. What do you think?

Also, not sure what's the current status of CI on the project. I see there is a Travis CI badge but seems like it is very outdated 🤔

@BasThomas
Copy link
Contributor

As far as I can see the only reason for importing UIKit is comparing images (UIImage) in tests. I think tests might just compare NSData instead. What do you think?

Looks like it (and in the bridging header, but that's likely to be a CocoaPods artefact). We can either compare data, or use an NSImage on macOS.

Also, not sure what's the current status of CI on the project. I see there is a Travis CI badge but seems like it is very outdated 🤔

CI is run on Bitrise (using https://github.com/WeTransfer/WeTransfer-iOS-CI); I think that badge is indeed outdated 😂

Let us know if you'd be willing to tackle this; that'd be great!

@vox-humana
Copy link
Contributor Author

It definitely took me more than I initially thought 😅 #118 @BasThomas let's continue discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants