curlconverter icon indicating copy to clipboard operation
curlconverter copied to clipboard

failing tests with clipr 0.2.1.9000

Open mdlincoln opened this issue 8 years ago • 2 comments

I've added more rigorous error checking to clipr - perviously it had silently failed to write to the clipboard on Linux systems where xclip/xsel was installed, but where the DISPLAY envvar was not configured to allow headless operation of xlip/xsel. This meant that casual tests to write to the clipboard would pass on CRAN, but would actually fail to write.

Because of this, devtools::revdep_check() now fails on curlconverter.

Package: curlconverter
Check: examples
New result: ERROR
  Running examples in ‘curlconverter-Ex.R’ failed
  The error most likely occurred in:

  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: make_req
  > ### Title: Turn parsed cURL command lines into 'httr' request functions
  > ### Aliases: make_req
  >
  > ### ** Examples
  >
  > library(httr)
  >
  > my_ip <- straighten("curl 'https://httpbin.org/ip'") %>% make_req()
  curl 'https://httpbin.org/ip'
  Error: Clipboard on X11 requires 'xclip' (recommended) or 'xsel'.

This is probably easily fixed with a judicious \dontrun{}. Along with this more rigorous error checking, I introduced a new function clipr_available() that will check whether the clipboard is write/readable. I've used this to skip() relevant tests on CRAN, which may also be of help to you.

mdlincoln avatar Nov 15 '16 17:11 mdlincoln

Thx, Matthew. I'll pebbly go the \dontrun{} path. :thumbsup: for both the notice and for the great package!

On Tue, Nov 15, 2016 at 12:00 PM, Matthew Lincoln [email protected] wrote:

I've added more rigorous error checking to clipr https://github.com/mdlincoln/clipr - perviously it had silently failed to write to the clipboard on Linux systems where xclip/xsel was installed, but where the DISPLAY envvar was not configured to allow headless operation of xlip/xsel. This meant that casual tests to write to the clipboard would pass on CRAN, but would actually fail to write.

Because of this, devtools::revdep_check() now fails on curlconverter.

Package: curlconverter Check: examples New result: ERROR Running examples in ‘curlconverter-Ex.R’ failed The error most likely occurred in:

base::assign(".ptime", proc.time(), pos = "CheckExEnv")

Name: make_req

Title: Turn parsed cURL command lines into 'httr' request functions

Aliases: make_req

** Examples

library(httr)

my_ip <- straighten("curl 'https://httpbin.org/ip'") %>% make_req() curl 'https://httpbin.org/ip' Error: Clipboard on X11 requires 'xclip' (recommended) or 'xsel'.

This is probably easily fixed with a judicious \dontrun{}. Along with this more rigorous error checking, I introduced a new function clipr_available() that will check whether the clipboard is write/readable. I've used this to skip() relevant tests on CRAN, which may also be of help to you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hrbrmstr/curlconverter/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfHtscqmEczVBXossTKY_SA1VpyUvPDks5q-eUpgaJpZM4KyxT9 .

hrbrmstr avatar Nov 15 '16 17:11 hrbrmstr

Cheers! Turns out cross-platform testing for the system clipboard is very difficult to do - otherwise I'd have caught this earlier.

mdlincoln avatar Nov 15 '16 17:11 mdlincoln