rnabioco / djvdj

An R package to analyze single-cell V(D)J data
https://rnabioco.github.io/djvdj
Other
23 stars 4 forks source link

trim tests #123

Open jayhesselberth opened 1 year ago

jayhesselberth commented 1 year ago

Ideally the test suite would finish in less than a minute. Right now it's > 5 minutes:

==> devtools::test()

ℹ Testing djvdj
✔ | F W S  OK | Context
✔ |       122 | calc-diversity [6.0s]                                                                                                                                               
✔ |        36 | calc-frequency [0.8s]                                                                                                                                               
✔ |       430 | calc-gene-usage [7.3s]                                                                                                                                              
✖ | 3     365 | calc-similarity [25.6s]                                                                                                                                             
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Failure (test-calc-similarity.R:91): sim calc chord
`res` (`actual`) not identical to `test_res` (`expected`).

  `actual$x1`: 0.5397079622967205 0.0000000000000000
`expected$x1`: 0.5397079622967201 0.0000000000000000

Failure (test-calc-similarity.R:91): sim calc geodesic_metric
`res` (`actual`) not identical to `test_res` (`expected`).

  `actual$x1`: 0.5464827671313257 0.0000000000000000
`expected$x1`: 0.5464827671313253 0.0000000000000000

Failure (test-calc-similarity.R:91): sim calc hellinger
`res` (`actual`) not identical to `test_res` (`expected`).

  `actual$x1`: 1.1330865483097790 0.0000000000000000
`expected$x1`: 1.1330865483097783 0.0000000000000000
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ |       224 | cluster-seqs [124.6s]                                                                                                                                               
✔ |        20 | filter-vdj [0.8s]                                                                                                                                                   
✖ | 1       0 | import-vdj                                                                                                                                                          
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error (test-import-vdj.R:28): (code run outside of `test_that()`)
Error in `eval(code, test_env)`: object 'tiny_so' not found
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ |        54 | mutate-vdj [1.3s]                                                                                                                                                   
✔ |       4512 | plots [189.4s]                                                                                                                                                     
✔ |        51 | utils [2.3s]                                                                                                                                                        

══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 358.1 s

[ FAIL 4 | WARN 0 | SKIP 0 | PASS 5814 ]
sheridar commented 1 year ago

Agreed, testing for the plotting functions is not ideal right now. For a lot of functions, all combinations of arguments get checked and if the function returns a ggplot2 object with no error messages, the test passes. Would be good to use vdiffr.