Running 'test-configVariables.R' [174s]
  Running 'test-getFileNames.R' [158s]
  Running 'test-getIISLogFields.R' [3s]
  Running 'test-latexfunctions.R' [2s]
  Running 'test-logFileRead.R' [3s]
  Running 'test-pdfgeneration.R' [173s]
  Running 'test-plotfunctions.R' [161s]
  Running 'test-texfunctions.R' [2s]
  Running 'test-workingDirectory.R' [2s]
Running the tests in 'tests/test-configVariables.R' failed.
Complete output:
  > library(testthat)
  > library(WebAnalytics)
  Loading required package: ggplot2
  Loading required package: xtable
  Loading required package: data.table
  Loading required package: scales
  > library(fs)
  > 
  > # test commented out to meet CRAN requirement
  > 
  > # test_that("author name lookup with whoami minimally works", {
  > #   local_edition(3)
  > #   skip_on_cran()
  > #   skip_if_offline()
  > #   skip_if(Sys.info()["nodename"] != "ListiarMacBook2")
  > #   
  > #   libraryLocations=NULL
  > #   
  > #   print(.libPaths())
  > #   # fake the rstudio CRAN entry, the test runs without a value in options("repos").  
  > #   
  > #   n = "https://cran.rstudio.com/"
  > #   names(n) = "CRAN"
  > #   attr(n, "Rstudio") = TRUE
  > #   
  > #   origOptions = options(repos=n)
  > #   
  > #   if(require("whoami",quietly=TRUE))
  > #   {
  > #     libraryLocations = path.package("whoami")
  > #     libraryLocations = sub("(.*)/.*$","\\1",libraryLocations[1])
  > #   }
  > #   
  > #   if(!is.null(libraryLocations))
  > #   {
  > #     if(length(libraryLocations) > 1)
  > #     {
  > #       stop("multiple installs of whoami, too complicated to resolve, giving up")
  > #     }
  > #     detach("package:whoami",unload=TRUE)
  > #     remove.packages(c("whoami"), libraryLocations)
  > #   }
  > #   
  > #   wkdir = paste0(tempdir(),"/testpdf/")
  > #   workingDirectoryPopulate(wkdir)
  > #   
  > #   configVariablesLoad(paste0(wkdir,"/sample.config"))
  > #   authorNowhoami = configVariableGet("config.author")
  > #   
  > #   install.packages("whoami")
  > #   detach("package:WebAnalytics", unload=TRUE)
  > #   library("WebAnalytics")
  > #   library("whoami")
  > #   
  > #   configVariablesLoad(paste0(wkdir,"/sample.config"))
  > #   authorWithwhoami = configVariableGet("config.author")
  > #   
  > #   expect_match(authorNowhoami, "Author")
  > #   expect_match(authorWithwhoami, "Listiari Hunt")
  > # 
  > #   improbableAuthorName = "M V Llosa"
  > #   configVariableSet("config.author", improbableAuthorName)
  > #   expect_match(configVariableGet("config.author"), improbableAuthorName)  
  > # 
  > # 
  > #   unlink(wkdir,recursive=TRUE)
  > # 
  > #   if(is.null(libraryLocations))
  > #   {
  > #     remove.packages("whoami",lib=libraryLocations)
  > #   } else
  > #   {
  > #     install.packages("whoami",lib=libraryLocations)
  > #   }
  > #   options(origOptions)
  > # })
  > 
  > 
  > test_that("config default values are correct", {
  +   local_edition(3)
  + 
  +   wkdir = paste0(tempdir(),"/testpdf/")
  +   workingDirectoryPopulate(wkdir)
  +   
  +   detach("package:WebAnalytics", unload=TRUE)
  +   library("WebAnalytics")
  +   
  +   configVariablesLoad("variables.config")
  +   
  +   expect_equal(configVariableGet("config.generateGraphForTimeOver"), 10000)
  +   expect_equal(configVariableGet("config.generateServerSessionStats"), TRUE)
  +   expect_equal(configVariableGet("config.generatePercentileRankings"), FALSE)
  +   expect_equal(configVariableGet("config.readBaseline"), FALSE)
  +   expect_equal(configVariableGet("config.generateTransactionDetails"), TRUE)
  +   expect_equal(configVariableGet("config.generateDiagnosticPlots"), TRUE)
  +   expect_equal(configVariableGet("config.securityClass"), "Commercial-In-Confidence")
  +   expect_equal(configVariableGet("config.readBaseline"), FALSE)
  +   expect_equal(configVariableGet("config.useragent.generateFrequencies"), TRUE)
  +   expect_equal(configVariableGet("config.useragent.minimumPercentage"), 2)
  +   expect_equal(configVariableGet("config.useragent.maximumPercentile"), 96)
  +   expect_equal(configVariableGet("config.useragent.discardOther"), TRUE)
  +   
  +   unlink(wkdir,recursive=TRUE)
  + })
  [1] "file to be copied  makerpt.ps1"
  [1] "file to be copied  makerpt.sh"
  [1] "file to be copied  logo.eps"
  [1] "file to be copied  webanalytics.cls"
  [1] "file to be copied  sampleRfile.R"
  [1] "file to be copied  sample.config"
  Config Variables Set
  config.author CRAN
  config.current.columnList MSTimestamp             
  ignored: s-ip           
  httpop                  
  url                     
  ignored: cs-uri-query   
  ignored: s-port         
  ignored: cs-username    
  userip                  
  useragent               
  ignored: cs(Referer)    
  httpcode                
  ignored: sc-substatus   
  ignored: sc-win32-status
  elapsedms               
  config.current.dataDir .
  config.current.dirNames .
  config.documentName Subproject/Issue
  config.generateDiagnosticPlots TRUE
  config.generateGraphForTimeOver 10000
  config.generatePercentileRankings FALSE
  config.generateServerSessionStats TRUE
  config.generateTransactionDetails TRUE
  config.longurls.threshold 1000
  config.projectName Client/Project
  config.readBaseline FALSE
  config.securityClass Commercial-In-Confidence
  config.useragent.discardOther TRUE
  config.useragent.generateFrequencies TRUE
  config.useragent.maximumPercentile 96
  config.useragent.minimumPercentage 2
  Test passed 😸
  > 
  > test_that("minimum config file works", {
  +   local_edition(3)
  +   
  +   skip_on_cran()
  + 
  +   skip_on_os("windows")
  +   skip_on_os("linux")
  +   skip_on_os("solaris")
  +   
  +   wkdir = paste0(tempdir(),"/testpdf/")
  +   workingDirectoryPopulate(wkdir)
  +   fs::file_copy(paste0(getwd(), "/minimum.config"), paste0(wkdir,"/sample.config"),overwrite=TRUE)
  +   
  +   expect_snapshot(system(paste0("cd ", wkdir, "; ls; . ./makerpt.sh sample")))
  + 
  +   system(paste0("open ",wkdir, "*.pdf ; sleep 1"))
  +   unlink(wkdir,recursive=TRUE)
  + })
  ── Skip: minimum config file works ─────────────────────────────────────────────
  Reason: On Windows
  
  > 
  > proc.time()
     user  system elapsed 
     2.15    0.42    3.12 
