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

Replace Quick/Nimble with XCTest #139

Merged
merged 21 commits into from
Nov 13, 2023
Merged

Conversation

joemasilotti
Copy link
Member

This PR replaces the third-party test framework Quick with the one that ships with Xcode, XCTest.

Converting from Quick/Nimble to XCTest aligns the project closer to default iOS apps. And XCTest feels a bit more at home for Rails developers using TestUnit vs. RSpec.

All tests are green, locally. But a few of the Swifter server-related ones are taking up to 30 seconds to run. Sadly, I can't seem to get GCDWebServer to work on my machine to verify if this is Swifter's fault or not.

@joemasilotti joemasilotti force-pushed the xctest branch 2 times, most recently from bfd1221 to c3feae8 Compare November 9, 2023 18:10
@joemasilotti
Copy link
Member Author

Update: I have everything green locally with Swifter but can't seem to get the tests to pass on CI. The requests to the embedded server keep timing out.

I'd love to rip out the embedded server stuff but I don't know of a good alternative. Would love suggestions or ideas if anyone has them!

@joemasilotti
Copy link
Member Author

Forget Swifter, we're using Embassy now! And this library is (more) actively maintained.

This PR is officially ready for review. :)

@joemasilotti joemasilotti marked this pull request as ready for review November 9, 2023 22:16
@zoejessica zoejessica self-requested a review November 10, 2023 08:56
Copy link
Contributor

@zoejessica zoejessica left a comment

Choose a reason for hiding this comment

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

@joemasilotti This is looking terrific and I'm very happy to lean on XCTest and try out Embassy which looks super clean 👌

I've left some suggestions that take the opportunity to remove try!s from the path of asserting on results. I'm not at all fussed about using try! when setting up test files from disk btw, it's just the ones being asserted on that would crash the test suite instead of reporting a failure.

I also did the same in the SessionTests file when setting up the server, since that's a third party dependency.

.github/workflows/main.yml Outdated Show resolved Hide resolved
Tests/JavaScriptVisitTests.swift Outdated Show resolved Hide resolved
Tests/SessionTests.swift Outdated Show resolved Hide resolved
Tests/SessionTests.swift Outdated Show resolved Hide resolved
Tests/SessionTests.swift Outdated Show resolved Hide resolved
Tests/SessionTests.swift Outdated Show resolved Hide resolved
Tests/SessionTests.swift Outdated Show resolved Hide resolved
Tests/ScriptMessageTests.swift Outdated Show resolved Hide resolved
@joemasilotti joemasilotti mentioned this pull request Nov 11, 2023
7 tasks
Copy link
Contributor

@zoejessica zoejessica left a comment

Choose a reason for hiding this comment

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

Super! 🚀

Tests/SessionTests.swift Outdated Show resolved Hide resolved
Co-authored-by: Zoë Smith <zoews@me.com>
@joemasilotti joemasilotti merged commit b975b95 into hotwired:main Nov 13, 2023
@joemasilotti joemasilotti deleted the xctest branch November 13, 2023 20:51
olivaresf added a commit that referenced this pull request Feb 12, 2024
…s-response

* origin/main:
  Fix obious wrong boolean expression (#159)
  Replace Quick/Nimble with XCTest (#139)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants