xitrum-framework / xitrum

Async and clustered Scala web framework and HTTP(S) server
http://xitrum-framework.github.io/
MIT License
446 stars 52 forks source link

Cannot mock any action related functionality without starting up akka #648

Closed everylifetechnologies closed 7 years ago

everylifetechnologies commented 7 years ago

For example when we are trying to mock session variables we have a method that is implicitly passed an action (or SessionEnv) to get the session out of but the mocked varient in our tests is just backed by a map. So we mock the implicit Action that is passed it but we cannot stop the implicit ExecutionContext in that action from starting up the ActorSystem. This means that our tests are very slow and also cannot be run in parallel.

Making the execution context lazy will mean it will not affect our tests when we mock action related behaviour.

everylifetechnologies commented 7 years ago

If a new version of Xitrum is released with this change it would speed up our development cycle! @ngocdaothanh

Ellzord commented 7 years ago

Any news?

ngocdaothanh commented 7 years ago

Sorry I forgot to reply.

I've merged your PR, thanks. I'll release a new Xitrum version today.

ngocdaothanh commented 7 years ago

Xitrum 3.28.4 has just been released: https://groups.google.com/forum/#!topic/xitrum-framework/h_wVEyAFKyc

Ellzord commented 7 years ago

@ngocdaothanh thanks!