-
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
Using Cassette #60
Using Cassette #60
Conversation
Right now this also breaks the ability to mock functions that are local variables, I think it is actually fixable, and I am just not fixing Binding's right. Related to this is the inability to mock functions that are declared as local variables. I can think of a way to mock things by name, but it involves overdubbing every single call. |
Other thing that is broken is the ability mock some calls but not others. Again, I don't think this should ever occur in the wild. This is fixible but from a unit-testing perspective I don't think it is useful |
FYI |
Other thing that is broken is the ability mock some calls but not others. Again, I don't think this should ever occur in the wild. This is fixible but from a unit-testing perspective I don't think it is useful |
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
=========================================
- Coverage 93.23% 86.84% -6.4%
=========================================
Files 4 6 +2
Lines 281 228 -53
=========================================
- Hits 262 198 -64
- Misses 19 30 +11
Continue to review full report at Codecov.
|
This should now be feature complete. The code is still pretty ugly, It also needs rebasing/squashing pretty badly too, I think. |
end | ||
return false | ||
# TODO: redefine this in terms of `methodswith(pe.ctx, Cassette.execute...)` | ||
# If required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omus is this method required?
Should I delete it,
or fix it?
The version I just pushed should have addressed all of @omus 's comments. |
We are doing nested overdubbing, though I imagine not more than 2 deep normally |
This needs to be updated to Cassette 0.2 |
I have upgraded the Cassette version |
I'm wondering if this would make Mocking a good solution to the issue of connection information with |
I wouldn't say Mocking is a nice way to do that, but using similar Cassette stuff could be, Probably better to discuss in FilePathBase.jl#36 about it. |
I'm getting serious about reviewing this during JuliaCon |
I spent a bunch of time experimenting with Cassette based Mocking. At the moment there seems to be some serious performance issues using Cassette for this use case. Additionally I found several techniques we and apply to the existing |
I'll close this PR as the integration with Cassette has significantly changed. The most recent update on this can be found here: #53 (comment) |
This follows the same user facing API,
except now
Mocking.enable
and@mock
are not required.And you can only mock names that are inscope.
This is because mocking is now by function, not function name.
Closes #53 and #16
As of right now this works for my simple manual tests,
but getting the test suite going will take a bit.
A lot of the stuff in
binding.jl
will need tinkering -- the things that need to be bound have kind of flipped, I think.Key point is that the actual mocking code is
@eval
ed into the Cassette namespace at global scope.Right now kwargs are not supported, see JuliaLabs/Cassette.jl#48
I think there is a workaround there.