thomasp85 / fiery

A flexible and lightweight web server
https://fiery.data-imaginist.com
Other
240 stars 12 forks source link

Test failure with upcoming version of later #40

Closed wch closed 4 years ago

wch commented 4 years ago

With the version of later that will be released soon, the following test fails:

https://github.com/thomasp85/fiery/blob/761a18d122bbd8bece3bb1847a25a5d097f4fd89/tests/testthat/test-Fire.R#L188-L193

This is because run_now() has changed: previously, if any errors/warnings/messages happened in a callback, they would pass all the way through to the caller of run_now(). In the new version of later, run_now uses R_TopLevelExec to invoke the callbacks, and errors/warnings/messages are not passed through R_TopLevelExec. (They will, however, still display at the console.)

You can install the upcoming version of later with:

devtools::install_github('r-lib/later@rc-v1.0.0')

I currently don't know of any way to capture the message generated by a callback invoked by run_now(), so I think your only recourse at this point may be to remove the test. If you can somehow move the expect_message() into the later callback, that would work. But your code may not be structured for that.

thomasp85 commented 4 years ago

Fixed now - I'll submit next week