Skip to content

Commit 8fc994e

Browse files
committed
prep for release
1 parent eb2411f commit 8fc994e

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: rotor
33
Title: Log Rotation and Conditional Backups
4-
Version: 0.3.2
4+
Version: 0.3.3
55
Authors@R:
66
person(given = "Stefan",
77
family = "Fleck",
@@ -27,6 +27,7 @@ Suggests:
2727
rmarkdown,
2828
testthat,
2929
uuid,
30+
ulid,
3031
zip
3132
Encoding: UTF-8
3233
LazyData: true

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# rotor 0.3.2
22

3+
* Hotfix for some tests related to the `Cache` R6 class that fail on systems
4+
with low-precision file system timestamps (such as ext3 and old Windows
5+
file systems)
6+
7+
8+
# rotor 0.3.2
9+
310
* fixes time zone related issue in `Cache$prune()`.
411
* fixes bug in `rotate_rds(on_change_only = TRUE)` that occurs if a version
512
of data.table < 1.3.0 is installed and either the source or target object are a

cran-comments.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010

1111
0 errors | 0 warnings | 0 notes
1212

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

17-
My current theory is that the error is caused by the accuracy of the
18-
'mtime' filestamp, which is linked to the file system the machine uses.
19-
I implemented a workaround under that assumption, but I cannot be 100% sure
20-
that this fixes that error. If the error still persists... could you please
21-
inform me which file system you use on r-release-macos-x86_64?
17+
Added a test that mocks low-precision filesystem-timestamps to be on the safe
18+
side.

man/Cache.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_Cache.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ test_that("setting hash functions work", {
6060
expect_identical(cache_hash$n, 0L)
6161

6262

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

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

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

99100

100101

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

0 commit comments

Comments
 (0)