[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: R package CI test failures



I don't have permissions for debian-med, nor am I a DM/DD, so I'm afraid
I haven't committed any patches or uploaded them, but a couple should be
attached here.

>> r-bioc-biomart
>> --------------
>>
>> The test suite never succeeds, but fails at apparently random points
>> with malformed XML errors. Since it relies on internet access, I'm
>> guessing the connections don't work reliably from the autopkgtest
>> testbed. It consistently works locally, so it isn't the remote resource
>> failing.
>>
>> The tests may need removing (or at least, installing only for local use)
>> since they aren't very useful as CI.
> 
> A suggested patch (commited to SVN + team upload) would be great.

My suggested patch for this is just to rm debian/tests/control (so the
test is still installed for manual running, but won't be autopkgtested).
CI will have to make do with the autodep8 load test (which should
hopefully appear before too long - the relevant version of autodep8 (>=
0.5) is now in jessie-backports and will presumably make it to the CI
installation at some point.

>  
>> r-bioc-cummerbund
>> -----------------
>>
>> Both vignettes are patched (suppress_test_writing_to_usr.patch) removing
>> attempts to write to a readonly dir, but leaving subsequent code which
>> consequently fails (data hasn't been loaded).
>>
>> Possibly changing the patch to copy extdata from the installed package
>> and replace the `system.file` call with a local dir would let these run.
> 
> A suggested patch (commited to SVN + team upload) would be great.

Patch (git format-patch for the repository) is attached. It
suppress_test_writing_to_usr.patch, which removed some of the pre-amble
to each vignette with one which modifies the paths the vignettes check
for their data files. They should now build, but the example data has to
be copied to the pwd (run-unit-test has been updated to do this).

> 
>> r-bioc-genefilter
>> -----------------
>>
>> Two vignettes (independent_filtering{,_plots}.Rnw) require knitr
>> (unpackaged), not Stangle for compilation.
> 
> knitr is ITPed (#808155) but needs some dependencies itself.
>  
>> The test script can probably be changed to ignore them.
> 
> I'm temped to leave this open to come back to the needed package
> r-cran-knitr (which also rings a bell for other packages somehow).  To
> support this I committed to the packaging of r-cran-highr (#808808) as
> well as r-cran-markdown[1].  I pinged Joost van Baal-Ili to get this
> finished.
> 
>> r-bioc-genomicalignments
>> ------------------------
>>
>> I think this is a bug with the test from upstream.
>> test_readGAlignments.R :: test_read_GAlignments_BamViews creates a
>> temporary file, doesn't hold onto the file handle and then tries to read
>> it. Hence a race condition depending on whether R has yet
>> garbage-collected the reference and the file has consequently been
>> deleted first.
> 
> Hoping for upstream to respond to my first mail.  I might ping at
> end of the week with these more detailed information.

I'm now less certain this is exactly the cause - it's still somehow
related to a tempfile/tempdir race, but I misunderstood the semantics of
tempfile() so the above is probably not exactly correct.
>  
>> r-bioc-limma
>> ------------
>>
>> Compared stdout of the test script to a saved copy. It's probably
>> sufficient to just run the script and test the exit code, since this
>> seems to fail on trivial differences.
> 
> I might have a look.  Needs to be updated anyway.

Attached a replacement run-unit-test script which does this.

> 
>> r-bioc-shortread
>> ----------------
>>
>> A bug somehow related to the package's class system, but I haven't
>> managed to identify a cause.
> 
> I might ping upstream.

Error disappeared in 1.30.0

>> r-cran-doparallel
>> -----------------
>>
>> Uses R CMD BATCH instead of R --no-save < filename to run tests, so all
>> the output is hidden in the CI output. Doesn't copy the test files to a
>> temporary dir so when they try and create output it fails due to read-only.
> 
> (Hopefully) fixed in upload of new upstream version.
>  

Still appears present in 1.0.10. I think the test script needs to be
patched since it hardcodes an attempt to write a report to the directory
in which the package is installed. I'll try and write a patch for this.

In addition, a re-do of the r-bioc-snpstats run-unit-test is attached
(three vignettes should be blacklisted, but the current script only gets
two of them).



From 903a494144775a5ee68fd7550e3005dc96f7a749 Mon Sep 17 00:00:00 2001
From: Gordon Ball <gordon@chronitis.net>
Date: Tue, 10 May 2016 22:46:42 +0200
Subject: [PATCH] Alternate patch for vignettes allowing post-install building

---
 debian/patches/series                             |  2 +-
 debian/patches/suppress_test_writing_to_usr.patch | 76 -----------------------
 debian/patches/vignette-local-files.patch         | 31 +++++++++
 debian/tests/run-unit-test                        |  1 +
 4 files changed, 33 insertions(+), 77 deletions(-)
 delete mode 100644 debian/patches/suppress_test_writing_to_usr.patch
 create mode 100644 debian/patches/vignette-local-files.patch

diff --git a/debian/patches/series b/debian/patches/series
index c11d124..b6b4fdc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-suppress_test_writing_to_usr.patch
+vignette-local-files.patch
diff --git a/debian/patches/suppress_test_writing_to_usr.patch b/debian/patches/suppress_test_writing_to_usr.patch
deleted file mode 100644
index 5f7065b..0000000
--- a/debian/patches/suppress_test_writing_to_usr.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-Author: Andreas Tille <tille@debian.org>
-Last-Update: Wed, 22 Oct 2014 13:24:34 +0200
-Description: Since it is not allowed to write to /usr
- one part of the vignette was removed.  This avoids the following error:
- .
- .
- > cuff <- readCufflinks(dir = myDir, gtfFile = gtfFile, 
- +     genome = "hg19", rebuild = T)
- Creating database /usr/lib/R/site-library/cummeRbund/extdata/cuffData.db
- Error in sqliteNewConnection(drv, ...) : 
-   RS-DBI driver: (could not connect to dbname:
- unable to open database file
- )
- Calls: source ... .valueClassTest -> is -> is -> sqliteNewConnection -> .Call
- .
- .
- However, it needs to be verified whether the code that tries to create a
- database in /usr needs to be patched to redirect the database creation
- to /var.
-
---- a/vignettes/cummeRbund-example-workflow.Rnw
-+++ b/vignettes/cummeRbund-example-workflow.Rnw
-@@ -59,30 +59,6 @@ This guide is being released as is, with
- 
- \section{Workflow Summary}
- 
--\section{Reading cuffdiff output}
--<<loadLib>>=
--library(cummeRbund)
--@
--<<read>>=
--cuff <- readCufflinks(dir=system.file("extdata", package="cummeRbund"))
--cuff
--@
--This example uses the 'test' dataset that is included in the cummeRbund package. Importantly, if your current working directory contains the output
--from your cuffdiff analysis, simply calling \Rfunction{cuff<-readCufflinks()} will automatically find the default files and begin parsing your data.
--
--\section{Quality Assessment of data}
--
--\subsection{Evaluating model fit}
--<<model_fit_1,include=FALSE>>=
--d<-dispersionPlot(genes(cuff))
--d
--@
--
--<<label=model_fit_1_plot,fig=TRUE,echo=FALSE>>=
--<<model_fit_1>>
--print(d)
--@
--
- \subsection{Identifying outlier replicates}
- <<rep_boxplot_1,include=FALSE>>=
- pBoxRep<-csBoxplot(genes(cuff),replicates=T)
---- a/vignettes/cummeRbund-manual.Rnw
-+++ b/vignettes/cummeRbund-manual.Rnw
-@@ -248,19 +248,7 @@ To read these files, populate the 'cuffD
- library(cummeRbund)
- @
- %%fileDir<-("../../extdata/")
--<<read,echo=FALSE>>=
--myDir<-system.file("extdata", package="cummeRbund") #You can leave blank if cwd or replace with your own directory path.
--gtfFile<-system.file("extdata/chr1_snippet.gtf",package="cummeRbund") #path to .gtf file used in cuffdiff analysis.
--cuff <- readCufflinks(dir=myDir,gtfFile=gtfFile,genome="hg19",rebuild=T)
--@
--
--<<read2,eval=FALSE>>=
--cuff<-readCufflinks()
--@
--
--<<read3>>=
--cuff
--@
-+% DELETED
- 
- Again, by default $dir$ is assumed to be the current working directory and \code{cuff<-readCufflinks()} should work if all appropriate files are in the current working directory. We now also
- recommend that you use both the \Rfunarg{genome} and \Rfunarg{gtfFile} arguments to readCufflinks(). This will allow cummeRbund to archive the transcript structure information located in the .gtf file associated with
diff --git a/debian/patches/vignette-local-files.patch b/debian/patches/vignette-local-files.patch
new file mode 100644
index 0000000..51ced32
--- /dev/null
+++ b/debian/patches/vignette-local-files.patch
@@ -0,0 +1,31 @@
+Description: remove system.file calls in vignettes
+ The makes it possible to test-build the vignettes post-install without
+ them trying to write to the (read-only) library directory, but does
+ require that the extdata folder is copied to the pwd when trying to
+ build the vignettes.
+Author: Gordon Ball <gordon@chronitis.net>
+
+--- a/vignettes/cummeRbund-example-workflow.Rnw
++++ b/vignettes/cummeRbund-example-workflow.Rnw
+@@ -64,7 +64,7 @@
+ library(cummeRbund)
+ @
+ <<read>>=
+-cuff <- readCufflinks(dir=system.file("extdata", package="cummeRbund"))
++cuff <- readCufflinks("extdata")
+ cuff
+ @
+ This example uses the 'test' dataset that is included in the cummeRbund package. Importantly, if your current working directory contains the output
+--- a/vignettes/cummeRbund-manual.Rnw
++++ b/vignettes/cummeRbund-manual.Rnw
+@@ -249,8 +249,8 @@
+ @
+ %%fileDir<-("../../extdata/")
+ <<read,echo=FALSE>>=
+-myDir<-system.file("extdata", package="cummeRbund") #You can leave blank if cwd or replace with your own directory path.
+-gtfFile<-system.file("extdata/chr1_snippet.gtf",package="cummeRbund") #path to .gtf file used in cuffdiff analysis.
++myDir<-"extdata" #You can leave blank if cwd or replace with your own directory path.
++gtfFile<-"extdata/chr1_snippet.gtf" #path to .gtf file used in cuffdiff analysis.
+ cuff <- readCufflinks(dir=myDir,gtfFile=gtfFile,genome="hg19",rebuild=T)
+ @
+ 
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
index 23c37fa..fc4036b 100644
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -6,6 +6,7 @@ if [ "$ADTTMP" = "" ] ; then
   ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
 fi
 cd $ADTTMP
+cp -r /usr/lib/R/$oname/extdata $ADTTMP
 cp /usr/share/doc/$pkg/examples/vignettes/* $ADTTMP
 find . -name "*.gz" -exec gunzip \{\} \;
 for rnw in `ls *.[rRS]nw` ; do
-- 
2.7.4

#!/bin/sh -e

pkg=r-bioc-limma
if [ "$ADTTMP" = "" ] ; then
  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $ADTTMP
cp -a /usr/share/doc/${pkg}/tests/* $ADTTMP
gunzip -r *
for test in *.R
do
  LC_ALL=C R --no-save < ${test}
done
rm -f $ADTTMP/*

#!/bin/sh -e

biocname=snpStats
pkg=r-bioc-`echo $biocname | tr '[A-Z]' '[a-z]'`

if [ "$ADTTMP" = "" ] ; then
  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $ADTTMP
cp /usr/share/doc/$pkg/examples/vignettes/* $ADTTMP
find . -name "*.gz" -exec gunzip \{\} \;
export LC_ALL=C

for rnw in *.Rnw; do
    case "$rnw" in
        imputation-vignette.Rnw|ld-vignette.Rnw|snpStats-vignette.Rnw)
            echo "Vignette $rnw needs r-cran-hexbin (unpackaged)"
            ;;
        *)
            rfile=`basename $rnw nw`
            R --no-save <<EOT
                Stangle("$rnw")
                source("$rfile", echo=TRUE)
EOT
            ;;
    esac
done

Reply to: