Running ‘winpath.R’ [17s/159s]
Running the tests in ‘tests/winpath.R’ failed.
Complete output:
  > library(switchr)
  > ## if(getOption("repos")["CRAN"] == "@CRAN@")
  > ##     chooseCRANmirror(ind=1L)
  > graceful_inet(TRUE)
  [1] TRUE
  > checkUrlRoundtrip = function(pth) {
  +     pth = switchr:::normalizePath2(pth)
  +     furl = switchr:::makeFileURL(pth)
  +     pth2 = switchr:::fileFromFileURL(furl)
  +     if(pth != pth2)
  +         stop("Round trip result (", pth2, ") does not match original (", pth, ") when creating file URLs")
  + }
  > 
  > ## regression test to ensure that the roundtrip
  > ## between path and file url is working properly
  > checkUrlRoundtrip(getwd())
  > checkUrlRoundtrip(tempdir())
  > if(switchr:::isWindows())
  +     checkUrlRoundtrip("\\\\laptop\\My Documents\\")
  > 
  > ## regreossion test to ensure that package dependencies
  > ## are added to the dontunload list when a package
  > ## is specified
  > bef = switchrDontUnload()
  > af = switchrDontUnload("knitr")
  Switchr needs a default CRAN mirror set via R options. Using the cloud mirror. This happens only when no CRAN mirror is selected *and* the BiocInstaller package is not installed.
  > stopifnot(all(c("stringr", "stringi", "magrittr") %in% af))
  > 
  > 
  > ## regression test for unnecessary (and expensive)
  > ## lazy repo construction when install_packages
  > ## is passed urls for existing repos (the default
  > ## behavior).
  > tmplib = tempdir()
  > trace(lazyRepo, stop)
  Tracing function "lazyRepo" in environment <namespace:switchr>
  Warning: Tracing only in the namespace; to untrace you will need:
  untrace("lazyRepo", where = getNamespace("switchr"))
  [1] "lazyRepo"
  attr(,"package")
  [1] "switchr"
  > install_packages("switchr", repos = defaultRepos(), lib = tmplib)
  trying URL 'https://cloud.r-project.org/src/contrib/switchr_0.14.3.tar.gz'
  Content type 'application/x-gzip' length 729937 bytes (712 KB)
  ==================================================
  downloaded 712 KB
  
  * installing *source* package 'switchr' ...
  ** package 'switchr' successfully unpacked and MD5 sums checked
  ** using staged installation
  ** R
  ** inst
  ** byte-compile and prepare package for lazy loading
  ** help
  *** installing help indices
  ** building package indices
  ** installing vignettes
  ** testing if installed package can be loaded from temporary location
  ** testing if installed package can be loaded from final location
  ** testing if installed package keeps a record of temporary installation path
  * DONE (switchr)
  
  The downloaded source packages are in
  	'/home/hornik/tmp/scratch/RtmplwkWvm/downloaded_packages'
  character(0)
  > untrace("lazyRepo", where = getNamespace("switchr"))
  Untracing function "lazyRepo" in package "namespace:switchr"
  > 
  > ## regression test for DESCRIPTION annotation with dups in manifest
  > ## This fails on the CRAN build systems but works locally, so disabled
  > ## man = PkgManifest(name = c("fastdigest", "fastdigest"), type = "cran")
  > ## install_packages("fastdigest", man, lib = tmplib)
  > 
  > 
  > ## regression test for generating empty manifest df and empty manifest
  > mandf = ManifestRow()
  > stopifnot(nrow(mandf) == 0)
  > 
  > man = PkgManifest()
  > stopifnot(nrow(manifest_df(man)) == 0)
  > 
  > sman = SessionManifest(man)
  > stopifnot(nrow(manifest_df(sman)) == 0 && nrow(versions_df(sman)) == 0)
  > 
  > ## make sure bioc version stuff works
  > isFALSE = function(x) identical(x, FALSE)
  > thing = switchr:::develVers
  > if(!isFALSE(graceful_inet())) ## absent forced failure bioc urls shoould work...
  +     stopifnot(is(thing, "character"))
  > 
  > #stopifnot(nrow(available.packages(contrib.url(switchr:::highestBiocVers())))>0)
  > 
  > ## regression test for publishManifest
  > mantests = function(man) {
  +     tmpdir = tempdir()
  +     manfil = publishManifest(man, file.path(tmpdir, "sman.rman"))
  +     mantab = read.csv(manfil, comment.char="#")
  +     stopifnot(nrow(mantab) > 0)
  +     man2 = loadManifest(manfil)
  +     stopifnot(identical(man, man2))
  + }
  > 
  > 
  > ## this tests the ability to make a seedManifest
  > ## including looking up the types
  > sman = makeSeedMan()
  > man = manifest(sman)
  > mantests(sman)
  > mantests(man)
  > 
  > 
  > dir = file.path(tempdir(), "gittst")
  > if(!file.exists(dir))
  +     dir.create(dir)
  > 
  > pkgdir = normalizePath2(file.path(dir, "GRANBase"), mustWork = FALSE)
  > unlink(pkgdir, recursive=TRUE)
  > param= SwitchrParam(logfun = function(...) cat(paste(..., sep=" - "), "\n" ))
  > dfile = file.path(pkgdir, "DESCRIPTION")
  > 
  > 
  > test_ghupdate_dirty = function() {
  +     ghsource = makeSource("https://github.com/gmbecker/gRAN", type = "git", scm_auth=list(), branch = "master", name = "GRANBase")
  +     res = switchr:::inet_handlers(makePkgDir("GRANBase", ghsource, dir, FALSE, param = param))
  +     if(is(res, "error")) {
  +         message("skipping github update test due to connectivity issues")
  +         return(TRUE)
  +     }
  +  
  +     oldwd = getwd()
  +     on.exit(setwd(oldwd))
  +     setwd(pkgdir)
  +     oldD = readLines(dfile)
  +     
  +     writeLines("lol", con = dfile)
  +     newD = readLines(dfile)
  +     upd1 = switchr:::updateGit(pkgdir, ghsource, param)
  +     newD2 = readLines(dfile)
  +     if(newD != newD2)
  +         stop( "Local changes not preserved during updateGit call from within correct branch")
  +     system("git checkout -f DESCRIPTION")
  +     
  +     TRUE
  + }
  > 
  > 
  > test_ghupdate_branch = function() {
  +     ghsourcebr = makeSource("https://github.com/gmbecker/gRAN", type = "git", scm_auth=list(), branch = "API_refactor", name = "GRANBase")
  + 
  +     res = switchr:::inet_handlers(makePkgDir("GRANBase", ghsourcebr, dir, FALSE))
  +     if(is(res, "error")) {
  +         message("skipping github update test due to connectivity issues")
  +         return(TRUE)
  +     }
  + 
  +     oldwd = setwd(pkgdir)
  +     on.exit(setwd(oldwd))
  +     system2("git", args = c("checkout master"))
  +     
  +     upd2 = switchr:::updateGit(pkgdir, ghsourcebr, param)
  +     if(!upd2)
  +         stop("Update of source checkout when currently on different branch failed")
  +     system("git checkout master")
  +     oldD = readLines(dfile)
  +     writeLines("lol", con=dfile)
  +     upd3 = tryCatch(switchr:::updateGit(pkgdir, ghsourcebr, param), error = function(x) x)
  +     if(!is(upd3, "error"))
  +         stop("switchr did not throw an error non-current branch was updated with dirty wd")
  +     system("git checkout -f DESCRIPTION")
  +     TRUE
  + }
  >     
  > 
  >         
  >         
  > if(switchr:::haveGit()) {    
  +     ## with clean/non-existent directory
  +     test_ghupdate_dirty()
  +     
  +     ## updating existing directory
  +     test_ghupdate_dirty()
  + 
  +     test_ghupdate_branch()
  + 
  + }
  Cloning into 'GRANBase'...
  fatal: unable to access 'https://github.com/gmbecker/gRAN/': Failed to connect to github.com port 443: Connection timed out
  caught warning: simpleWarning in system(cmd, ...): running command ''git' clone https://github.com/gmbecker/gRAN GRANBase' had status 128
  
  GRANBase - Failed to clone package source using git command with arguments: clone - both GRANBase - Failed to clone package source using git command with arguments: https://github.com/gmbecker/gRAN - both GRANBase - Failed to clone package source using git command with arguments: GRANBase - both 
  GRANBase -  - error 
  Error in setwd(pkgdir) : cannot change working directory
  Calls: test_ghupdate_dirty -> setwd
  Execution halted