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

[R-package] [ci] silence more logs in tests (fixes #4862) #5250

Merged
merged 1 commit into from
May 31, 2022

Conversation

jameslamb
Copy link
Collaborator

Fixes #4862.

This removes the last remaining log lines from the R tests (other than dots for test statuses).

As described in #5237 (comment), when LightGBM's C++ code calls Log::Fatal(), the same log message comes through stderr twice:

  1. as a log message printed with REprintf()
  2. as an R exception

image

I think it makes sense to have both, so that if user code try-catches {lightgbm} stuff, suppressing those exceptions, they'll still at least see a log message indicating that the exception happened.

This PR proposes just using capture.output() in the R package's tests to keep those logs out of the test output.

Copy link
Collaborator

@jmoralez jmoralez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I just ran this locally and see only the tests and their status

@jameslamb
Copy link
Collaborator Author

Great! Thanks for double-checking.

@jameslamb jameslamb merged commit 59f59c9 into master May 31, 2022
@jameslamb jameslamb deleted the r/test-verbosity branch May 31, 2022 01:43
@jameslamb jameslamb mentioned this pull request Oct 7, 2022
40 tasks
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[R-package] [tests] reduce verbosity in unit tests
2 participants