proxy-wasm-go-sdk
proxy-wasm-go-sdk copied to clipboard
WIP: Allow overriding WasmResult of mocked foreign functions
I'd like to be able to generate better coverage of my foreign functions, but right now, the code limits you to an implicit "Ok" result. This prevents me testing some of the error paths behaviors in my WASM extensions.
This PR is an attempt to make that interface more generic. The problem I see is that I need a "WasmResult" type, but the only existing thing like that is internal.Status.....which is internal.
I've added an explicit WasmResult type, but with obvious downsides (internal.Status and types.WasmResult need to be in sync, otherwise things will get nasty).
I'm not 100% sure on the best path forward, but thought I'd open this PR to drive a discussion. I welcome feedback on better/alternate approches!
sorry @jamesmulcahy I will take a look at this within next 24 hrs..