Running the tests in 'tests/test-getFileNames.R' failed.
Complete output:
  > library(testthat)
  > library(WebAnalytics)
  Loading required package: ggplot2
  Loading required package: xtable
  Loading required package: data.table
  Loading required package: scales
  > 
  > test_that("all names must match requires get last file name", {
  +   expect_error(logFileNamesGet(allNamesMustMatch=TRUE, getLastFileName=FALSE), 'allNamesmustMatch=TRUE requires getLastFileName=TRUE')
  + })
  Test passed 🥳
  > test_that("data directory existence is checked", {
  +   expect_error(logFileNamesGet(dataDirectory="missing"), 'Cannot find directory')
  + })
  Test passed 😀
  > 
  > test_that("data directory existence is checked", {
  +   expect_error(logFileNamesGet(directoryNames=c("missing1","missing2")), 'Directory missing1 was not found under ')
  + })
  Test passed 😀
  > 
  > test_that("last log file is returned",{
  +           expect_equal(normalizePath(logFileNamesGetLast()), normalizePath(paste0(getwd(),"/u_getIISFields9.log")))
  +           })
  Test passed 🥇
  > 
  > test_that("all log files are returned",{
  +   expect_equal(normalizePath(logFileNamesGetAll()), normalizePath(c(paste0(getwd(),"/u_getIISFields1.log"),paste0(getwd(),"/u_getIISFields2.log"),
  +                                      paste0(getwd(),"/u_getIISFields3.log"),paste0(getwd(),"/u_getIISFields4.log"),
  +                                      paste0(getwd(),"/u_getIISFields5.log"),paste0(getwd(),"/u_getIISFields6.log"),
  +                                      paste0(getwd(),"/u_getIISFields7.log"),paste0(getwd(),"/u_getIISFields8.log"),
  +                                      paste0(getwd(),"/u_getIISFields9.log"))
  +                                      ))
  + })
  Test passed 😀
  > 
  > test_that("last matching files are returned",{
  +   expect_equal(normalizePath(logFileNamesGetLastMatching(directoryNames=c(".","."))), normalizePath(c(paste0(getwd(),"/u_getIISFields9.log"),paste0(getwd(),"/u_getIISFields9.log"))))
  + })
  Test passed 😀
  > 
  > proc.time()
     user  system elapsed 
     2.43    0.40    2.84 
