-
Notifications
You must be signed in to change notification settings - Fork 372
Migrate Test Suite to Munit with Cats Effect #2218
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
Conversation
|
@Sanskriti0805 , what is the reason of attaching |
the sbt-launch.jar file was mistakenly committed but has now been removed. Appreciate your guidance! |
No, it wasn't. Instead you added it to |
|
@Sanskriti0805 , the PR looks pretty good, thank you! |
|
hey @satorg Thanks a ton for all your help! 😊 |
|
|
||
| # sbt | ||
| .bsp/ | ||
| .bsp/ |
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.
Spurious change
| val transactor: Resource[IO, HikariTransactor[IO]] = | ||
| for { | ||
| ce <- ExecutionContexts.fixedThreadPool[IO](16) // our connect EC | ||
| ce <- ExecutionContexts.fixedThreadPool[IO](16) // connect our EC |
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 original comment was correct, the change makes it incorrect
| } flatMap { case (n, ds) => | ||
| // One final report to show that all connections are disposed | ||
| report(ds) *> IO((n, ds.getHikariPoolMXBean.getTotalConnections)) | ||
|
|
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.
Spurious change
| import doobie.* | ||
| import doobie.hikari.* | ||
| import doobie.implicits.* | ||
| import doobie.util.ExecutionContexts |
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.
Spurious change
| test("HikariTransactor should close connections logically within `use` block and physically afterward.") { | ||
| assertEquals(prog.unsafeRunSync(), (0, 0)) | ||
| prog.assertEquals((0, 0)) | ||
|
|
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.
This looks good, just a style thing, we don't need the extra empty line :)
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.
okay !
| val transactor: Resource[IO, HikariTransactor[IO]] = | ||
| for { | ||
| ce <- ExecutionContexts.fixedThreadPool[IO](16) // our connect EC | ||
| ce <- ExecutionContexts.fixedThreadPool[IO](16) // connect our EC |
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 original comment here makes sense, because with doobie we have a blocking ExecutionContext for awaiting for DB connections (i.e. the "connect EC")
Appreciate you trying to fix the comments though
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.
Thank you for the review and for pointing out the spurious changes! I understand now that some of the comment edits and small changes weren’t necessary. I’ll be more careful to limit future PRs to only meaningful changes and avoid unnecessary edits.
Appreciate you merging it regardless and taking the time to guide me! 🙌
Fixed the assertion method in the test acc to munits cat effect library