-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(zio): support Native #432
feat(zio): support Native #432
Conversation
Thanks - there are now some test failures in fs2 unfortunately ;)
What's exactly the fix for test setup in JS? Maybe this will lead to some fix of the above ... |
I think the JS specs were never executed 🤣 . Btw, had some issues with the JS test setup. Was unable to get it working. I used Playwright temporarily to test it local. Much easier. But this project uses a shared
to the JS test-settings, and off you go. |
@ThijsBroersen There was a very specific reason for using Chrome (some years ago). Maybe it was fetch support? Not sure :) Anyway, that's what we're using in tapir, sttp, though it has its own problems. But maybe this would work now - we'd need to check in all of the projects, though. |
import fs2._ | ||
import org.scalatest.flatspec.AsyncFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import sttp.capabilities.StreamMaxLengthExceededException | ||
|
||
class Fs2StreamsTest extends AsyncFlatSpec with Matchers { | ||
|
||
implicit val runtime: unsafe.IORuntime = unsafe.IORuntime( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this is different from the default - could you add a comment how it is different, and why the change is made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the scalatest suites have an implicit executionContext
which is used to schedule the tests. If tests schedule tasks on other executioncontext it is undetectable by scalatest.
@@ -27,7 +27,7 @@ def dependenciesFor(version: String)(deps: (Option[(Long, Long)] => ModuleID)*): | |||
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq( | |||
organization := "com.softwaremill.sttp.shared", | |||
libraryDependencies ++= Seq( | |||
"org.scalatest" %% "scalatest" % scalaTestVersion % Test | |||
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that why JS tests were not executed? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
I made another commit, dropping zio-test to stay with scalatest. Just overriding the executionContext's of the suites. Let me know if you want to keep the zio-test rewrite or this one (old scalatest implementation). |
I'll keep the scalatest version - thanks! :) |
This PR should implement support for Scala Native for the zio module. The zio tests are refactored to zio-tests because running zio's to futures for Scalatest has issues (tests finishing because tests run on different execution context than the zio's). Pure zio-tests work way smoother.
It also fixes test setups for JS, seemed like JS suits were ignored.
closes #431