Skip to content

Commit

Permalink
Timestamp bugfix for tests for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
ryapric committed Feb 28, 2021
1 parent 8293ba3 commit 9db82a2
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
^.*\.Rproj$
^\.Rproj\.user$
.*\.tar\.gz$
^.*\.log$
^.*\.json$
^.*\.txt$
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Description:
systems (like containers). 'loggit' is ideal for Shiny apps, data pipelines,
modeling work flows, and more. Please see the vignettes for detailed example
use cases.
Version: 2.1.0.9999
Date: 2020-06-06
Version: 2.1.1
Date: 2021-02-27
Authors@R:
person(given = "Ryan",
family = "Price",
Expand All @@ -29,7 +29,7 @@ Suggests:
testthat (>= 2.0.0)
URL: https://github.com/ryapric/loggit
BugReports: https://github.com/ryapric/loggit/issues
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
PKGNAME = `sed -n "s/Package: *\([^ ]*\)/\1/p" DESCRIPTION`
PKGVERS = `sed -n "s/Version: *\([^ ]*\)/\1/p" DESCRIPTION`

SHELL := /usr/bin/env bash -euo pipefail


all: check

Expand All @@ -15,9 +17,6 @@ check: build
R CMD check --no-manual --as-cran $(PKGNAME)_$(PKGVERS).tar.gz

check-docker:
@if [ -z $(RVERSION) ]; then \
printf "Must set RVERSION env variable\n" && exit 1; \
fi
@sed 's/RVERSION/$(RVERSION)/' Dockerfile-test > Dockerfile
@docker build -t loggit:$(RVERSION) .
@docker run --rm -it loggit:$(RVERSION)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# loggit 2.1.1

This is a small bugfix release for CRAN's sake that fixes two tests that would
sporadically fail; they relied on timestamps being equivalent between `want` and
`got` invocations.

# loggit 2.1.0

- Add `sanitizer` argument to `loggit()`, and an `unsanitizer` argument to
Expand Down
6 changes: 4 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Test environments
* Local Manjaro Linux install, R 4.0.0
* Debian Stretch, R 3.6.3
* Local Ubuntu Linux install, R 4.0.4
* Debian Buster, R 4.0.3
* Debian Buster, R 3.6.3
* Debian Buster, R-devel
* CRAN win-builder-oldrelease
* CRAN win-builder-release
* CRAN win-builder-devel
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test_json.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ test_that("write_logs() and read_logs() work in tandem", {

log_df_got <- read_logs(get_logfile())

# jk, set timestamps equal, since CRAN tests started failing because of
# just-barely-different results
log_df_want$timestamp <- log_df_got$timestamp

expect_equal(log_df_want, log_df_got)
})
cleanup()
Expand Down Expand Up @@ -47,6 +51,10 @@ test_that("write_logs() and read_logs() work with disallowed JSON characters via
# for checking
log_df_got <- read_logs(unsanitizer = function(x) {x})

# jk, set timestamps equal, since CRAN tests started failing because of
# just-barely-different results
log_df_want$timestamp <- log_df_got$timestamp

expect_equal(log_df_want, log_df_got)
})
cleanup()
Expand Down

0 comments on commit 9db82a2

Please sign in to comment.