R package checker ================= # Introduction --- R package checker is a tool to check if a new version of an R package (you might be developing) brakes any package which depends on it. It works with a Bash script and an optional simple web interface. It runs R CMD CHECK on every package that depends on the package to test. The execution of the R CMD CHECK can be parallelized by giving the corresponding option to the Bash script. XVFB is used to perform graphical actions even without being under a running X server. JQuery is used to present check results. There is basically three ways to use R package checker : * Call the Bash script directly, watch the output and read .Rout files * Call the Bash script directly with the --html option to produce a real-time html output including all .Rout outputs * Setup the Php files and adapt values in config.php to manage test launch and results viewing in the basic web interface ## Table of content --- 1. [Screenshots](#screenshots) 2. [Requirements](#requirements) 3. [Usage](#usage) 1. [Direct Bash call](#direct-bash-call) * without --html * with --html 2. [With the basic web interface](#with-the-basic-web-interface) # Screenshots --- Bash script output : ![screenshot bash](https://gitlab.com/eneiluj/r-package-checker/raw/master/screenshots/rcheck_bash.png) Simple web interface examples : ![screenshot web](https://gitlab.com/eneiluj/r-package-checker/raw/master/screenshots/rcheck_web.png) ![screenshot web problem](https://gitlab.com/eneiluj/r-package-checker/raw/master/screenshots/rcheck_web_problem.png) # Requirements --- * MANDATORY any version of R (results will be different from one version to another as R CMD CHECK results differ depending on R version...) * MANDATORY Xvfb * OPTIONAL Php enabled web server * Java is probably needed by one of the packages depending on the package to check * Many libraries are probably needed to install dependencies of package to test. If an INSTALL or a CHECK fails, it is quite easy to determine if it is due to a missing lib and which lib it is. # Usage --- ## Direct Bash call This is the simple way to use the R package checker. The script prints current steps in stdout and all R output files in the output directory (-d|--dest DESTINATION_DIRECTORY). Here are the script options : ``` rtest.sh PACKAGE_TO_TEST [-l|--libuser R_USER_LIB_VALUE] [-d|--dest DESTINATION_DIRECTORY] [-m|--mail MAIL_TO] [-u|--urlresult URL] [-r|--repo PACKAGE_TO_TEST_REPO] [-x | --xvfb XVFB-RUN PATH] [-n | --nbcores NBCORES] [-s | --skipinstall] [-h | --html] PACKAGE_TO_TEST : package to test -r | --repo PACKAGE_TO_TEST_REPO : repository of package you want to test (DEFAULT : R-CRAN) -l | --libuser R_LIBS_USER : directory where packages depending on PACKAGE_TO_TEST are going to be installed (DEFAULT : R will choose it) This directory can be used several times for several tests. Using same directory several times will save time. This directory can exist or not. If not, it will be created -d | --dest DESTINATION_DIRECTORY : result directory where HTML result and test files are produced (DEFAULT : ./check_PKGNAME_DATE) -m | --mail MAIL_TO : email address for real time user information (DEFAULT : NO MAIL WILL BE SENT) -u | --urlresult URL : if -m option was set, this http link to test results will be sent instead of a file path (DEFAULT : destination directory absolute path) -x | --xvfb PATH : Specific path to xvfb-run script (DEFAULT : 'xvfb-run') -n | --nbcores NBCORES : Number of cores for parallel executions of installations (Ncpu parameter) and number of simultaneous checks (DEFAULT : 1) -s | --skipinstall : flag to skip the packages update/installation -h | --html : generate html report in DESTINATION_DIRECTORY/index.html . Will download jquery in destination directory ``` ### without --html The script will not produce any fancy output. You'll have to find and read files to see the results of a check. If there is a failure, check in the output/destination directory to find the corresponding .Rout file. ### with --html Using the --html option, each step triggers the update of an html page located in the destination/output directory. This page contains the same information than the simple web interface but is static html which does not need Php and a webserver. ## With the basic web interface To setup and use the web interface you need to : * Copy view.php, start.php, config.php in a directory inside your web root * Adjust variables in config.php : ```php // name of the package to test $package_to_test = "mypkg"; // path to rtest bash script $rtest_location = "/home/user/rcheck/rtest.sh"; // where you want to install packages $rlib_location = "/home/user/Rlib_test"; //$email_addr = "Emmanuel.Paradis@univ-montp2.fr"; $email_addr = "your@email.address"; // path to xvfb-run $xvfbrun_location = "/home/user/xvfb-run"; // directory for all results directories // (where to put check results) $all_results_dir = "/home/user/rcheck_results/"; // repository to use to get last version of the package to test $package_to_test_repo = "http://my.pkg.repo.org/"; // number of threads used for parallel checking $nb_threads = 4; // base URL where you host the web interface // (will prefix start.php and view.php in links) $base_url = "http://my.server.org/r-package-checker/"; ``` * Visit http://your.server.org/rcheck/start.php to launch a check. * Follow the link given by start.php to view.php to see the real time check progress.