-
Notifications
You must be signed in to change notification settings - Fork 14
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
Switch Mocking over to using Cassette #53
Comments
Hey, I'd be interested in helping out with this. Have you had any thoughts/designs? The simplest thing I can think of is defining a macro which wraps a test suite in an
would be equivalent roughly to
|
I like the idea of setting up test set that allows you to pass in a context. For the initial design I was planning on keeping I also was toying with some value-based dispatch which would allow us to make patches like |
Unfortunately, I don't have much free time to do this work at the moment and I expect I may get the time to do this work closer to December. |
That is what https://github.com/oxinabox/ExpectationStubs.jl (Which I have still not tested how well it mixes with Mocking.jl, or Cassette, having not gotten around to actually using either.) |
I am annoyed that it is not possible to do.
It might be able to be made to work, (My general finding is setting a custom testset actually never lets you do anything much that is useful. The configuration points it makes available are not the ones you want to configure) |
I now have proof of concept code for this. It is only about 70 lines long, and is working. Major breaking change is that it isn't name based, it is value based. I think there might be a way to change that, but I am not 100% sure. |
It's about time I gave an update on this work. Back during the JuliaCon 2019 I reviewed #60 and did some experimentation with Cassette based Mocking. That experimentation led to #63 which cleaned up the code base significantly and made it easier to utilize Cassette. Unfortunately, my experimentation discovered that when exceptions are raised in overdub calls there is a significant performance penalty. My testing uses a branch called
Basically, there is a 3-4x reduction in performance when an exception is raised. This delay makes test driven development quite a bit more annoying especially when multiple exceptions are raised by the tests. At this point I could add optional support for Cassette in place but I would very much like to get the performance closer to that of using the |
It was mentioned to try using
Unfortunately the speed difference between |
Hmm, interesting. |
I apologize if I'm spamming, but this may be a good test case for SpecializeVarargs.jl if you apply something like One wrinkle is that |
Okay, SpecializeVarargs.jl now depends on ExprTools thanks to @omus and is tagged, so it should be useable for the Cassette branch now. |
Would make the new version of Mocking which uses Cassette only work on Julia 0.7. I expect this work to start once all the major Cassette issues are resolved around the Julia 0.7 release.
The text was updated successfully, but these errors were encountered: