-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix bug in validate_inputs
#793
Merged
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c154c7c
add check on enabled status
3001afc
apply code review
69cafc1
add unit tests
9feaacd
more review
ea1400b
improve unit tests
7942d18
apply review
8b1bc91
fix unit tests
c8f8e29
upgrade `validate_inputs` function (#796)
chlebowa 0e64eb5
Merge branch 'main' into fix_validate_inputs@main
chlebowa 913ece1
apply code review
0247c66
amend unit tests
477cf58
update pkgdown
83fb7c3
tweak docs
be43336
more unit tests
c523feb
fix unit tests following changes in teal.slice
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a WARN from teal.logger here? an R warning may be a bit too much - but I'll let you decide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably should stick to just one logging channel. Either use the built-in R messages and warnings or use the logger solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning is that logger outputs can be piped to a file without R warnings. If someone was to do it, would they care about this warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teal.logger
it is then. Any advice on how to write unit tests for it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked this issue here and situation is not that simple for me, so let me know if you have some solution or a strong opinion about how to handle this situation:
It's not straightforward how to test modules which return warnings through the
logger
.options(TEAL.LOG_LEVEL)
+capture_output
in tests doesn't seem to be optimal solution. I've checked there is no function in thelogger
to "convert" logger-conditions into the exceptions.With @chlebowa we tried to find the way to temporary (for tests) turn logger entries into R errors, warnings, messages and it's also not so easy neither. Currently, it's possible to do access
level
andmsg
in layout_teal_glue_generator viaregister_logger
which would have to be called once again especially for tests.Alternative solution (not for today) is to use
logger::log_errors
,logger::log_warnings
and change alllogger::log_warn
in teal packages to genericwarning
. How would it work then? -log_errors
useswithGlobalCallingHandlers
and intercept errors (their messages) and append them into logger. Our modules then can work normally withwarning
,stop
and they could be appended into logger if one addslogger::log_errors
on top of theapp.R
file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is not a trivial issue, I have modified the tests to test console output as a temporary measure.