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

Fix to issue #182 #183

Merged
merged 1 commit into from
Sep 15, 2022
Merged

Fix to issue #182 #183

merged 1 commit into from
Sep 15, 2022

Conversation

Max-Bladen
Copy link
Collaborator

Within the helpers.R file for tests, added the .quiet() function which prevents any calls to cat() or print() within a function from being printed. Also set progressBar = FALSE where needed. Changed the seed with test_tune.spls.R such that the algorithm converged and didn't raise a warning.

This allows for a much cleaner output when running tests and prevents confusion when trying to debug an issue

@Max-Bladen Max-Bladen self-assigned this Mar 9, 2022
@Max-Bladen Max-Bladen requested a review from aljabadi March 9, 2022 02:03
@Max-Bladen Max-Bladen linked an issue Mar 9, 2022 that may be closed by this pull request
@Max-Bladen Max-Bladen added the bug-fix For PR's that address an Issue with `bug` label label Mar 9, 2022
@Max-Bladen Max-Bladen added the rapid-review for PRs which will take minimal time to review and close label Mar 29, 2022
Copy link
Collaborator

@aljabadi aljabadi left a comment

Choose a reason for hiding this comment

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

Thanks @Max-Bladen,
Verbosity in tests could be a good thing as this is a developer-facing matter and we need to see how every function call populates a console (or lack thereof). This also includes seeing the progress bars as this would be a good opportunity to detect any anomalies. Also, if we set (progressBar=FALSE) we are not testing that section of the code inside allif (progressBar == TRUE) clauses. I'm happy to see some stats on how this in fact be useful to merge this.

@Max-Bladen
Copy link
Collaborator Author

The main reason I pushed this fix was due to the inconsistency with which these outputs were shown. It was ambiguous where they were being produced from and caused formatting errors within the check logs, making resolving unrelated issues more time consuming. I am currently working on a large overhaul/expansion of the tests (PR #206) and will include these types of parameters as part of it

@Max-Bladen
Copy link
Collaborator Author

Max-Bladen commented Apr 10, 2022

Also, the printing output can be tested without it showing in the log which in my opinion would be preferable. Rather than setting progress = FALSE (as was done here for simplicity), the quiet() function (or something similar) can enclose an expect_ ...() call such that we can test for specific printed output while keeping the logs uncluttered

@aljabadi
Copy link
Collaborator

Looks good @Max-Bladen. Feel free to merge it once you're ready

@Max-Bladen Max-Bladen merged commit cf4f6a5 into master Sep 15, 2022
@Max-Bladen Max-Bladen deleted the issue-182 branch September 22, 2022 22:22
@Max-Bladen Max-Bladen removed the rapid-review for PRs which will take minimal time to review and close label Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix For PR's that address an Issue with `bug` label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extraneous output printed by testthat checks
2 participants