Open ccoffrin opened 6 years ago
Just to clarify, are you talking about testing the sampling / user program, or testing the actual Connection
object?
dimod
in v1.0
(stable release due soon) will provide a consistent sampling interface -- backend (local CPU sampler or remote QPU sampler) can easily be swapped (you would use dwave-micro-client-dimod
as a dwave-micro-client
wrapper for dimod
).
Our structural-imbalance-demo and circuit-fault-diagnosis-demo are already along those lines.
I am interested in writing CI tests for a user program which relies on several calls to the micro client. For example, consider how would one write tests for this code, https://github.com/lanl-ansi/dwisc?
Oh, I see. If wrapping the microclient
with dimod
is not an option, then a mock Connection
would be a good way to go. The other option you mention, a testing/sandbox environment would also be nice to have in the future.
So, yes, we could create a Connection
mock object for now to facilitate testing.
In a variety of cases, CI being a big one, one might not have access to a SAPI connection backend. In such cases what is the best practice for testing a code that leverages the classes provided here, Connection especially?
Would it be possible to provide a fairly well developed mock Connection for such tests? Another option would be to expose some of kind open-access backend.