On 9/12/19 15:13, Pages, Herve wrote: > Hi Paul, > > On 9/12/19 11:47, Paul Shannon wrote: >> My package igvR requires a web browser. Unit tests, examples, vignette all >> will all fail if one is not available. >> >> Since the bioc build system, for good reason, does not provide a web >> browser, I’d like to condition all browser-related code on “not executing in >> the bioc build system”. > > AFAIK the build machines have web browsers.
Although that doesn't seem to be working on merida1: - From R: igv <- igvR() # attempting to open websocket connection on port 15000 # LSOpenURLsWithRole() failed with error -10810 for the URL http://localhost:15000. - From the terminal (in an ssh remote session): merida1:~ biocbuild$ open http://www.apple.com/ LSOpenURLsWithRole() failed with error -10810 for the URL http://www.apple.com/. merida1:~ biocbuild$ /Applications/Safari.app/Contents/MacOS/Safari Sep 12 18:54:20 Safari[98176] <Error>: Set a breakpoint at CGSLogError to catch errors as they are logged. Sep 12 18:54:20 Safari[98176] <Error>: This user is not allowed access to the window system right now. _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. I don't think Safari supports headless mode and we probably don't want to start the business of installing a headless browser on El Capitan. However things seem to work as expected on the Linux builders: library(igvR) igv <- igvR() # attempting to open websocket connection on port 15000 # BrowserViz websocket ready after 1.20 seconds ping(igv) # [1] "pong" Didn't try this on Windows though. Would a test based on the detected OS (e.g. Sys.info()[["sysname"]] != "Darwin") would be good enough for now to decide whether to run the tests and examples? Not ideal but still better than using interactive() or disabling all testing and examples on our build machines. H. > > Anyway if for some reason you need to disable the code that relies on a > web browser, wouldn't it make more sense to condition this code on the > presence of a web browser? > > Cheers, > H. > >> >> Is there a way my test and example code can detect that? >> >> I prefer not to condition on >> >> if(interactive()) >> >> because in some settings (travis CI, my own development setup) >> non-interactive tests, using a possibly headless browser, do make sense. >> >> Thank you - >> >> - Paul >> _______________________________________________ >> Bioc-devel@r-project.org mailing list >> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=iEEUVO5v2amEngLM9wKOPLZ90l4CAu3luSqTBk10vwY&s=KvWmn10aFYkg7GYHvM-0QjJkquiJirXMWLSQtYlj0u0&e= >> > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fredhutch.org Phone: (206) 667-5791 Fax: (206) 667-1319 _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel