Skip to content

Commit

Permalink
prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fleck committed Oct 27, 2020
1 parent eb2411f commit 8fc994e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rotor
Title: Log Rotation and Conditional Backups
Version: 0.3.2
Version: 0.3.3
Authors@R:
person(given = "Stefan",
family = "Fleck",
Expand All @@ -27,6 +27,7 @@ Suggests:
rmarkdown,
testthat,
uuid,
ulid,
zip
Encoding: UTF-8
LazyData: true
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rotor 0.3.2

* Hotfix for some tests related to the `Cache` R6 class that fail on systems
with low-precision file system timestamps (such as ext3 and old Windows
file systems)


# rotor 0.3.2

* fixes time zone related issue in `Cache$prune()`.
* fixes bug in `rotate_rds(on_change_only = TRUE)` that occurs if a version
of data.table < 1.3.0 is installed and either the source or target object are a
Expand Down
13 changes: 5 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

0 errors | 0 warnings | 0 notes

Sorry for the many resubmissions. This package currently has an issue that
only to occur on macOS. It does not occur on the same macOS version available
on Rhub.
Another - hopefully final attempt - to fix a hard to debug issue where some
tests can fail on systems with low-precission filesystem-timestamps
(such as ext3 and old Windows filesystems).

My current theory is that the error is caused by the accuracy of the
'mtime' filestamp, which is linked to the file system the machine uses.
I implemented a workaround under that assumption, but I cannot be 100% sure
that this fixes that error. If the error still persists... could you please
inform me which file system you use on r-release-macos-x86_64?
Added a test that mocks low-precision filesystem-timestamps to be on the safe
side.
2 changes: 1 addition & 1 deletion man/Cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions tests/testthat/test_Cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ test_that("setting hash functions work", {
expect_identical(cache_hash$n, 0L)


# To override this behaviour use a generate for unique ids, such as
# To override this behaviour use a function that generates globally unique ids instead of hashes
cache_uid <- Cache$new(td, hashfun = function(x) ascending_id())
cache_uid$push(iris)
cache_uid$push(iris)
expect_identical(cache_hash$n, 2L)
cache_hash$purge()

# ensure hashfun allways returns a scalar
# fail if hashfun does not returns a scalar
cache_err <- Cache$new(td, hashfun = function(x) c(ascending_id(), ascending_id()))
expect_error(cache_err$push(iris), class = "ValueError")
})
Expand All @@ -86,6 +86,7 @@ test_that("pruning works by number of files works", {
k3 <- cache$push(cars)
expect_identical(cache$n, 3L)

# cached files are sorted in the order of their creation
expect_identical(cache$files$key[[1]], k1)
expect_identical(cache$files$key[[2]], k2)
expect_identical(cache$files$key[[3]], k3)
Expand All @@ -98,7 +99,7 @@ test_that("pruning works by number of files works", {



test_that("pruning works by number of files sorts by key if timestamp are identical", {
test_that("$files is ordered by key if timestamps are identical", {
td <- file.path(tempdir(), "cache-test")
on.exit(unlink(td, recursive = TRUE))

Expand Down

0 comments on commit 8fc994e

Please sign in to comment.