Skip to content

Improve test coverage#29

Merged
e-kotov merged 3 commits intomainfrom
test-cov
Jan 16, 2026
Merged

Improve test coverage#29
e-kotov merged 3 commits intomainfrom
test-cov

Conversation

@e-kotov
Copy link
Copy Markdown
Owner

@e-kotov e-kotov commented Jan 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 14:34
@e-kotov e-kotov changed the title clean tests Improve test coverage Jan 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request focuses on cleaning up test code and making tests more robust. The changes include adding a global gridmaker.quiet = TRUE option for testing, refactoring memory estimation functions to avoid warnings when point_type is passed to non-point output types, improving terra options handling in raster streaming functions, reorganizing validation logic, and adding explicit quiet parameters to tests to ensure predictable behavior.

Changes:

  • Added global gridmaker.quiet = TRUE option in test setup and updated function signatures to use getOption("gridmaker.quiet", FALSE) as the default
  • Refactored memory estimation functions to conditionally add point_type argument only for sf_points output types to avoid spurious warnings
  • Improved terra options handling by filtering and safely restoring only specific options, and reordering validation checks in validate_disk_compatibility

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/testthat/setup.R Adds global gridmaker.quiet = TRUE option for cleaner test output
tests/testthat/test-write_to_disk.R Wraps message expectations with capture.output to suppress unwanted output during testing
tests/testthat/test-utils.R Adds new test coverage for utility functions (regex_match, memory estimation, disk validation)
tests/testthat/test-stream_grid_raster_parallel.R Adds new test coverage for parallel raster streaming with mirai
tests/testthat/test-parallel.R Adds explicit quiet = FALSE to tests that expect messages, removes duplicate comment
tests/testthat/test-inspire_grid.R Updates test to use quiet = TRUE for warning expectations and adds explicit quiet = FALSE where needed
tests/testthat/test-inspire_grid-raster-streaming.R Converts message expectations to use quiet = TRUE for cleaner test output
tests/testthat/test-write_to_disk_mirai.R Adds new comprehensive test coverage for mirai-based disk streaming
man/inspire_grid.Rd Updates documentation to reflect new default value for quiet parameter
R/utils.R Refactors memory estimation to conditionally pass point_type, reorders validation checks, and removes duplicate comments
R/stream_grid_raster_parallel.R Improves terra options handling by filtering and safely restoring options
R/stream_grid_raster.R Improves terra options handling by filtering and safely restoring options
R/inspire_grid_from_ids.R Updates default value for quiet parameter to use global option
R/inspire_grid.R Updates default value for quiet parameter to use global option across all methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/testthat/test-write_to_disk.R Outdated
Comment thread tests/testthat/test-parallel.R
Comment thread R/utils.R
Comment thread R/stream_grid_raster.R Outdated
Comment thread R/stream_grid_raster_parallel.R Outdated
@e-kotov e-kotov merged commit 944b015 into main Jan 16, 2026
11 checks passed
@e-kotov e-kotov deleted the test-cov branch January 16, 2026 15:13
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.

2 participants