metrumresearchgroup / pmforest

Create forest plots
https://metrumresearchgroup.github.io/pmforest
Other
2 stars 0 forks source link

Updating test refs, March 2022 #18

Closed seth127 closed 2 years ago

seth127 commented 2 years ago

Fixing two test issues described as "unrelated" in #17

The second one 'nsim-plot/multiple-simulations.svg' has changed is fixed by b332d5259cfb0f0db4132db996854a70d384a975

The first one SVG snapshot generated under a different vdiffr version. I can't replicate. I used pkgr install --update to get the latest version of everything that we pull from CRAN (and did see installed_version=1.0.2 pkg=vdiffr update_version=1.0.4) but I'm still not seeing the skip.

> devtools::test()
ℹ Loading pmforest
ℹ Testing pmforest
✓ | F W S  OK | Context
✓ |        22 | base-plot [10.5s]                                                                                                                          
✓ |         3 | input-data [0.2s]                                                                                                                          
✓ |         2 | nsim-plot [2.5s]                                                                                                                           
✓ |         5 | summary [1.0s]                                                                                                                             

══ Results ════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 14.2 s

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 32 ]
> packageVersion("vdiffr")
[1] ‘1.0.4’

I will say that that specific test is the only one to use a custom writer function, for saving out svg's of a non-standard size. It's not obvious to me why that would cause this, but it also seem unlikely to be a coincidence.

seth127 commented 2 years ago

Mainly interested in that first failure and if you're still seeing it. As mentioned above, I don't see it even after updating with CRAN. Any thoughts? Should we let it lie for now?

kyleam commented 2 years ago

The first one SVG snapshot generated under a different vdiffr version. I can't replicate [...] Mainly interested in that first failure and if you're still seeing it.

Hmm, I still see that. I just tried again (freshpkgr install run, executed on rstudio server):

> devtools::test()
ℹ Loading pmforest
ℹ Testing pmforest
✓ | F W S  OK | Context
✓ |     1  20 | base-plot [6.1s]
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Skip (test-base-plot.R:284:5): Base plots: Plot alignment with different saving to different sizes [PMF-PLOT-024]
Reason: SVG snapshot generated under a different vdiffr version.
Please update your snapshots.
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓ |         3 | input-data [0.1s]
✓ |         2 | nsim-plot [1.5s]
✓ |         5 | summary [0.6s]

══ Results ════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 8.2 s

── Skipped tests  ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• SVG snapshot generated under a different vdiffr version. (1)

[ FAIL 0 | WARN 0 | SKIP 1 | PASS 30 ]
Deleting unused snapshots:
• base-plot/full-test-big.svg

> packageVersion("vdiffr")
[1] ‘1.0.4’

> cat(processx::run("git", "status")$stdout)
HEAD detached at origin/test/fix-vdiffr-refs-2203
Changes not staged for commit:
    deleted:    tests/testthat/_snaps/base-plot/full-test-big.svg

Untracked files:
    tests/testthat/_snaps/base-plot/full-test-small.new.svg

no changes added to commit

> cat(processx::run("git", c("show", "--oneline", "-s"))$stdout)
b332d52 test: updating multiple-simulations.svg ref for changes small fix made in c18c9de69a46ace9a23fb505e11e888e6c0c5ebe