Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive test coverage for the rJavaEnv package by introducing 10 new test files that cover various aspects of the package functionality, including Java installation, environment management, build environment configuration, and internal utilities.
Key Changes
- Added extensive unit tests with mocked dependencies to avoid network calls and system dependencies
- Introduced tests for
.onLoad, Java wrappers, Java management, environment configuration, and internal utilities - Updated RoxygenNote version from 7.3.2 to 7.3.3
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-onLoad.R | Tests for package initialization, verifying that .onLoad sets default options correctly |
| tests/testthat/test-java_wrappers.R | Tests for java_quick_install() and use_java() wrapper functions with mocked dependencies |
| tests/testthat/test-java_manage.R | Tests for java_list() and java_clear() functions covering different dispatching scenarios and user input handling |
| tests/testthat/test-java_env_unit.R | Unit tests for java_env_set() and java_env_unset() with comprehensive mocking of system calls |
| tests/testthat/test-java_env_linux.R | Platform-specific tests for Java environment setup on Linux systems |
| tests/testthat/test-java_build_env_extra.R | Additional tests for build environment management including .Rprofile manipulation |
| tests/testthat/test-java_build_env.R | Tests for java_build_env_set() covering session, project, and combined modes |
| tests/testthat/test-internal_utilities_version.R | Tests for Java version parsing and detection utilities with various version string formats |
| tests/testthat/test-internal_utilities_extra.R | Tests for URL loading and testing utilities |
| tests/testthat/test-internal_utilities.R | Tests for platform detection, consent management, and environment variable utilities |
| DESCRIPTION | Updates RoxygenNote version to 7.3.3 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Mock installed.packages to avoid rJava checks | ||
| local_mocked_bindings( | ||
| installed.packages = function(...) matrix(character(0), nrow=0, ncol=2), |
There was a problem hiding this comment.
Inconsistent spacing around = in function arguments. The rest of the codebase uses spaces around = (e.g., nrow = 0, ncol = 2 as seen in test-java_env_unit.R lines 13, 51, 87). This should be nrow = 0, ncol = 2 for consistency.
| installed.packages = function(...) matrix(character(0), nrow=0, ncol=2), | |
| installed.packages = function(...) matrix(character(0), nrow = 0, ncol = 2), |
| test_that("java_env_set_session warns if rJava is already loaded", { | ||
| # Mock installed.packages to say rJava is installed | ||
| local_mocked_bindings( | ||
| installed.packages = function() matrix(c("rJava"), dimnames=list(NULL, "Package")), |
There was a problem hiding this comment.
Inconsistent spacing around = in function arguments. The rest of the codebase uses spaces around = (e.g., nrow = 0, ncol = 2 as seen in test-java_env_unit.R). This should be dimnames = list(NULL, "Package") for consistency.
| installed.packages = function() matrix(c("rJava"), dimnames=list(NULL, "Package")), | |
| installed.packages = function() matrix(c("rJava"), dimnames = list(NULL, "Package")), |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
===========================================
+ Coverage 34.76% 65.40% +30.63%
===========================================
Files 15 15
Lines 1237 1237
===========================================
+ Hits 430 809 +379
+ Misses 807 428 -379 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…d_env_set_rprofile
No description provided.