sneumann / Rdisop

This is the git repository matching the Bioconductor package Rdisop: Decomposition of Isotopic Patterns
4 stars 7 forks source link

Rdisop modifies 'library' during R CMD check #10

Open sneumann opened 6 years ago

sneumann commented 6 years ago
Hi developers, Several Bioconductor packages have been flagged 
as modifying 'library' during R CMD check. Thanks to Tomas Kalibera 
for identifying these.
...
3) RUnit summary file:

RUnit has an option to output results to "unitTests/reportSummary.txt" which is written 
to the installation tree of a package. Because the output summarizes test results, 
which one presumably wants to see after the R process has ended, using tempdir() 
or tempfile() may not be appropriate. Possibly the file should be written 
to the .Rcheck directory. We aren't sure how to best handle this situation yet.
Tomas may have some guidance eventually.

See also thread https://stat.ethz.ch/pipermail/bioc-devel/2017-November/thread.html#12437

sneumann commented 6 years ago

Indeed it is the unit tests:

Last 13 lines of output:
  *********************************************** 
  Number of test functions: 10 
  Number of errors: 0 
  Number of failures: 0 

  1 Test Suite : 
  Rdisop unit testing - 10 test functions, 0 errors, 0 failures
  Error in file(file, ifelse(append, "a", "w")) : 
    cannot open the connection
  Calls: printTextProtocol -> cat -> file
  In addition: Warning message:
  In file(file, ifelse(append, "a", "w")) :
    cannot open file '/var/scratchro/tomas/QA/R-73707/lib/Rdisop/unitTests/reportSummary.txt': Read-only file system
Execution halted

see https://github.com/kalibera/rlibwrite/blob/master/Rdisop.out#L78 called from https://github.com/sneumann/Rdisop/blob/master/tests/doRUnit.R#L41

I'd like to ask @kalibera for help, do I just remove writing of the results ? Thanks in advance, yours, Steffen

kalibera commented 6 years ago

The outputs should be saved under the .Rcheck directory. The directory is given as part of fileName argument to printTextProtocol, invoked from the test launcher (e.g. doRUnit.R). The launcher also computes this directory. So could you just use path <- file.path(getwd(), "unitTests") even under R CMD check?