daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.

Home Page:https://daqana.github.io/tikzDevice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test "Output regression check" fails

karldw opened this issue · comments

When I clone the repo and try to run the tests, I get a bunch of messages about "Output regression check" failing at this line. Here's the first one:

> devtools::test()
Loading tikzDevice
Ghostscript:  /usr/bin/gs 
compare:  /usr/bin/compare-im6.q16 
convert:  /usr/bin/convert-im6.q16 
Testing tikzDevice| OK F W S | Context| 13       | Test tikzDevice error and warning messages [1.7 s]
✖ |  2 1 1   | Draw a circle and some simple text [3.7 s]
────────────────────────────────────────────────────────────────────────────────
helper_graphics.R:65: warning: Output regression check
NAs introduced by coercion

helper_graphics.R:65: error: Output regression check
missing value where TRUE/FALSE needed
1: eval(bquote(expect_lt(compare_graph(.(short_name), tags), .(fuzz) + 0.1))) at tests/testthat/helper_graphics.R:65
2: eval(bquote(expect_lt(compare_graph(.(short_name), tags), .(fuzz) + 0.1)))
3: expect_lt(compare_graph("hello_TeX", tags), 0 + 0.1)
4: expect_compare("<", act, exp)
5: expect(op(diff, 0), sprintf("%s is %s %s. Difference: %.3g", act$lab, msg, exp$lab, 
       diff))
6: as.expectation.logical(ok, failure_message, info = info, srcref = srcref)

Trimmed session info:

package     * version date       lib source  
devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.1)
rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1)
testthat    * 2.0.1   2018-10-13 [1] CRAN (R 3.5.1)
tikzDevice  * 0.12.2  2018-11-13 [?] Github (daqana/tikzDevice@d93d010)

Hello @karldw, thanks for reporting. We are aware of this issue and currently working on updating the tests. Unfortunately, we have no ETA for this.
Adding a colorspace argument to compare_cmd seems to fix this issue:

shQuote(compare_cmd), "-density 300", "-metric AE",

If I put it like this, it works:

shQuote(compare_cmd), "-colorspace Gray -density 300", "-metric AE",

Probably the tests still won't run without errors after that (too large differences between compare file and test output) which seems to be related to the used ggplot2 versions. If you're interested in this, a PR is very welcome. :)

Good to know, and thanks for the quick response! I also don't have time to fix this in the near-term, but I'll keep it in mind.