R Under development (unstable) (2023-10-03 r85259 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(testthat) > library(WebAnalytics) Loading required package: ggplot2 Loading required package: xtable Loading required package: data.table Loading required package: scales > > > test_that("expected record count is read",{ + # it appears that skip in cran is not working. If skip doesn't work, remove the test + skip() + expect_true(59414 == nrow(logFileRead("u_getIISFields5.log", columnList = logFileFieldsGetIIS("u_getIISFields5.log")))) + }) ── Skip: expected record count is read ───────────────────────────────────────── Reason: Skipping > > fullVarList = c("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") > > test_that("minimum columns",{ + # it appears that skip in cran is not working. If skip doesn't work, remove the test + skip() + #for(i in c(1,3,4,8,9,11,14)) + #{ + # expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(i)]),"specified column set does not include a timestamp: ApacheTimestamp or MSTimestamp") + #} + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(1)]),"specified column set does not include a timestamp: ApacheTimestamp or MSTimestamp") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(4)]),"specified column set does not include all of the minimum required columns: url missing") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(11)]),"specified column set does not include all of the minimum required columns: httpcode missing") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(14)]),"specified column set does not include a duration: elapsedms, elaspedus, elapseds") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(3)]),"colClasses= is an unnamed vector of types, length 14, but there are 15 columns") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(8)]),"colClasses= is an unnamed vector of types, length 14, but there are 15 columns") + expect_error(logFileRead("u_getIISFields5.log", columnList = fullVarList[-(9)]),"colClasses= is an unnamed vector of types, length 14, but there are 15 columns") + tempVarList = fullVarList + tempVarList[2] = "not a known variable" + expect_error(logFileRead("u_getIISFields5.log", columnList = tempVarList),"column name \"not a known variable\" is neither a defined column name nor begins with the text 'ignore'") + }) ── Skip: minimum columns ─────────────────────────────────────────────────────── Reason: Skipping > > test_that("dropping ignore columns",{ + # it appears that skip in cran is not working. If skip doesn't work, remove the test + skip() + # df = logFileRead("u_getIISFields5.log", columnList = fullVarList) + # expect_false(any(grepl("ignore.*", names(df)))) + }) ── Skip: dropping ignore columns ─────────────────────────────────────────────── Reason: Skipping > > test_that("report different column counts",{ + # it appears that skip in cran is not working. If skip doesn't work, remove the test + skip() + expect_warning(any(grepl("ignore.*", names(logFileRead("u_getIISFields9.log", columnList = fullVarList))))) + }) ── Skip: report different column counts ──────────────────────────────────────── Reason: Skipping > > proc.time() user system elapsed 2.12 0.45 2.56