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
feat: value class support #633
Conversation
agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/ValueClassSupport.kt
Outdated
Show resolved
Hide resolved
agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/ValueClassSupport.kt
Outdated
Show resolved
Hide resolved
Looks like all the builds running on 1.3.72 and 1.4.30 are failing because maxOrNull has been introduced in 1.5.0. I'd like to maintain backwards compatibility with both of them for a little while now - and i think reverting the I know it gives a warning in 1.5 mentioning that apiVersion 1.3 is going to be removed, but I'd rather bear with the warning for now instead of breaking backwards compatibility. What do you think? |
I'll try this. However how to run test with api version 1.3 and the new |
Codecov Report
@@ Coverage Diff @@
## master #633 +/- ##
============================================
- Coverage 75.82% 75.33% -0.49%
+ Complexity 819 817 -2
============================================
Files 100 101 +1
Lines 2825 2846 +21
Branches 445 448 +3
============================================
+ Hits 2142 2144 +2
- Misses 503 522 +19
Partials 180 180
Continue to review full report at Codecov.
|
It's working. I've revered |
Thanks for this PR, I've been trying it out locally and it's working well, really hope this gets merged soon! 🙏 |
Any way to move this PR forward? Very hard to release projects based on Kotlin 1.5 without this 😅 |
It's currently still failing because the mockk-android module is lacking the ValueClassSupport class, which in turn is making a lot of tests fail. @qoomon, do you think we could move it to mockk-common, so that it is also visible to the android module? |
@Raibaz it is not that easy cause |
@Raibaz why is api(mockKProject, {
exclude group: 'io.mockk', module: 'mockk-agent-jvm'
}) |
It's excluded because android has its own agent. As a possible workaround for this, how about providing a dummy implementation of ValueClassSupport for mockk-android, that basically behaves as the polyfilled version for kotlin <1.5? This will not provide support for value classes in Android, but it would still allow us to merge this. What do you think? |
Sounds reasonable. Is there an easy way to test if it works without the need of a full android environment? |
I did some adjustments so it should work now, however I'm not sure if the changes within |
Thanks a lot for taking care of this! Unfortunately, Github requires manual approval for first-time contributors, so I have to manually trigger the builds which are, effectively, the fastest way to make sure everything works on Android. Sorry about this :( |
it seems all test are passing. :-D |
Thanks a lot again! |
@Raibaz when will you make new mockk release with this PR included? |
I have a couple of PRs pending that I'd like to merge to release them all together, hopefully by the end of this week or in the next week. |
@Raibaz any news on the release including this PR? |
ship it 🚀 |
Guys, if you wanna help you may use prebuilts via jitpack.io. I am doing so and just discovered an issue, see latest PR. These comment won't speed this up. |
With this change, I'm seeing unboxing enter an infinite loop (inside On Kotlin 1.5.10 with MockK 1.12.0 Opened issue: #656 |
No description provided.