bnprks / BPCells

Scaling Single Cell Analysis to Millions of Cells
https://bnprks.github.io/BPCells
Other
166 stars 17 forks source link

[r] Add randomized test to detect dimnames errors #120

Closed bnprks closed 2 months ago

bnprks commented 3 months ago

I thought I had found another dimnames bug recently, but it turns out it was already fixed in the current main branch. In the mean time, I had already written some randomized tests that will hopefully provide some extra test coverage against future dimnames regressions.

It is a little slow to run, so I've limited it to a number of randomized tests where there's an 80% detection rate on the old bug, which should take approximately 0.1 seconds.

immanuelazn commented 3 months ago

The logic looks intuitive and elegant. However I worry after running testthat numerous times that sometimes the debugging messages are not that useful. i.e. no information of which args were passed to a function etc. In this case, I think that may cause some pain when trying to isolate which specific operations are giving you issues, and randomized testing might further exacerbate this.

Understandably it is not hard to add in a few print statements if the tests do end up going wrong, but just sharing my two cents