(v3.0.1.9114) Fix errors without cli and on R 3.0, and make the tinytest pipeline actually run the unit tests

Package:
- stop_() called cli::ansi_has_hyperlink_support() before checking that cli is available, so without cli every error became "there is no package called 'cli'"
- interpretive_rules() failed on R 3.0 for guidelines without AmpC rules (assignment to zero rows)
- Guard the ggplot2 example of wisca_plot()

CI:
- check-old: R 3.0 could not install tinytest over HTTPS, so no unit tests ran; install it with curl, and fail when tinytest is missing or any test fails
- tinytest shim: record expectations in the test file environment, support skips and errors per test_that() block, add missing testthat equivalents, source helper files
- Add R 4.0 (oldrel-6) to check-old, and oldrel-5 to check-recent
This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-10-10 14:54:15 +02:00
1 parent f0699c6584
commit 9e609dae83
13 files changed
+68 -32

No files matched your search

+13 -9
View File
@@ -48,7 +48,9 @@ jobs:
config:
# Test all old versions of R >= 3.0, we support them all!
# For these old versions, dependencies and vignettes will not be checked.
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R releases).
# For recent R versions, see check-current-testthat.yaml (r-lib and tidyverse support the latest 5 major R releases).
# R 4.0 (oldrel-6) is tested here, since current testthat and its dependencies cannot be installed on it.
- {os: ubuntu-latest, r: '4.0', allowfail: false}
# - {os: ubuntu-latest, r: '3.6', allowfail: false}
# - {os: windows-latest, r: '3.5', allowfail: false} # always fails, horrible with UTF-8
# - {os: ubuntu-latest, r: '3.4', allowfail: false} # 3.1-3.4 now always fails with Error in grep(warn_re, lines, invert = TRUE, value = TRUE) attempt to set index 46/46 in SET_STRING_ELT
@@ -76,15 +78,17 @@ jobs:
- uses: r-lib/actions/setup-pandoc@v2
- name: Install suggested pkgs (and tinytest) from CRAN
- name: Install tinytest from CRAN
# R < 3.2 cannot download over HTTPS, so install.packages() fails silently on CRAN;
# download the source with curl instead (suggested packages require much newer R versions anyway)
run: |
desc_lines <- readLines('DESCRIPTION')
suggests <- readLines('DESCRIPTION')[grepl("^(Suggests:| )", readLines('DESCRIPTION'))]
suggests <- suggests[(which(grepl("^Suggests", suggests)) + 1):length(suggests)]
suggests <- gsub("[ ,]", "", suggests)
pkgs <- unique(c(suggests, "tinytest"))
for (p in pkgs) try(install.packages(p, repos = "https://cran.r-project.org"), silent = TRUE)
shell: Rscript {0}
set -euo pipefail
mkdir -p "$R_LIBS_USER"
pkg=$(curl -sSL https://cran.r-project.org/src/contrib/ | grep -oE 'tinytest_[0-9.-]+\.tar\.gz' | head -1)
curl -sSLo "/tmp/$pkg" "https://cran.r-project.org/src/contrib/$pkg"
R CMD INSTALL -l "$R_LIBS_USER" "/tmp/$pkg"
Rscript -e "library(tinytest, lib.loc = Sys.getenv('R_LIBS_USER'))"
shell: bash
- name: Show session info
if: always()