[TEST] Add some tests for remote extractors#95
Conversation
Yoric
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
We'll want to also add tests for backends, but one your MockSDK is in the tree, we can do that ourselves.
RolandMacDoland
left a comment
There was a problem hiding this comment.
LGTM. One point though that I've mentioned above, why not providing some base MockSDK from pasqal_cloud that we can customize for the needs of testing APIs that use it ? @Yoric @MatthieuMoreau0
|
@Yoric @RolandMacDoland I have made some changes to this MR. The scope has gone a bit beyond pure tests. Indeed as I was writing tests for this I realise that qek doesn't care so much about batches but only the job inside each batch. I slightly reworked the remote extractors class to account for that and store jobs instead of batches. This makes the code slightly simpler, imo. Let me know if that's ok for you. I have also updated the test structure. Now the the mock server simulates the execution of the jobs. Each time the get_job method is called, the progress of the job goes one step forward PENDING => RUNNING => DONE. This mimicks the async nature of the remote execution and makes sure qek properly waits for jobs to be done and for results to be available. Looking for feedback on this |
Yoric
left a comment
There was a problem hiding this comment.
Looks pretty nice, thanks!
|
@MatthieuMoreau0 So far, this looks good, plus the tests seem to pass, which helps :) What are the next steps? |
|
@Yoric I'll update my MR with your feedback. Once this is done I think this can be merged; this will provide basic coverage for remote backends nominal behaviour. Next steps would be:
|
d62d603 to
2af5417
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #95 +/- ##
==========================================
- Coverage 42.49% 39.91% -2.59%
==========================================
Files 16 17 +1
Lines 1106 1175 +69
Branches 132 136 +4
==========================================
- Hits 470 469 -1
- Misses 607 677 +70
Partials 29 29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adding some tests for the remote extractors as per the dedicated issue
This is a first draft, I'm not super happy with the current implementation which imo relies too heavily on mocks and hides a lot of details which could break scripts running qek on remote backends. However this is better than no tests at all and gives a first view on what tests for remote backends could look like.
I think the MockSDK class should be eventually moved to the pasqal-cloud repository so that it can be 1) maintained alongside the library whenever we make changes; 2) reused easily for all projects that rely on pasqal cloud and want to do some tests without calling the cloud services.
Anyways curious to see what you guys think.