1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-24 18:46:14 +01:00

new setup unit tests

This commit is contained in:
dr. M.S. (Matthijs) Berends 2023-01-05 15:03:18 +01:00
parent a98d0d75ea
commit 51c0f0814e
5 changed files with 32 additions and 27 deletions

View File

@ -50,24 +50,14 @@ jobs:
fail-fast: false
matrix:
config:
# test all old versions of R >= 3.0, we support them all!
# (for R-release and R-devel, see check-current.yaml)
- {os: macOS-latest, r: '4.1', allowfail: false}
- {os: macOS-latest, r: '4.0', allowfail: false}
- {os: macOS-latest, r: '3.6', allowfail: false}
- {os: ubuntu-22.04, r: '4.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
# R 3.5 returns a strange GC error when running examples, omit the checks for that
# - {os: ubuntu-22.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
# Test all old versions of R >= 3.0, we support them all!
# For recent R versions, see check-recent.yaml (r-lib supports the latest 5 major versions)
- {os: ubuntu-22.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.2', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: windows-latest, r: '4.1', allowfail: false}
- {os: windows-latest, r: '4.0', allowfail: false}
- {os: windows-latest, r: '3.6', allowfail: false}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

View File

@ -38,7 +38,7 @@ on:
# this is to check that all dependencies are still available (see R/zzz.R)
- cron: '0 1 * * *'
name: check-current
name: check-recent
jobs:
R-code-check:
@ -52,15 +52,30 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'devel', allowfail: false}
- {os: macOS-latest, r: 'release', allowfail: false}
- {os: ubuntu-latest, r: 'devel', allowfail: false}
- {os: ubuntu-latest, r: 'release', allowfail: false}
- {os: windows-latest, r: 'devel', allowfail: false}
- {os: windows-latest, r: 'release', allowfail: false}
- {os: macOS-latest, r: '3.6', allowfail: false}
- {os: ubuntu-latest, r: '3.6', allowfail: false}
- {os: windows-latest, r: '3.6', allowfail: false}
# current development version:
- {os: macOS-latest, r: 'devel', allowfail: false}
- {os: windows-latest, r: 'devel', allowfail: false}
- {os: ubuntu-latest, r: 'devel', allowfail: false}
# current 'release' version:
- {os: macOS-latest, r: '4.2', allowfail: false}
- {os: windows-latest, r: '4.2', allowfail: false}
- {os: ubuntu-latest, r: '4.2', allowfail: false}
# older versions:
- {os: macOS-latest, r: '4.1', allowfail: false}
- {os: windows-latest, r: '4.1', allowfail: false}
- {os: ubuntu-latest, r: '4.1', allowfail: false}
- {os: macOS-latest, r: '4.0', allowfail: false}
- {os: windows-latest, r: '4.0', allowfail: false}
- {os: ubuntu-latest, r: '4.0', allowfail: false}
- {os: macOS-latest, r: '3.6', allowfail: false}
- {os: windows-latest, r: '3.6', allowfail: false}
- {os: ubuntu-latest, r: '3.6', allowfail: false}
- {os: macOS-latest, r: '3.5', allowfail: false}
- {os: windows-latest, r: '3.5', allowfail: false}
- {os: ubuntu-latest, r: '3.5', allowfail: false}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 1.8.2.9078
Version: 1.8.2.9079
Date: 2023-01-05
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,4 +1,4 @@
# AMR 1.8.2.9078
# AMR 1.8.2.9079
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*

View File

@ -51,13 +51,13 @@ expect_identical(
)
expect_equal(
mean_amr_distance(data.frame(vctr_mic, vctr_rsi, vctr_disk)),
mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_rsi, TOB = vctr_disk)),
c(-1.10603655, -0.74968823, -0.39333990, -0.03699158, 0.96485397, 1.32120229),
tolerance = 0.00001
)
expect_equal(
mean_amr_distance(data.frame(vctr_mic, vctr_rsi, vctr_disk), 2:3),
mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_rsi, TOB = vctr_disk), 2:3),
c(-0.9909017, -0.7236405, -0.4563792, -0.1891180, 1.0463891, 1.3136503),
tolerance = 0.00001
)