Running the tests in 'tests/test-pdfgeneration.R' failed.
Complete output:
  > library(testthat)
  > library(WebAnalytics)
  Loading required package: ggplot2
  Loading required package: xtable
  Loading required package: data.table
  Loading required package: scales
  > library(fs)
  > 
  > test_that("pdf is generated from sample data", {
  +   local_edition(3)
  +   skip_on_cran()
  +   skip_on_os("mac")
  +   skip_on_os("linux")
  +   skip_on_os("solaris")
  +   skip_on_os("windows")
  +   wkdir = paste0(tempdir(),"/testpdf/")
  +   workingDirectoryPopulate(wkdir)
  +   file.copy("./minimum.config", wkdir)
  +   expect_snapshot(system(paste0("cmd /c cd ", wkdir, "& powershell -f makerpt.ps1 minimum")))
  +   pdfName = list.files(wkdir,pattern=".*\\.pdf")[[1]]
  +   if(isInteractive())
  +   {
  +     system(paste0("cmd /c start ",wkdir,pdfName))
  +   }
  +   unlink(wkdir,recursive=TRUE)
  + })
  ── Skip: pdf is generated from sample data ─────────────────────────────────────
  Reason: On Windows
  
  > 
  > test_that("pdf is generated using pdfGenerate", {
  +   local_edition(3)
  +   skip_on_cran()
  +   skip_on_os("mac")
  +   skip_on_os("linux")
  +   skip_on_os("solaris")
  +   skip_on_os("windows")
  +   wkdir = paste0(tempdir(),"/testpdf2/")
  +   workingDirectoryPopulate(wkdir)
  +   file.copy("./minimum.config", wkdir)
  +   expect_snapshot(pdfGenerate(workDir = wkdir,configFile="minimum.config"))
  +   pdfName = list.files(wkdir,pattern=".*\\.pdf")[[1]]
  +   if(isInteractive())
  +   {
  +     system(paste0("cmd /c start ",wkdir,pdfName))
  +   }
  +   unlink(wkdir,recursive=TRUE)
  + })
  ── Skip: pdf is generated using pdfGenerate ────────────────────────────────────
  Reason: On Windows
  
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.92    0.32    2.23 
Running the tests in 'tests/test-plotfunctions.R' failed.
Complete output:
  > library(testthat)
  > library(WebAnalytics)
  Loading required package: ggplot2
  Loading required package: xtable
  Loading required package: data.table
  Loading required package: scales
  > # 
  > test_that("saveGraph saves the right file names", {
  + # commented out to addresss cran limitations
  + #   skip_on_cran()
  + #   filesDir = paste0(tempdir(), "/", "testplotfunctions/")
  + #   dir.create(filesDir)
  + #   configVariableSet("config.workdir", filesDir)
  + #   fileName = "u_getIISFields5.log"
  + #   logFields = logFileFieldsGetIIS(fileName)
  + #   logrecs = logFileRead(fileName, columnList=logFields)
  + #   
  + #   #dir.create(configFilesDirectoryNameGet(),recursive=TRUE)
  + #   
  + #   filename = plotSave(plot(logrecs$elapsed, logrecs$ts), fileID = "x", fileType="jpg")
  + #   
  + #   expect_true(file.exists(filename))
  + # 
  + #   unlink(filename)
  + # 
  + #   filename = plotSave(plot(logrecs$elapsed, logrecs$ts), "y", "eps")
  + #   expect_true(file.exists(filename))
  + # 
  + #   unlink(filename)
  + #   #expect_error(plotSave(ggplot(data=logrecs)+aes(y=elapsed, x=posixtimes)+geom_point(), "z.eps"), "ggplot object passed to plotSave")
  + # 
  + #   qqqq = ggplot(data=logrecs)+aes(y=elapsed, x=ts)+geom_point()
  + #   expect_equal(length(logrecs$ts),59414)
  + #   
  + #   filename = plotSaveGG(qqqq, "z2","eps")
  + #   expect_true(file.exists(filename))
  + #   
  + #   unlink(filename)
  + })
  ── Skip: saveGraph saves the right file names ──────────────────────────────────
  Reason: empty test
  
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.75    0.37    2.11