Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print messages in tests breaks reporting #30

Open
katrinabrock opened this issue Aug 27, 2024 · 0 comments
Open

print messages in tests breaks reporting #30

katrinabrock opened this issue Aug 27, 2024 · 0 comments

Comments

@katrinabrock
Copy link

katrinabrock commented Aug 27, 2024

Summary

When there are print messages directly in the test_that statement, reporter does not successfully push test results to VSCode nor does this out appear in the output tab.

MRE

Run the tests found in this file:
https://github.com/katrinabrock/minimal-r-package/blob/340306dac9bb73386882f0e8554d28cf78b54d95/tests/testthat/test-output.R (note: not the most recent version)

Expected result

Results successfully recorded in test reporter:
image

Output tab contains:

Message #1
Message #2

Actual result

Tests appear in reporter as though they haven't run:
image
No output in output tab.

Note: R output looks like this:

> devtools::load_all('/home/TOP/kbrock/.vscode-server/extensions/meakbiyik.vscode-r-test-adapter-0.7.0/src/testthat/reporter')
ℹ Loading vscodereporter
> l<-testthat::test_file('/home/TOP/kbrock/minimal-r-package/tests/testthat/test-output.R', reporter=VSCodeReporter)
{"type":"start_reporter"}
{"type":"start_file","filename":"test-output.R"}
{"type":"start_test","test":"Output Test #1"}
[1] "Message #1"
{"type":"add_result","context":{},"test":"Output Test #1","result":"success","location":"test-output.R:4:3","filename":"test-output.R"}
{"type":"end_test","test":"Output Test #1"}
{"type":"start_test","test":"Output Test #2"}
[1] "Message #2"
{"type":"add_result","context":{},"test":"Output Test #2","result":"failure","location":"test-output.R:9:3","filename":"test-output.R","message":"FALSE is not TRUE\n\n`actual`:   \u001b[32mFALSE\u001b[39m\n`expected`: \u001b[32mTRUE\u001b[39m "}
{"type":"end_test","test":"Output Test #2"}
{"type":"end_file","filename":"test-output.R"}
{"type":"end_reporter"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant