circleci / bond

spying for tests
128 stars 28 forks source link

Thread-local variants of spy and stub #47

Closed mourjo closed 3 years ago

mourjo commented 5 years ago

with-stub and wih-spy functions alter the root of the Var of the function, through with-redefs, which makes this redefinition visible to all threads.

Now we provide local versions of with-stub and with-spy which function the same way as the normal versions but the changes are only visible to the currently running thread. Other threads see the original redefinitons or their own redefinitions.

This only works for threads which respect the Clojure per-thread bindings, and thus won't work for other concurrency primitives like java.lang.Thread.

This is for https://github.com/circleci/bond/issues/45

mourjo commented 5 years ago

Hi, @circleci any review/improvement on this? Would like to use these changes in a project 😊

mourjo commented 4 years ago

Hi, I was wondering if I could get some feedback on this? :)

mourjo commented 4 years ago

Hi, just a quick reminder if this could be reviewed, thanks!

mourjo commented 4 years ago

For anyone looking for this pull request to be merged, this has been released as [mourjo/bond "0.3.2.0.1.0"]

You can find the code here https://github.com/mourjo/bond/

neeasade commented 3 years ago

Hi @mourjo, thanks for your effort here. My team is planning to play more of an ownership role in support of this library in the future -- in the past it's not been owned by any specific team, a side effect of such being the unresponsive feedback loop you've experienced here.

We've decided not to go forward with this feature due to the introduced complexity/perceived maintenance burden on the library (as opposed to just using with-redefs/the current layout of bond). People interested may use your published fork instead.

mourjo commented 3 years ago

Alright, thanks for letting me know!