-
-
Notifications
You must be signed in to change notification settings - Fork 49
Add comprehensive test coverage for teal_modifiers.R and init.R to improve package coverage #1623
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
Conversation
Hey @copilot , I just run the coverage locally and it is still low for overall package > library(covr)
> package_coverage()
teal Coverage: 52.17%
R/after.R: 0.00%
R/include_css_js.R: 0.00%
R/landing_popup_module.R: 0.00%
R/module_session_info.R: 0.00%
R/module_teal_lockfile.R: 0.00%
R/module_teal_with_splash.R: 0.00%
R/reporter_previewer_module.R: 0.00%
R/show_rcode_modal.R: 0.00%
R/tdata.R: 0.00%
R/TealAppDriver.R: 0.00%
R/module_bookmark_manager.R: 20.26%
R/zzz.R: 21.05%
R/module_snapshot_manager.R: 26.20%
R/init.R: 30.26%
R/validations.R: 36.21%
R/module_nested_tabs.R: 42.32%
R/module_teal_data.R: 48.99%
R/teal_modifiers.R: 56.34%
R/module_teal.R: 59.31%
R/module_source_code.R: 60.87%
R/module_teal_reporter.R: 71.93%
R/module_filter_manager.R: 75.55%
R/utils.R: 79.04%
R/modules.R: 81.79%
R/dummy_functions.R: 83.61%
R/module_data_summary.R: 92.66%
R/module_init_data.R: 92.86%
R/module_transform_data.R: 93.97%
R/module_filter_data.R: 95.31%
R/checkmate.R: 100.00%
R/teal_data_module-eval_code.R: 100.00%
R/teal_data_module-within.R: 100.00%
R/teal_data_module.R: 100.00%
R/teal_data_utils.R: 100.00%
R/teal_slices-store.R: 100.00%
R/teal_slices.R: 100.00%
R/teal_transform_module.R: 100.00%
R/validate_inputs.R: 100.00% |
@copilot can you focus on testing those files |
Co-authored-by: m7pr <[email protected]>
... I've added 11 more tests (47 total, up from 36) to improve coverage of
This should improve coverage from 56.34% closer to the 80% target. The changes are in commit 0d5e2e9. |
Co-authored-by: m7pr <[email protected]>
Working on improving coverage for the files shown in the screenshot. Started with:
Focusing on testing public functions and error paths that aren't currently covered. Will continue with other files on the list. |
Co-authored-by: m7pr <[email protected]>
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.
Key test is missing. After testing possible input values (assertions) and output (teal_app) now it is a time to test whether teal application is displaying these elements.
Instead of making "navigation-comments" like # modify_header
it would be better to use
testthat::describe("modify_header"{
testthat::it("when this happens returns that happens", {...})
})
I like the test description and how assertions are covered 👍
Hey @copilot nice work! The coverage is already at 64.60%! > package_coverage()
teal Coverage: 64.60%
R/after.R: 0.00%
R/landing_popup_module.R: 0.00%
R/module_teal_with_splash.R: 0.00%
R/reporter_previewer_module.R: 0.00%
R/show_rcode_modal.R: 0.00%
R/tdata.R: 0.00%
R/TealAppDriver.R: 0.00%
R/zzz.R: 21.05%
R/module_bookmark_manager.R: 23.53%
R/module_snapshot_manager.R: 28.41%
R/module_teal_lockfile.R: 29.01%
R/validations.R: 36.21%
R/module_teal_data.R: 48.99%
R/module_filter_manager.R: 78.17%
R/modules.R: 81.79%
R/utils.R: 83.16%
R/teal_modifiers.R: 84.51%
R/module_teal_reporter.R: 85.96%
R/module_teal.R: 88.24%
R/module_source_code.R: 89.86%
R/module_nested_tabs.R: 90.03%
R/init.R: 92.11%
R/module_init_data.R: 92.86%
R/module_data_summary.R: 93.79%
R/module_transform_data.R: 94.83%
R/dummy_functions.R: 96.72%
R/module_filter_data.R: 98.44%
R/checkmate.R: 100.00%
R/include_css_js.R: 100.00%
R/module_session_info.R: 100.00%
R/teal_data_module-eval_code.R: 100.00%
R/teal_data_module-within.R: 100.00%
R/teal_data_module.R: 100.00%
R/teal_data_utils.R: 100.00%
R/teal_slices-store.R: 100.00%
R/teal_slices.R: 100.00%
R/teal_transform_module.R: 100.00%
R/validate_inputs.R: 100.00% can you move on and continue on the rest of the files from this list and also have a look at this comment? #1623 (review) |
… UI tests Co-authored-by: m7pr <[email protected]>
Refactored tests to use
... Coverage improved to 64.60% - great progress! Refactored teal_modifiers tests with describe/it structure and added e2e UI tests (commit 8f94d66). Current status from the screenshot files:
Will continue with the remaining low-coverage files from the list. |
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.
Pretty good, but not there yet
@copilot |
@copilot can you have a look at this question #1623 (comment) |
…params Co-authored-by: m7pr <[email protected]>
Fixed the |
You're absolutely right - I was incorrectly passing a The correct approach makes sense: |
- fix failing main-tests - fix failing copilot tests
Unit Tests Summary 1 files 27 suites 2m 4s ⏱️ Results for commit 7946766. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit f9cf4ff ♻️ This comment has been updated with latest results. |
Code Coverage Summary
Diff against main
Results for commit: 7946766 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
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 will fix following teal.modules.* after this is merged
I just linked followup-PRs ⬆️ @vedhav do you mind to check changes in the |
id
arguments from modify_header and modify_footerUpdates
Code Review Fixes:
describe
block description for modify_title to be more descriptiveid
parameter frommodify_header
andmodify_footer
calls (these functions don't accept that parameter)#teal-header-content
,#teal-footer-content
) that match how teal actually structures the UIteal_app
object to passingdata
,modules
, and modifier parameters (title_args
,header
,footer
,landing_popup_args
) directly to constructorCoverage Status:
All e2e tests now correctly use TealAppDriver API and verify UI elements using the proper teal DOM structure.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.