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

Cross-build for Scala.js #272

Merged
merged 9 commits into from Aug 17, 2021
Merged

Cross-build for Scala.js #272

merged 9 commits into from Aug 17, 2021

Conversation

armanbilge
Copy link
Collaborator

@armanbilge armanbilge commented Jul 18, 2021

The actual code was a pure cross, but the tests required significant re-working to avoid the use of unsafeRunSync (not available on JS).

Fixes #159.

@travisbrown
Copy link
Member

This looks reasonable to me, thanks! My only concern is about further ScalaTest lock-in, since we're slowly trying to migrate all of these projects to MUnit, but I can live with that.

Copy link
Collaborator

@BenFradet BenFradet left a comment

Choose a reason for hiding this comment

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

do we need all this import shuffling?
otherwise code looks good 👍

build.sbt Outdated Show resolved Hide resolved
Comment on lines +193 to +198
private implicit def assertionToProp: IO[Assertion] => PropF[IO] = { assertion =>
assertion.as(PropF.Result[IO](Prop.True, Nil, Set.empty, Set.empty): PropF[IO]).handleError {
case _: DiscardedEvaluationException => PropF.Result[IO](Prop.Undecided, Nil, Set.empty, Set.empty)
case t => PropF.Result[IO](Prop.Exception(t), Nil, Set.empty, Set.empty)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this still needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes?

@armanbilge
Copy link
Collaborator Author

If the goal is to move to munit I say let's dump this PR and do that instead. munit has better library support for integration with Cats Effect.

@travisbrown
Copy link
Member

@armanbilge My vote would be to merge this if it's ready and then migrate. As long as there's a clear route to MUnit and this work is already done, I think there's value in recording it in the history.

@armanbilge
Copy link
Collaborator Author

Ok, works for me! I'll fix it up for merge.

Co-authored-by: Ben Fradet <benjamin.fradet@gmail.com>
@armanbilge
Copy link
Collaborator Author

@travisbrown I'm unclear what to do about the CI failure, I don't think it's related to this PR.

@travisbrown
Copy link
Member

@armanbilge I don't think that last commit (moving the Scoverage config to JVM-only) is what you want, since it won't disable Scoverage on Scala.js, where it's causing problems.

I don't know why switching to cross-project would mess up these settings. You might look at the other failures (for Scala 2), which seem likely to be more obvious.

@armanbilge
Copy link
Collaborator Author

I can't reproduce any of these failures locally :(

@travisbrown
Copy link
Member

I see them locally with the same commands CI is using, but haven't looked in detail.

sbt --client '++3.0.1; clean; coverage; test; coverageReport; scalafmtCheckAll'
sbt --client '++2.13.6; clean; coverage; test; coverageReport; scalafmtCheckAll'

@armanbilge
Copy link
Collaborator Author

Thanks, I'll give that a try,

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2021

Codecov Report

Merging #272 (717ab29) into master (510800e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #272   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           25        25           
=========================================
  Hits            25        25           
Impacted Files Coverage Δ
fs2/src/main/scala/io/circe/fs2/ParsingPipe.scala 100.00% <ø> (ø)
fs2/src/main/scala/io/circe/fs2/package.scala 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 510800e...717ab29. Read the comment docs.

build.sbt Outdated
@@ -133,7 +138,7 @@ ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8")
ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(
List("clean", "coverage", "test", "coverageReport", "scalafmtCheckAll"),
List("clean", "coverage", "fs2JVM / test", "fs2JS / test", "fs2JVM / coverageReport", "scalafmtCheckAll"),
Copy link
Member

Choose a reason for hiding this comment

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

Looking at e.g. the circe-optics build, this seems to be done via .jsSettings(coverageEnabled := false), which seems better, since it applies for people running the default commands locally, and not just in CI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For whatever reason that doesn't seem to work here.

Copy link
Member

Choose a reason for hiding this comment

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

Ugh. I get why you're doing this, but this kind of thing is why I hate Scala.js so much.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the problems we are experiencing here are confounded by the fact this is a single-module project.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@travisbrown I think moving the project into its own folder and having a designated root fixes it.

@travisbrown
Copy link
Member

This looks good to me, thanks!

@armanbilge
Copy link
Collaborator Author

@travisbrown @BenFradet Anything I can do to get this merged? :) thanks!

@travisbrown
Copy link
Member

Works for me, thanks!

@armanbilge
Copy link
Collaborator Author

I just did a complex merge to keep this PR fresh. Is there any chance of it getting merged? It's okay if the answer is no, just trying to get an idea of where this stands :) thanks!

@travisbrown
Copy link
Member

Thanks, I'll merge when green this time.

@travisbrown travisbrown merged commit 11fbe4f into circe:master Aug 17, 2021
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.

ScalaJS Support
4 participants