Skip to content

Commit

Permalink
skip tests if old rotor version is found to get package to cran more …
Browse files Browse the repository at this point in the history
…quickly (should be changed to throw an error in the next lgr release)
  • Loading branch information
s-fleck committed Oct 17, 2020
1 parent b3cbb8f commit 79020eb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

0 errors | 0 warnings | 0 notes

fixes a significant performance regression
Major update (see NEWS.md). Fixes CRAN check errors that are due to a breaking
update in the companion-package rotor.
26 changes: 26 additions & 0 deletions tests/testthat/test_AppenderFileRotating.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ teardown({
})


assert_supported_rotor_version <- function(){ # TODO: change to throwing an error once rotor 0.3.0 is on CRAN
if (packageVersion("rotor") < "0.3.0")
skip("rotor < 0.3.0 is no longer supported")
}



# AppenderFileRotating -----------------------------------------------------

test_that("AppenderFileRotating: works as expected", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
app <- AppenderFileRotating$new(file = tf, size = "1tb")

Expand Down Expand Up @@ -72,6 +80,8 @@ test_that("AppenderFileRotating: works with different backup_dir", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
bu_dir <- file.path(td, "backups")

Expand Down Expand Up @@ -125,6 +135,9 @@ test_that("AppenderFileRotating: works with different backup_dir", {


test_that("AppenderFileRotating: `size` argument works as expected", {

assert_supported_rotor_version()

#setup
tf <- file.path(td, "test.log")
app <- AppenderFileRotating$new(file = tf)$set_size(-1)
Expand Down Expand Up @@ -154,6 +167,8 @@ test_that("AppenderFileRotatingDate: works as expected", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
app <- AppenderFileRotatingDate$new(file = tf, size = "1tb")
lg <-
Expand Down Expand Up @@ -214,6 +229,8 @@ test_that("AppenderFileRotatingDate: works with different backup_dir", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
bu_dir <- file.path(td, "backups")

Expand Down Expand Up @@ -256,6 +273,8 @@ test_that("AppenderFileRotatingDate: works with different backup_dir", {


test_that("AppenderFileRotatingDate: `size` and `age` arguments work as expected", {
assert_supported_rotor_version()

#setup
tf <- file.path(td, "test.log")
app <- AppenderFileRotatingDate$new(file = tf)$set_age(-1)
Expand Down Expand Up @@ -293,6 +312,8 @@ test_that("AppenderFileRotatingTime: works as expected", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
app <- AppenderFileRotatingTime$new(file = tf)
lg <-
Expand Down Expand Up @@ -339,6 +360,8 @@ test_that("AppenderFileRotatingTime: works with different backup_dir", {
if (!is_zipcmd_available())
skip("Test requires a workings system zip command")

assert_supported_rotor_version()

tf <- file.path(td, "test.log")
bu_dir <- file.path(td, "backups")

Expand Down Expand Up @@ -383,6 +406,9 @@ test_that("AppenderFileRotatingTime: works with different backup_dir", {


test_that("AppenderFileRotatingTime: `size` and `age` arguments work as expected", {



#setup
tf <- file.path(td, "test.log")
app <- AppenderFileRotatingTime$new(file = tf)$set_age(-1)
Expand Down

0 comments on commit 79020eb

Please sign in to comment.