From 7a56e41af329f0124fcc5b5b48578637530c480f Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Fri, 26 Apr 2024 12:39:32 -0400 Subject: [PATCH] Add tidyverse as a default package for the R tester (#512) --- Changelog.md | 1 + server/.dockerfiles/Dockerfile | 13 ++++++++++++- .../autotest_server/testers/r/lib/r_tester_setup.R | 9 +++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 83b5c202..d746537e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,7 @@ All notable changes to this project will be documented here. ## [unreleased] +- Add tidyverse as a default R tester package (#512) ## [v2.4.2] - Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) diff --git a/server/.dockerfiles/Dockerfile b/server/.dockerfiles/Dockerfile index 73a185ea..36884913 100644 --- a/server/.dockerfiles/Dockerfile +++ b/server/.dockerfiles/Dockerfile @@ -25,7 +25,16 @@ RUN apt-get update -y && \ postgresql-client \ libpq-dev \ sudo \ - git + git \ + libfontconfig1-dev \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libpng-dev \ + libtiff5-dev \ + libjpeg-dev \ + libharfbuzz-dev \ + libfribidi-dev \ + r-base RUN useradd -ms /bin/bash $LOGIN_USER && \ usermod -aG sudo $LOGIN_USER && \ @@ -45,6 +54,8 @@ RUN python3.11 -m venv /markus_venv && \ find /app/autotest_server/testers -name requirements.system -exec {} \; && \ rm -rf /app/* +RUN echo "TZ=$( cat /etc/timezone )" >> /etc/R/Renviron.site + RUN mkdir -p ${WORKSPACE} && chown ${LOGIN_USER} ${WORKSPACE} WORKDIR /home/${LOGIN_USER} diff --git a/server/autotest_server/testers/r/lib/r_tester_setup.R b/server/autotest_server/testers/r/lib/r_tester_setup.R index e5d8ab8f..4791a12c 100644 --- a/server/autotest_server/testers/r/lib/r_tester_setup.R +++ b/server/autotest_server/testers/r/lib/r_tester_setup.R @@ -12,7 +12,7 @@ library(remotes) main <- function() { # Tester dependencies # rjson v0.2.20 is required to support R v3.x - deps <- "testthat, rjson (== 0.2.20)" + deps <- "testthat, rjson (== 0.2.20), stringi, tidyverse" # Additional dependencies for test environment from command-line args args <- commandArgs(TRUE) @@ -53,7 +53,12 @@ install_dep <- function(row) { } else if (!is.na(version)) { install_version(name, version = paste(compare, version, sep =" ")) } else { - install.packages(name) + if (name == 'stringi') { + install.packages(name, configure.args="--disable-pkg-config") + } + else { + install.packages(name) + } } if (!(name %in% installed.packages())) {