rhub
rhub copied to clipboard
Set environment variable _R_CHECK_TESTS_NLINES_
See R internals. Otherwise the test output is truncated to the last 13 lines.
You can set arbitrary environment variables if you like:
rhub::check(..., env_vars = c(_R_CHECK_TESTS_NLINES_ = 100))
Also, the complete test output is available in the artifacts, e.g. https://artifacts.r-hub.io/pingr_1.1.2.9000.tar.gz-3c6d70a956944620868e127fef35e10e/pingr.Rcheck/
We could also propagate the local setting to rhub, if you think that's a better default.
I don't see a reason to stick to the arbitrary chosen 13 lines of output. I never caught myself thinking "oh, the output here is truncated so I don't see the error message ... how convenient!" ;)
For a service like r-hub, setting this env variable seems to me like the right thing to do.
You might want to set it to 1000
lines instead of 0
(which disables truncation) though to avoid packages flooding log files uncontrollably.
My only worry is that if we set it differently then the local and remote output will be different and that might surprise people.
But yeah, it is still better to set it higher... Will do.
Would this mean adding the env variable to lines like https://github.com/r-hub/rhub-server/blob/f87426e4e99e18bfb434852cf7e2c5c4d5c51919/backend/templates/job-macos.xml#L35 or somewhere else?
hereish: https://github.com/r-hub/macoscheck/blob/b9462271d6ba40a70b5b47149b962cfb5affd0c0/slave.sh#L17
- windows + solaris + linux
Anyone still working on this? Open for PRs?
BTW for the copy-pasters coming here, the invocation should be more accurately be:
rhub::check(env_vars = c(`_R_CHECK_TESTS_NLINES_` = '0'))
You can always see the full test output among the arfifacts. If we merge this, then the interactive output will potentially show hundreds or thousands of lines. I am not sure if that's ideal.
Maybe a more sensible default is something like _R_CHECK_TESTS_NLINES=100
or even 1000 then? I certainly think 13 is far too few...
Well, 13 is the default in base R, this env var is not set on R-hub by default. I think there is some value in keeping the default, so the output is the same on R-hub, as it is on a CRAN check or a local check.
SGTM. If you have an FAQ, maybe this would be a good addition at least, otherwise motivated folks like me can find this issue. I leave it to you whether to keep open/close. Thanks!
FWIW, I'm not sure that 13 is the default in base R. I'm running tests locally (Windows 10, R 4.1.0) and getting the full output of some print() statements. But on Rhub I only get the "last 13 lines". ::shrug::