Skip to content

Migrate from Scalatest to MUnit#243

Merged
alexandru merged 4 commits into
mainfrom
migrate-to-munit
May 5, 2026
Merged

Migrate from Scalatest to MUnit#243
alexandru merged 4 commits into
mainfrom
migrate-to-munit

Conversation

@alexandru
Copy link
Copy Markdown
Member

No description provided.

@alexandru alexandru enabled auto-merge (squash) May 5, 2026 08:49
@alexandru alexandru disabled auto-merge May 5, 2026 08:49
@alexandru
Copy link
Copy Markdown
Member Author

/oc /review PR

@opencode-agent
Copy link
Copy Markdown

opencode-agent Bot commented May 5, 2026

PR Review: Migrate from Scalatest to MUnit

This is a clean, mechanical migration. The changes are consistent across all 18 files. A few points:

What's good

  • All test suites correctly switched from org.scalatest.funsuite.AnyFunSuite to munit.FunSuite
  • assert(a === b) correctly replaced with assertEquals(a, b) for better error messages
  • succeed() is the correct MUnit equivalent for an empty pass
  • The reusable munitTestDependency in build.sbt is clean and avoids duplication
  • illTyped from Shapeless is framework-agnostic (compile-time macro), so no changes needed there

Items worth noting

  1. assertEquals[Any, Any](v, ea1) in NewsubtypeValidatedSuite.scala:46 and NewtypeValidatedSuite.scala:43 — This widens both types to Any. It works because Newsubtype is a runtime-subtype of the underlying String, but it's fragile. Consider assertEquals(v, ea1.value) to compare at the correct type level.

  2. Native test-interface exclusion (build.sbt:26) — The .exclude("org.scala-native", s"test-interface_native0.5_${scalaBinaryVersion.value}") may be needed to avoid conflicts with sbt-scala-native, but there's no comment explaining why. If the project does run tests on Native (the core project defines a native platform), this exclusion could prevent test execution there. Worth verifying or adding a comment.

  3. assert usage in integration suites — The Circe/PureConfig integration suites still use Predef's assert, which works fine in MUnit but doesn't give the improved diff output that assertEquals provides. Not a blocker, since those assertions are on Either/Boolean values.

Verdict

LGTM. The migration is correct and consistent. No blocking issues.

New%20session%20-%202026-05-05T08%3A50%3A14.739Z
opencode session  |  github run

@alexandru alexandru merged commit d2feec4 into main May 5, 2026
6 checks passed
@alexandru alexandru deleted the migrate-to-munit branch May 5, 2026 09:33
alexandru added a commit that referenced this pull request May 5, 2026
* add integration for cats typeclasses

* Update sbt-mdoc to 2.3.8 (#117)

* Update sbt-sonatype to 3.9.21 (#92)

* Update sbt-sonatype to 3.9.21

* Revert commit(s) c78aa08

* Update sbt-sonatype to 3.9.21

* Update cats-core to 2.10.0 (#108)

* Update cats-core to 2.10.0

* Revert commit(s) 2f60ef3

* Update cats-core to 2.10.0

---------

Co-authored-by: Alexandru Nedelcu <alexandru@users.noreply.github.com>

* Update dependencies 2024 (#166)

* Update dependencies
* Add scala-native support

* Update README

* Add Makefile

* Update Scala, sbt, and all dependencies to latest versions (#228)

* Initial plan

* Update Scala versions, sbt, and all dependencies

Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

* Fix build issues and update dependencies

- Commented out site project due to sbt-microsites dependency on unavailable repositories
- Removed GitBranchPrompt plugin (no longer available)
- Simplified git.gitHeadCommit reference to use version directly
- All core projects compile and test successfully for Scala 2.12.21, 2.13.18, and 3.3.7

Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

* Upgrade sbt to 1.12.0

Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

* Fix ci-doc build failure by restoring site project without MicrositesPlugin

- Restored site project with only MdocPlugin enabled
- Removed MicrositesPlugin and all microsites-specific settings
- Kept sbt-microsites plugin commented out
- ci-doc command now works successfully

Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

* Restore sbt-microsites plugin and all original settings

- Fully restored sbt-microsites plugin (version 1.4.4)
- Restored all microsites settings in site project
- Updated all plugin versions as requested
- Updated Scala versions (2.12.21, 2.13.18, 3.3.7)
- Updated library versions (cats 2.13.0, circe 0.14.15, pureconfig 0.17.8)

Note: sbt-microsites requires sbt-site from repo.scala-sbt.org and repo.typesafe.com
which are blocked in the sandbox environment but will work in production CI.

Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>

* Scaladoc-based site (#233)

* v0.4.0

* Fix publishing

* v0.4.1

* Fix ScalaDoc link and add PureConfig integration

Updated ScalaDoc API link and added PureConfig integration documentation.

* Update sbt, scripted-plugin to 1.12.5 (#234)

* Update sbt, scripted-plugin to 1.12.6 (#235)

* Update scalatest to 3.2.20 (#237)

* Update sbt, scripted-plugin to 1.12.8 (#236)

* Update sbt, scripted-plugin to 1.12.9 (#240)

* Update auxlib, clib, javalib, nativelib, ... to 0.5.11 (#239)

* Update sbt-scalajs, scalajs-compiler, ... to 1.21.0 (#238)

* Activate scala-steward

* Enable OpenCode

* Enable /oc for created issues as well

* Revert "Enable /oc for created issues as well"

This reverts commit 3879515.

* Migrate from Scalatest to MUnit (#243)

* Fix MUnit integration

* Fix

* Fix docs

* Fixes

---------

Co-authored-by: Massimo Siani <massimosiani@users.noreply.github.com>
Co-authored-by: Scala Steward <43047562+scala-steward@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>
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.

1 participant