Skip to content

Improve unit tests, add integration tests, and raise coverage to 83%#60

Merged
ehrlinger merged 3 commits into
mainfrom
copilot_refactor
Mar 4, 2026
Merged

Improve unit tests, add integration tests, and raise coverage to 83%#60
ehrlinger merged 3 commits into
mainfrom
copilot_refactor

Conversation

@ehrlinger
Copy link
Copy Markdown
Owner

Overall coverage: 62.36% → 83.33% (+21pp)

New test files:

  • test_gg_partial.R: unit tests for gg_partial + integration tests for gg_partial_rfsrc (0% → 100% / 96.61%)
  • test_gg_partialpro.R: unit tests for gg_partialpro with mock VarPro data (0% → 100%)
  • test_varpro_feature_names.R: unit tests for one-hot suffix decoding (0% → 100%)
  • test_surv_partial.R: integration tests for surv_partial.rfsrc (0% → 100%)
  • test_ggrandomforests_news.R: smoke tests for ggrandomforests.news (0% → 100%)

Expanded existing tests:

  • test_gg_rfsrc.R: add 14 survival tests covering per-observation curves, conf.int, by grouping, surv_type variants (chf/mortality), bs.sample, two-element level_set, and all plot.gg_rfsrc branches (gg_rfsrc.R: 30% → 75%, plot.gg_rfsrc.R: 34% → 73%)
  • test_gg_variable.R: add survival plots (single/multi-time, panel), regression categorical x, points/smooth=FALSE branches, missing-xvar path (plot.gg_variable.R: 51% → 76%, gg_variable.R: 78% → 82%)

Also fix .Rbuildignore to suppress R CMD check NOTE about hidden directories (.claude, .git, .vscode).

Overall coverage: 62.36% → 83.33% (+21pp)

New test files:
- test_gg_partial.R: unit tests for gg_partial + integration tests for
  gg_partial_rfsrc (0% → 100% / 96.61%)
- test_gg_partialpro.R: unit tests for gg_partialpro with mock VarPro
  data (0% → 100%)
- test_varpro_feature_names.R: unit tests for one-hot suffix decoding
  (0% → 100%)
- test_surv_partial.R: integration tests for surv_partial.rfsrc
  (0% → 100%)
- test_ggrandomforests_news.R: smoke tests for ggrandomforests.news
  (0% → 100%)

Expanded existing tests:
- test_gg_rfsrc.R: add 14 survival tests covering per-observation
  curves, conf.int, by grouping, surv_type variants (chf/mortality),
  bs.sample, two-element level_set, and all plot.gg_rfsrc branches
  (gg_rfsrc.R: 30% → 75%, plot.gg_rfsrc.R: 34% → 73%)
- test_gg_variable.R: add survival plots (single/multi-time, panel),
  regression categorical x, points/smooth=FALSE branches, missing-xvar
  path (plot.gg_variable.R: 51% → 76%, gg_variable.R: 78% → 82%)

Also fix .Rbuildignore to suppress R CMD check NOTE about hidden
directories (.claude, .git, .vscode).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.26%. Comparing base (4b1abcd) to head (ec215ca).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #60       +/-   ##
===========================================
+ Coverage   62.36%   83.26%   +20.90%     
===========================================
  Files          23       23               
  Lines        1812     1805        -7     
===========================================
+ Hits         1130     1503      +373     
+ Misses        682      302      -380     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…test coverage

- Updated `plot.gg_roc` to handle multi-class ROC plots and added AUC annotations.
- Refined `plot.gg_variable` to support panel plots for continuous and categorical predictors, including survival analysis.
- Enhanced `plot.gg_vimp` to visualize variable importance with improved color coding for positive and negative values.
- Improved `quantile_pts` function to handle missing values and ensure valid interval creation.
- Enhanced `varpro_feature_names` to recover original variable names from one-hot encoded features.
- Added new test files for `gg_partial`, `gg_partialpro`, and `varpro_feature_names`, expanding coverage to 83.33%.
- Documented changes and improvements in MEMORY.md for better project tracking.
@ehrlinger ehrlinger merged commit 8840ed1 into main Mar 4, 2026
16 checks passed
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

Successfully merging this pull request may close these issues.

1 participant