Skip to content

Replace Monix with ZIO, ScalaTest with zio-test#6

Merged
guizmaii merged 2 commits intomasterfrom
zio
Apr 13, 2026
Merged

Replace Monix with ZIO, ScalaTest with zio-test#6
guizmaii merged 2 commits intomasterfrom
zio

Conversation

@guizmaii
Copy link
Copy Markdown
Collaborator

Summary

  • Replace monix-eval / monix-execution with zio 2.1.25
  • Replace cats.effect.Resource with ZIO.acquireRelease + Scope
  • Replace monix.execution.atomic.Atomic with java.util.concurrent.atomic.AtomicReference
  • Replace ScalaTest / ScalaCheck with zio-test
  • Rewrite tests using ZIOSpecDefault and assertTrue

Test plan

  • sbt compile passes
  • All 5 tests pass (sbt test)
  • CI passes on Java 17, 21, 25

- Replace monix-eval/monix-execution with zio 2.1.25
- Replace cats.effect.Resource with ZIO.acquireRelease + Scope
- Replace monix Atomic with java.util.concurrent.atomic.AtomicReference
- Replace Task(...) with ZIO.attempt(...)
- Replace Task.parSequenceUnordered with ZIO.collectAllParDiscard
- Replace .runSyncUnsafe() with Unsafe.unsafe { Runtime.default.unsafe.run(...) }
- Replace ScalaTest/ScalaCheck with zio-test
- Rewrite tests using ZIOSpecDefault and assertTrue
Copilot AI review requested due to automatic review settings April 13, 2026 10:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the ConcurrentConstantMemoryExcel implementation and its tests away from Monix + ScalaTest toward ZIO 2.x and zio-test, updating both runtime concurrency primitives and the test framework integration.

Changes:

  • Replaced Monix Task/Atomic usage with ZIO Task and java.util.concurrent.atomic.AtomicReference.
  • Reworked writeFile resource management from cats.effect.Resource to ZIO.acquireRelease + Scope.
  • Migrated ScalaTest specs to zio-test (ZIOSpecDefault, suite, test, assertTrue) and updated sbt test framework config.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.

File Description
core/src/main/scala/com/colisweb/jruby/concurrent/constant/memory/excel/ConcurrentConstantMemoryExcel.scala Swaps Monix/Cats-Effect resource + atomic usage for ZIO + AtomicReference and scoped resource handling.
core/src/test/scala/com/colisweb/jruby/concurrent/constant/memory/excel/ConcurrentConstantMemoryExcelSpec.scala Rewrites ScalaTest tests to zio-test structure/assertions.
build.sbt Introduces ZIO dependencies and zio-test test framework wiring; removes ScalaTest/ScalaCheck libs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +159 to +165
ZIO.succeed {
wb.dispose() // dispose of temporary files backing this workbook on disk. Necessary because not done in the `close()`. See: https://stackoverflow.com/a/50363245
wb.close()
}
)
_ <- computeWorkbookData(wb)
out <- ZIO.acquireRelease(ZIO.attempt(new FileOutputStream(fileName)))(out => ZIO.succeed(out.close()))
Comment on lines +159 to +165
ZIO.succeed {
wb.dispose() // dispose of temporary files backing this workbook on disk. Necessary because not done in the `close()`. See: https://stackoverflow.com/a/50363245
wb.close()
}
)
_ <- computeWorkbookData(wb)
out <- ZIO.acquireRelease(ZIO.attempt(new FileOutputStream(fileName)))(out => ZIO.succeed(out.close()))
Comment on lines +72 to +76
assertTrue(
new File(fileName).exists(),
cms.get().pages.nonEmpty,
!cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically.
)
Comment on lines +99 to +103
assertTrue(
new File(fileName).exists(),
cms.get().pages.nonEmpty,
!cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically.
)
Comment on lines +118 to +122
assertTrue(
new File(fileName).exists(),
cms.get().pages.nonEmpty,
!cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically.
)
@guizmaii guizmaii merged commit 61c7f66 into master Apr 13, 2026
4 checks passed
@guizmaii guizmaii deleted the zio branch April 13, 2026 10:35
guizmaii added a commit that referenced this pull request Apr 13, 2026
* Replace Monix with ZIO, ScalaTest with zio-test

- Replace monix-eval/monix-execution with zio 2.1.25
- Replace cats.effect.Resource with ZIO.acquireRelease + Scope
- Replace monix Atomic with java.util.concurrent.atomic.AtomicReference
- Replace Task(...) with ZIO.attempt(...)
- Replace Task.parSequenceUnordered with ZIO.collectAllParDiscard
- Replace .runSyncUnsafe() with Unsafe.unsafe { Runtime.default.unsafe.run(...) }
- Replace ScalaTest/ScalaCheck with zio-test
- Rewrite tests using ZIOSpecDefault and assertTrue

* Format build.sbt
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.

2 participants