-
Notifications
You must be signed in to change notification settings - Fork 277
feat: Scala 3 test cross-compilation for lift-common/actor/util/testkit #2045
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
Implement version-specific test directories and configuration for Scala 2.13/3 compatibility: - Add Test/unmanagedSourceDirectories to build.sbt for all test modules - Migrate 36 test files to scala-2.13/ and scala-3/ directories - Add mockito_scalatest dependency for Scala 3 mocking support - Transform specs2 4.x (Scala 2.13) matchers to specs2 5.x (Scala 3) syntax - Fix LruMapSpec and BoxLoggingSpec for Scala 3 compatibility This enables lift-common, lift-actor, lift-util, and lift-testkit tests to cross-compile between Scala 2.13.18 and Scala 3.3.7, following the pattern established in lift-webkit. All 629 Scala 2.13 tests pass. Scala 3 tests require additional matcher syntax refinements. Co-Authored-By: Claude Haiku 4.5 <[email protected]>
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.
Pull request overview
This PR implements Scala 3 test cross-compilation for the lift-common, actor, util, and testkit modules. Tests are organized into version-specific directories (scala-2.13/ and scala-3/) to support both Scala 2.13 and Scala 3 compilation. The main difference between versions is the matcher syntax used in specs2 tests: Scala 2.13 uses must_== while Scala 3 uses ===.
Changes:
- Added version-specific test directories for Scala 2.13 and Scala 3
- Adapted specs2 matcher syntax for Scala 3 compatibility (=== instead of must_==)
- Maintained test logic and coverage across both versions
Reviewed changes
Copilot reviewed 36 out of 73 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Multiple test files in scala-2.13/ | Scala 2.13-specific tests using must_== matcher syntax |
| Multiple test files in scala-3/ | Scala 3-specific tests using === matcher syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implements version-specific test directories (scala-2.13/ and scala-3/)
for lift-common, lift-actor, and lift-util modules to enable Scala 3
cross-compilation.
Changes:
- Migrated 36 test files to version-specific directories
- Updated specs2 matcher syntax from 4.x to 5.x for Scala 3
- Replaced must_== with === for simple types
- Replaced === with must beEqualTo() for Box types due to
Scala 3 strict equality and Diffable requirements
- Replaced shouldEqual with must beEqualTo()
- Replaced eventually syntax with Thread.sleep for async tests
- Replaced ScalaMock with Mockito for Scala 3 compatibility
- Added mockito_scalatest dependency to build.sbt
- Updated Scope import path for specs2 5.x
- Fixed operator precedence issues requiring parentheses
- Added explicit type annotations for lambda expressions
- Added canEqualAny import for Scala 3 strict equality checks
Test Status:
- lift-common: 146 tests passing (Scala 2.13 & 3.3.7)
- lift-actor: 25 tests passing (Scala 2.13 & 3.3.7)
- lift-util: 68 compilation errors remaining (out of 446 tests)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Resolved all remaining compilation errors in lift-util tests for Scala 3 by fixing specs2 5.x compatibility issues: - Fixed import paths (MatchersImplicits -> MatcherImplicits, After moved) - Replaced must_!= with must not(beEqualTo(...)) - Replaced must be > with must beGreaterThan(...) - Replaced must be >= with must beGreaterThanOrEqualTo(...) - Replaced must be_< with must beLessThan(...) - Fixed boolean function returns (replaced matchers with boolean expressions) - Fixed Object comparisons using must beEqualTo for strict equality - Fixed Period/TimeSpan comparison using must beEqualTo - Fixed forall blocks to return boolean instead of Result - Fixed BeforeEach trait usage (step() instead of unit return) - Fixed operator precedence for ternary operator tests Test Status: - lift-common: 146 tests passing (100%) - lift-actor: 25 tests passing (100%) - lift-util: 433/446 tests passing (97%) Total: 604 Scala 3 tests passing out of 617 (98%) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Fixed failing tests in CssSelectorSpec, CssHelpersSpec, and HtmlHelpersSpec by addressing type inference issues with the === operator in specs2 5.x. Changes include extracting Box values before comparison using openOrThrowException, and using proper beNull/beNone matchers instead of === null/None comparisons. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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.
Pull request overview
Copilot reviewed 37 out of 74 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implement version-specific test directories enabling Scala 2.13/3 cross-compilation across four core framework modules. Tests are organized into scala-2.13/ and scala-3/ directories with build.sbt configured to load the appropriate version.
All 629 Scala 2.13 tests pass. Scala 3 tests require additional specs2 5.x matcher syntax refinements for full compatibility. This follows the proven pattern established in lift-webkit.