TwitterAPIKit icon indicating copy to clipboard operation
TwitterAPIKit copied to clipboard

Linux support

Open mironal opened this issue 3 years ago • 13 comments

We have confirmed that this branch is buildable, but due to limitations of XCTest and Swift, we have not been able to run tests on it.

#120

mironal avatar Apr 11 '22 00:04 mironal

Codecov Report

Merging #121 (63533d7) into main (7bbdd82) will decrease coverage by 0.04%. The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
- Coverage   87.43%   87.38%   -0.05%     
==========================================
  Files         263      264       +1     
  Lines        6627     6634       +7     
==========================================
+ Hits         5794     5797       +3     
- Misses        833      837       +4     
Impacted Files Coverage Δ
Sources/TwitterAPIKit/Extensions/Data.swift 97.56% <ø> (-0.91%) :arrow_down:
Sources/TwitterAPIKit/TwitterAPIKit.swift 100.00% <ø> (ø)
Sources/TwitterAPIKit/TwitterAPIResponse.swift 86.32% <0.00%> (-3.06%) :arrow_down:
Sources/TwitterAPIKit/Extensions/HMAC.swift 100.00% <100.00%> (ø)
Sources/TwitterAPIKit/OAuthHelper.swift 96.07% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Apr 11 '22 00:04 codecov-commenter

Update 2022/08/19

merge main branch.

❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift build
Building for debugging...
Build complete! (13.84s)
❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift test
Building for debugging...
/project/Tests/TwitterAPIKitTests/APIv1/Geo/GetGeoReverseGeocodeRequestV1Tests.swift:12:9: error: cannot find 'XCTContext' in scope
        XCTContext.runActivity(named: "ft") { _ in
        ^~~~~~~~~~
/project/Tests/TwitterAPIKitTests/APIv1/Geo/GetGeoReverseGeocodeRequestV1Tests.swift:35:9: error: cannot find 'XCTContext' in scope
        XCTContext.runActivity(named: "meter") { _ in

...

error: fatalError

mironal avatar Aug 19 '22 02:08 mironal

Please add this!!!

Mcrich23 avatar Aug 30 '22 05:08 Mcrich23

@mironal Sourcery (one of your checks) wasn't able to run, because it wasn't running on macOS, thus failing. It seems that although it can theoretically run on GitHub, it prevents itself from doing so.

Mcrich23 avatar Aug 30 '22 05:08 Mcrich23

Additionally, I am running it on my vapor server in docker and it's working flawlessly

Mcrich23 avatar Aug 30 '22 05:08 Mcrich23

@Mcrich23 Thanks for your comment.

Sorry & Unfortunately this branch is not yet complete and will not be merged into the main branch.

If you are using Swift PM, you can specify this branch to use in your project.

When we update the main branch, this branch will continue to follow.

mironal avatar Aug 30 '22 06:08 mironal

@mironal Ok, tysm. May I ask what is yet to be added?

Mcrich23 avatar Aug 30 '22 06:08 Mcrich23

@Mcrich23 We would like to merge it after successful testing in a Linux environment.

Currently, TwitterAPIKit tests cannot be compiled due to limitations of XCTest.

We are wondering whether we should make major modifications to the tests or wait for an XCTest update.

However, we do not feel the need to rush, as we can use this branch directly if we want to use it on Linux.

Do you have a reason to rush the merge to the main branch?

mironal avatar Aug 30 '22 06:08 mironal

@mironal No, I just didn't realize at first that main didn't support linux and I am sure others will have the same issue. Maybe consider putting a note about it in the readme?

Mcrich23 avatar Aug 30 '22 15:08 Mcrich23

@Mcrich23 Thank you. I updated the README!

image

mironal avatar Aug 31 '22 01:08 mironal

@mironal cool!

Mcrich23 avatar Aug 31 '22 01:08 Mcrich23

@mironal btw, it links to the pr request and not the branch itself

Mcrich23 avatar Aug 31 '22 01:08 Mcrich23

Updated: 2022/11/04

❯ docker run -it -w /project -v `pwd`:/project --platform linux/x86_64 swift swift build
Building for debugging...
[740/740] Compiling TwitterAPIKit TwitterRateLimit.swift
Build complete! (221.43s)

mironal avatar Nov 04 '22 00:11 mironal