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
Kluent 2.0 Roadmap #75
Comments
If we want Kluent to be truly platform independent, can we split out the JVM specific dependencies into a new library called What you end up with is
We could go ahead and make the changes that you're outlining in PS: If you're looking for contributors/maintainers for future work, I'd be happy to help :) |
A few points I wanted to add:
|
Having put some more thought into this, can we rename I haven't worked on android in a while but if you're on a brand new project targeting newer devices, wouldn't you be able to use JVM 7/8 with newer versions of Kotlin? If that's true, wouldn't you be able to use What do you think @Egorand? |
I haven't written an Android app myself, but if there are some specific assertions we can add to make testing Android easier it could make |
@javatarz That's right, current tooling would allow you to use Java 8 features through desugaring, so theoretically a project that uses those features should be able to run @MarkusAmshove I like the idea. I guess we can go with both |
Project Structure
Where
|
I'm at the moment trying to rearrange the structure to match the KotlinConf-App and see how it works out :) |
@MarkusAmshove Nice! Kluent 2.0 can also go Beta until Kotlin 1.2 becomes stable |
Sure, beta is something we should aim for until stable ;-) I'm not sure how to do the unittests in the "common" project. All our tests are written with Spek (which I found a hint for that they'll support multi platform with 2.0), but the common project shouldn't have a dependency on Java. The way it should work (in my opinion) is that the concrete platform projects take the tests from common and run them under their platform, which would make sure that all tests pass on all platforms |
@MarkusAmshove have you tried running the tests from cli? IDE support may not be ideal at the moment, I think I had problems running common unit tests from IDE in one of multiplatform projects. |
I’ve tried it with gradle and the Spek tests, which didn’t work (which makes sense).
Haven’t tested with kotlin.test yet, because I’m scared I have to port all tests 😊
I’ll test it out tomorrow
|
Wonder if bintray has space for beta releases of some sort. It'd be nice to get a few builds out for us to try out on some of our projects where using a beta doesn't hurt :) |
I've figured out how to get the tests running. It is as @Egorand said, the common project uses This means we have to port all the common-lib tests 😨 Spek Milestones state that they "prepare" multiplatform support, maybe thats what we need for the common project Edit: I've opened an issue at Spek spekframework/spek#327 to get clarification if we need to port all tests or have to wait for Spek :) |
@javatarz it looks like they support it: https://www.jfrog.com/confluence/plugins/servlet/mobile?contentId=46108078#content/view/46108078 Might be interesting in the future to deploy a snapshot after master builds on travis |
Since 1.2 was just released I've decided to get the port far enough so that other people can atleast clone it. Branch kluentv2 (not kluent-2) now contains a gradle project with the multiplatform template of IntelliJ with Kotlin 1.2. I've disabled the JavaScript project at the moment in the root It now contains: kluent (root common project)
I've ported all Java specific stuff to the jvm project (DateTime and File) and kept everything else in the common project. I've also ported all Java specific tests to If you checkout the branch and run
you can open the test reports from the JVM project in
Which also shows the one testclass from the common project which runs assertions: Also we have no specific dependency on JUnit anymore (even in the jvm project, only as testCompile for our unittests), as @javatarz wanted :-) I think it should work really well in the future. There are a lot of tests to port still, but thankful multiplatform is still experimental as of Jetbrains :-) |
test reports will now be in
|
I've also got a native module running (with gradle) and pushed it into the branch. I'm also not sure what to do with the backtick methods at the moment. The support of backtick names from the Kotlin perspective is the following:
Another way than just dropping it would be to have a common-backtick module, which the target platform can depend on. |
Hi @MarkusAmshove re: mocking, I understand the decision to drop mocking support, as a user of your library can I suggest deprecating it as soon as possible after reaching a decision? I work in a big team and it would help us keep using mockito-kotlin consistently. Even better would be to export mocking support to a separate library to avoid the confusion with mockito-kotlin completely until you kill it. If someone wants to upgrade before 2.0, they'd have to pull in an extra dependency. |
Hi @Rosomack , Mocking will have to be dropped in 2.0, as it wouldn't be consistent between the libraries. Deprecating mocking before 2.0 is a good idea, it would make absolutely clear that the codebase won't be compatible with 2.0 and you'd have to go one version down (to get rid of the annoying deprecated warnings) or change your code (which I don't like, but I sadly don't see another option). Using Kluent pre 2.0 is absolutely fine though, since 2.0 is mainly to get all the platforms supported. What I'm not sure about is the backtick methods. We could also deprecate them and drop them in 2.0, but I think people are dependent on them. The deprecation version could introduce codefixes to convert your code to non-backtick versions. I'm also making sure that beside that stuff, everything else won't break when bumping up to 2.0, e.g. keeping packages and methods as they are now. When I'm sure about the backtick stuff, or have heard some more opinions on that topic, I can also get the 2.0 version to a preview, since the JVM stuff wouldn't change. |
Bump, haven't seen this go anywhere in a while. Are we waiting for a major kotlin release? |
At the moment I'm waiting for kotlin native to become a bit more mature. |
Considering the delay, does it make svense to split the release into 2 parts. Step 1, changes to the capabilities in terms of just the JVM (kluent 2.0). Step 2, support native/js (kluent 2.1/3). For the API changes we know are coming, we can make the breaking changes right now.. (in which case the step 2 can be kluent 2.1). If we're pushing the breaking changes to step 2, then step 2 will be kluent 3. Motivation: The thought, initially, behind the major bump was to split the test runner out of the testing framework. Native/JS support seems to be taking time and can be added later. |
What would work that way is having a common module and a jvm module for 2.0, but the jvm module would have a new name ( That would mean that we have to migrate all of our current tests from Spek to #96 and #73 should also be included (maybe in 1.x before), so we can just take the old codebase and split into modules and change the tests. |
Sounds like a potential branch/PR :) I'll see how I can work on some of this if you're around to review PRs in the April-early July time frame. |
You can have a look at the v2 branch, I essentially created a new project and copied over the old sources while separating out platform dependent code into the JVM module. I also converted some tests to kotlin.test to run them under native and JS (which works). |
I've added a PR #106 to track the current status. My plan for Android is to have a specific Android project. Is there any reason this project can't depend on the JVM project? Backticks are still a problem. |
I've released the first version that can be considered a huge goal torwards 2.0, which was built and released with the multiplatform setup. It is still 1.x, because the only change is the multiplatform thingy, but you can try it by including I would love if you could replace the current import with the new one stated above (with version 1.39) and get back here to tell me if anything is broken. |
I've just tried to upgrade to kluent 1.41 (from 1.38) in my Android project and it failed because kluent is now targeting 1.8. I'm using the kluent-android artifact. Is Android not supported anymore? How should I proceed? |
Thank you for reporting @hameno I think I missed something when changing the buildsystem, so that the Android artifact might target the wrong version. |
this wasn't present before, so thats most likely the issue. I'll add a conditional and publish an update |
You can try v1.42 now, this should solve your issue, if not please let me know! |
Thanks, that fixed it 👍 |
Thanks for confirming :) I'll close this issue because the multiplatform stuff is figured out. |
I'd like to open a discussion about what we should do and drop with the next major version of Kluent.
@javatarz did a lot of work to make Kluent independent of JUnit (and specific test runners in general), thanks for that!
During those PRs (#71 #72) we started a discussion about what we could do and what we could drop with the next major version.
I would love to have a lot of feedback and opinions here :)
We should atleast give @Egorand , @eburke56 , @javatarz, @guenhter and @goreRatzete a chance to state their opinions here 👍
Dropping support
Mocking
#73 Is already a proposal to drop the mocking features in Kluent. I do agree with @Egorand points and I think it fits into the "no opinion" discussion. If we don't want to force an opinion on a test runner, we also shouldn't do that on mocking. In the beginning of Kluent I started the mocking support with plain java Mockito which didn't work out really well. Later we transitioned to mockito-kotlin and kept our API backwards compatible, but it still doesn't feel great. Kluent doesn't support all kinds of features that a mocking framework is bringing in and it also led to a lot of confusion (#62).
I can see multiple ways of doing this. We could either deprecate mocking in the next 1.x version and drop it completely in 2.x, don't deprecate it (as in keep as it is) in 1.x and drop it in 2.x or also maintain it in 2.x.
Platform independence
Since Kotlin already supports other targets than the JVM (e.g. JavaScript) and more platforms are being worked on (Kotlin native) we could try to take this next major step to also be platform independent.
What that means is that we get rid of all external dependencies (e.g. JUnit) and only use builtin Kotlin functionality.
@javatarz already experimented this within #72 and could give some insights on this.
What we do need if we go into this direction is having tests builtin for each platform, to make sure we don't break anything.
Even if we can get rid of our Java dependencies, we still have dependencies on the Java library, because we do have assertions for
java.time.*
andjava.io.File
. I'm not sure if we can be completely platform independent (as in Kotlin platforms) with just maintaining one project.Having only one core artifact for the Kotlin stdlib and then platform specific assertions (dependent on the core artifact) for Java specific stuff, Android specific stuff and so on, aggregated into one Github organization, might be better in the future.
Android
I also see Android as a kind of another platform, because we are locked in Java 1.6 there. @eburke56 has already contributed logic into our buildsystem so that we can have a specific artifact for Android (e.g. no backtick names). I would definitely want to support Android further.
The text was updated successfully, but these errors were encountered: