diff --git a/DESCRIPTION b/DESCRIPTION index bc61f36..c98d9d3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,7 +37,7 @@ Suggests: testthat (>= 3.0.0), mzR, chromConverterExtraTests -Config/reticulate: list( packages = list( list(package = "scipy"), +Config/reticulate: list( packages = list(list(package = "scipy"), list(package="numpy"), list(package = "pandas"), list(package="aston", pip = TRUE), diff --git a/inst/shell/path_to_openchrom_commandline.txt b/inst/shell/path_to_openchrom_commandline.txt index 7951def..a5ef9ae 100644 --- a/inst/shell/path_to_openchrom_commandline.txt +++ b/inst/shell/path_to_openchrom_commandline.txt @@ -1 +1 @@ -NULL +/Applications/Eclipse.app/Contents/MacOS/openchrom diff --git a/tests/testthat/helpers.R b/tests/testthat/helpers.R index 5861f46..115a194 100644 --- a/tests/testthat/helpers.R +++ b/tests/testthat/helpers.R @@ -3,8 +3,7 @@ elementwise.all.equal <- Vectorize(function(x, y, ...) {isTRUE(all.equal(x, y, ...))}) # helper function to skip tests if we don't have the right python dependencies -skip_if_missing_dependecies <- function() { - reqs <- c("scipy","numpy", "aston", "pandas") +skip_if_missing_dependecies <- function(reqs = c("scipy","numpy", "aston", "pandas", "olefile")) { have_reqs <- sapply(reqs, reticulate::py_module_available) if (mean(have_reqs) < 1) skip(paste("required packages", reqs[!have_reqs], @@ -21,15 +20,13 @@ skip_if_missing_thermorawfileparser <- function() { } have_reqs <- fs::file_exists(path) if (mean(have_reqs) < 1) - skip(paste("required packages", reqs[!have_reqs], - "not available for testing")) + skip("ThermoRawFileParser could not be found.") } skip_if_missing_openchrom <- function() { have_openchrom_cli <- switch(configure_openchrom(cli="status"), true = TRUE, false = FALSE) if (!have_openchrom_cli){ - skip(paste("required packages", reqs[!have_reqs], - "not available for testing")) + skip("OpenChrom could not be found.") } } diff --git a/tests/testthat/test-extra.R b/tests/testthat/test-extra.R index b9e13c3..2fbe7f1 100644 --- a/tests/testthat/test-extra.R +++ b/tests/testthat/test-extra.R @@ -181,8 +181,8 @@ test_that("read_chroms can read 'Chromeleon' period-separated files", { test_that("read_peaklist can read `Shimadzu` PDA files", { skip_on_cran() + skip_if_missing_dependecies() skip_if_not_installed("chromConverterExtraTests") - path <- system.file("shimadzuDAD_Anthocyanin.txt", package = "chromConverterExtraTests") @@ -238,6 +238,7 @@ test_that("read_chroms can read 'Agilent' dx files", { test_that("read_chroms can read 'Thermo' RAW files", { skip_on_cran() + skip_on_ci() skip_if_not_installed("chromConverterExtraTests") skip_if_missing_thermorawfileparser() @@ -259,6 +260,7 @@ test_that("read_chroms can read 'Thermo' RAW files", { test_that("read_chroms can use 'OpenChrom' parsers", { skip_on_cran() + skip_on_ci() skip_if_not_installed("chromConverterExtraTests") skip_if_missing_openchrom() @@ -286,8 +288,8 @@ test_that("read_varian_peaklist function works", { test_that("read_cdf function can read peak tables", { skip_on_cran() + skip_if_not_installed("ncdf4") skip_if_not_installed("chromConverterExtraTests") - path <- system.file("VARIAN1.CDF", package = "chromConverterExtraTests") x <- read_cdf(path, what = "peak_table") expect_s3_class(x, "data.frame")