EECOLOR / little-spec

MIT License
6 stars 2 forks source link

scalajs 0.6 #9

Open sLite opened 9 years ago

sLite commented 9 years ago

Hi,

Can you update to scalajs 0.6 and republish the artifacts?

Cheers

EECOLOR commented 9 years ago

It's a bit more involved than I thought. They have changed the complete structure of how testing is implemented. Theoretically it should be possible to now use the sbt for both jvm and scala.js, I however have no experience with that.

In the upcoming release I will most likely drop support for Scala.js since I am not using it myself anymore.

If anyone is interested in first creating / converting and later maintaining the Scala.js version I'm willing to keep it as part of the library.

Sorry for this disappointing message.

frgomes commented 9 years ago

I've evaluated some time ago some 4 or 5 simple test frameworks for ScalaJS.

I really liked little-spec but I've decided to use another framework exacly because little-spec is not integrated with SBT. In practice it means that it cannot integrate with IntelliJ as well.

With the upcoming release, I think this difficulty will be solved and I will give another try on little-spec.

I don't really see any need for special support for ScalaJS. Given that SBT and IDEs will support it, I don't see where special support for ScalaJS would be beneficial. Unless I'm very wrong about this matter...

Thanks

frgomes commented 9 years ago

Well... I've just found that I've already visited this subject before. See: https://github.com/EECOLOR/little-spec/issues/3

I'm now confused. Anyway... when you release a new version I will give another go.

EECOLOR commented 9 years ago

because little-spec is not integrated with SBT

I don't fully understand, do you mean it's not in the list of default test frameworks?

frgomes commented 9 years ago

I'm deeply sorry for the confusion... but I'm not sure about my statements. (ashamed face)

As far as I remember, sort of one year ago I've tried to use little-spec via SBT but I couldn't possibly because little-spec didn't implement TestFramework SBT (as far as I remember!).

If you'd like to see what I mean, I'm currently using http://github.com/cgta/otest which does. This way, I can simply do sbt test and it works with OTest as it would with ScalaTest, for example.

You can find one project of mine which employs OTest at https://github.com/frgomes/poc-scala-datanucleus/blob/master/build.sbt

I've created definitions for some small test frameworks, for example:

val littleSpecFramework : Seq[Setting[_]] =
  Seq(
    libraryDependencies += "org.qirx" %%% "little-spec" % Versions.`little-spec` % "test",
    testFrameworks += new TestFramework("org.qirx.littlespec.scalajs.TestFramework")
  )

val otestFramework : Seq[Setting[_]] =
  Seq(
    libraryDependencies += "biz.cgta" %% "otest-jvm" % "0.2.0" % "test",
    testFrameworks := Seq(new TestFramework("cgta.otest.runner.OtestSbtFramework"))
  )
EECOLOR commented 9 years ago

because little-spec didn't implement TestFramework SBT

It did from the first version

Note that in your example you have %%% instead of %% (where the last one should be used for the jvm (sbt) version)

sLite commented 9 years ago

I thing keeping little-spec for ScalaJS would be really nice. The testing landscape for ScalaJS is quite sparse and most of the existing (up to date) frameworks don't have matchers out of the box. I'm currently collaborating to get matchete to cross-compile to ScalaJS, which could pair up with utest or other assert driven frameworks. But there is still a bunch of reflection stuff that needs to be kicked out.

I think it would be a pity to drop ScalaJS support for a test framwork that has matcher support already built in and already is cross-compiling without reflection issues. I'm going to take a deeper look into little-spec when i got some time at hand and decide if i will take the duty to converting and maintaining the ScalaJS parts.

Any plans on when you going to continue working on the next version?

frgomes commented 9 years ago

Great! I think i've messed the SBT configuration with ScalaJS configuration back then. At that time I was focusing on ScalaJS, which is not the case at the moment. I've just changed my build.sbt and my test cases and it is working fine now under SBT. Thanks a lot! :-)

sLite commented 9 years ago

I've got the time to look into porting over to ScalaJS 0.6 today, and while i'm still a good chunk away from completing, i got the main parts cross-compiling. I left out extras-documentation so far and the Framework, Runner and Task needs some more loving too. I don't know how fast i can finish everything, but i'm pretty confident that i will succeed.

I'll keep you updated.

sLite commented 9 years ago

Hi,

I'm pretty much done with porting. Only 2 more tests are failing due to different Stacktraces on the JVM vs ScalaJS. Should be easy to fix.

Maybe you wanna take a look and tell me what you think so far: https://github.com/sourcy/little-spec/tree/scalajs-0_6-port

sLite commented 9 years ago

How is it going, do you have any feedback for me? :)

EECOLOR commented 9 years ago

I'm sorry, I did not have a chance to look at it

EECOLOR commented 9 years ago

That looks pretty awesome! It seems that the new scalajs approach allows for more compatibility.

I am going on vacation for the next few weeks, but after that I want to look at it in detail. There might be some subtleties regarding the build but I'm sure we can overcome those.

It looks very promising so far. Once you have a version that you think is good enough we should sit down for a chat and figure out how we can work together (coding guidelines, branching, pull-request, ...). I think we then can combine your version with some changes I need to make (see some of the issues) and release a new version.

Good job!

sLite commented 9 years ago

No problem :)

I'm pretty new to ScalaJS and Scala/SBT in general, so i'm happy for any input. I'll fix the remaining tests and try to do some cleanup when i have some time to spare, just drop a line when you are back.

Happy holidays! :)

sLite commented 8 years ago

Forgot to update you here, i got everything compiling and all tests running for JVM/JS on 2.10+2.11

If you want, please take a look. I messed up the distribution a bit, because i didn't know any better. The artifacts depend on the macro module which isn't distributed as it stands now.

But all the code is working now. If you want check out https://github.com/sourcy/little-spec/tree/scalajs-0_6-port

EECOLOR commented 8 years ago

I'll check it out as soon as I can, problem is that I the upcoming weekend and week are stuffed.

At first glance it seems like you did a great job! I hope I can find the time soon to integrate it.

In preparation for that, you could compare your changes with master and see if you can minimize the differences.

EECOLOR commented 8 years ago

I have started to work on it. To keep track of the progress I opened #11 which is based on your work. I will also try to integrate the other open issues into that one.

sLite commented 8 years ago

Hi, i'm sorry but im currently very busy with two other projects and didn't have any time to do any preparations... But if you have any questions please come back at me.