Skip to content

Commit b344a64

Browse files
authored
fix CRAN NOTE about files in temp directory (#349)
1 parent d6aa8a0 commit b344a64

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.ci/r_tests_windows.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $env:_R_CHECK_EXAMPLE_TIMING_THRESHOLD_ = 30
3131
# see: https://stackoverflow.com/a/63837547/8302386
3232
$env:_R_CHECK_SYSTEM_CLOCK_ = 0
3333

34-
$R_VER = "4.1.0"
34+
$R_VER = "4.1.1"
3535
$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
3636
Invoke-WebRequest -Uri https://cloud.r-project.org/bin/windows/base/old/$R_VER/R-$R_VER-win.exe -OutFile R-win.exe -MaximumRetryCount 5
3737
Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH\R /COMPONENTS=main,x64" ; Check-Output $?
@@ -50,6 +50,7 @@ Invoke-WebRequest -Uri https://sourceforge.net/projects/qpdf/files/qpdf/10.3.1/q
5050
Copy-Item .\qpdf -Destination $env:R_LIB_PATH -Recurse
5151

5252
initexmf --set-config-value [MPM]AutoInstall=1
53+
$env:MIKTEX_EXCEPTION_PATH = "$env:TEMP\miktex"
5354

5455
cd "$env:GITHUB_WORKSPACE\R-package"
5556
Add-Content .Renviron "R_LIBS=$env:R_LIB_PATH"

R-package/tests/testthat/setup.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ y_MULTIclass = sample(1:5, 100, replace = TRUE)
4141

4242
set.seed(6)
4343
W = runif(100)
44+
45+
# Temporary I/O structures
46+
47+
# default directory where the temporary 'rgf' files are saved
48+
#------------------------------------------------------------
49+
50+
default_dir = file.path(dirname(tempdir()), 'rgf')
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
context("teardown")
2+
3+
# remove temporary 'rgf' files
4+
if (dir.exists(default_dir)) unlink(default_dir, recursive = TRUE, force = TRUE)

R-package/tests/testthat/test-RGF_package.R

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,6 @@ testthat::test_that("the 'cleanup' method (ESTIMATOR specific) works as expected
466466
skip_test_if_no_python()
467467
skip_test_if_no_module("rgf.sklearn")
468468

469-
#--------------------------------------------------------------------------------
470-
# default directory where the temporary 'rgf' files are saved
471-
472-
default_dir = file.path(dirname(tempdir()), 'rgf')
473-
474469
#--------------------------------------------------------------------------------
475470
# RGF
476471

@@ -515,11 +510,6 @@ testthat::test_that("the 'cleanup' method (APPLIES TO ALL ESTIMATORS) works as e
515510
skip_test_if_no_python()
516511
skip_test_if_no_module("rgf.sklearn")
517512

518-
#--------------------------------------------------------------------------------
519-
# default directory where the temporary 'rgf' files are saved
520-
521-
default_dir = file.path(dirname(tempdir()), 'rgf')
522-
523513
#--------------------------------------------------------------------------------
524514
# RGF
525515

@@ -549,4 +539,3 @@ testthat::test_that("the 'cleanup' method (APPLIES TO ALL ESTIMATORS) works as e
549539
testthat::expect_true( init_exists_upd_rgf && (init_num_files_rgf > 0) && (init_num_files_fastrgf > init_num_files_rgf) &&
550540
( init_num_files_rgf > length(lst_files_tmp) && init_num_files_fastrgf > length(lst_files_tmp_end_state) ) ) # normally, both initial and end state must have the same length [ length(lst_files_tmp) == length(lst_files_tmp_end_state) ]
551541
})
552-

0 commit comments

Comments
 (0)