diff --git a/tests/testthat/test_loadData_bruker.R b/tests/testthat/test_loadData_bruker.R index 1b06d36..d0731e9 100644 --- a/tests/testthat/test_loadData_bruker.R +++ b/tests/testthat/test_loadData_bruker.R @@ -5,12 +5,10 @@ test_that("data can be loaded and processed from Bruker Flex", format(Sys.time(), "%H:%M:%OS") } setwd(dirname(common::file.find(pattern = "req.txt"))) - cat("Working directory is ", getwd(), "\n") # download test data and unzip cat(timeNow(), "downloading Bruker Flex test data...\n") curl::curl_download("https://figshare.com/ndownloader/files/46156791", "testdata_bruker.zip") - cat(timeNow(), "unzip Bruker test data...\n") unzip("testdata_bruker.zip") # overwrite settings @@ -23,25 +21,19 @@ test_that("data can be loaded and processed from Bruker Flex", library(shinytest2) options(shiny.testmode = TRUE) - cat(timeNow(), "Starting app...\n") + app <- AppDriver$new(app_dir = getwd(), name = "M2ara_bruker load test", seed = 42, timeout = 4.5*1e5) - cat(timeNow(), "loading spectra...\n") app$click("load") Sys.sleep(120) - cat(timeNow(), "processing...\n") app$click("process") - cat(timeNow(), "done!\n") exp <-app$get_values(export = TRUE) - cat(timeNow(), "running tests...\n") - expect_equal(exp$export$isSpectrumList, TRUE) + show_failureexpect_equal(exp$export$isSpectrumList, TRUE) expect_equal(exp$export$numSpec, 88) - - cat(timeNow(), "Sucess! Cleaning up...\n") fs::dir_delete("Curve") fs::file_delete("settings.csv") fs::file_delete("testdata_bruker.zip") diff --git a/tests/testthat/test_loadData_mzML.R b/tests/testthat/test_loadData_mzML.R index d659b4f..ca47924 100644 --- a/tests/testthat/test_loadData_mzML.R +++ b/tests/testthat/test_loadData_mzML.R @@ -5,12 +5,9 @@ test_that("data can be loaded and processed from mzML", format(Sys.time(), "%H:%M:%OS") } setwd(dirname(common::file.find(pattern = "req.txt"))) - cat("Working directory is ", getwd(), "\n") # download test data and unzip - cat(timeNow(), "downloading mzML test data...\n") curl::curl_download("https://figshare.com/ndownloader/files/46156788", "testdata_mzML.zip") - cat(timeNow(), "unzip mzML test data...\n") unzip("testdata_mzML.zip") # overwrite settings @@ -23,45 +20,33 @@ test_that("data can be loaded and processed from mzML", library(shinytest2) options(shiny.testmode = TRUE) - cat(timeNow(), "Starting app...\n") app <- AppDriver$new(app_dir = getwd(), name = "M2ara_mzML load test", seed = 42, timeout = 2.4*1e5) - cat(timeNow(), "loading spectra...\n") app$click("load") - cat(timeNow(), "processing...\n") app$click("process") Sys.sleep(30) - cat(timeNow(), "done!\n") - cat(timeNow(), "performing pca...\n") app$click("doPca") Sys.sleep(3) - cat(timeNow(), "performing clustering...\n") app$click("doClust") Sys.sleep(5) - cat(timeNow(), "extracting values...\n") exp <- app$get_values(export = TRUE) - cat(timeNow(), "check loading sucess\n") expect_equal(exp$export$isSpectrumList, TRUE) expect_equal(exp$export$numSpec, 144) - cat(timeNow(), "check processing sucess\n") expect_equal(exp$export$infoState, "processed") - cat(timeNow(), "check PCA sucess\n") expect_true(is_tibble(exp$export$pca$scores)) expect_true(is_tibble(exp$export$pca$loadings)) - cat(timeNow(), "check clustering sucess\n") expect_true(latrend::is.lcModels(exp$export$clust)) expect_true(is_tibble(extractLaClusters(exp$export$clust))) - cat(timeNow(), "Cleaning up...\n") fs::file_delete("settings.csv") fs::dir_delete("mzML") fs::file_delete("testdata_mzML.zip")