daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
249 stars 38 forks source link

unit-test for shiny fails with infos, not errors #132

Closed r2evans closed 4 months ago

r2evans commented 8 months ago

Not sure if something in my config is breaking the unit-test presumptions or similar, but when I run devtools::test(..) on the current (9947980c0515bfcbf97a18d3d3322b728d3cae5a) state of the package, I fail with:

── Failed tests ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Failure (test-CRANSKIP-hooks.R:65:5): shiny input initialization is detected with different log-level
`obs` does not match "ERROR \\[[0-9: \\-]+\\] Default Shiny inputs initialized".
Actual value: "INFO \[2023-11-20 09:27:01\] Loading required package: shiny\\nLoading required package: shiny\\nINFO \[2023-11-20 09:27:01\] Default Shiny inputs initialized: \{\}"
Backtrace:
    ▆
 1. └─testthat::expect_match(obs, exp) at test-CRANSKIP-hooks.R:65:4
 2.   └─testthat:::expect_match_(...)

This is a fresh R-4.3.1 instance.

daroczig commented 4 months ago

The related test seems to be running OK both on my computer and in GH Actions as well, so I suspect this might be something in your local setup. Could you please try to reproduce with vanilla R and reopen?