diff --git a/tests/testthat/test-hybrid.R b/tests/testthat/test-hybrid.R index 15e5a3b..ed28fd3 100644 --- a/tests/testthat/test-hybrid.R +++ b/tests/testthat/test-hybrid.R @@ -22,7 +22,7 @@ patrick::with_parameters_test_that("basic hybrid test", { mz_tol_relative = NA, rt_tol_relative = NA, cluster = get_num_workers()) - actual <- result$recovered_feature_sample_table + actual <- as_tibble(result$recovered_feature_sample_table) keys <- c("mz", "rt", "sample", "sample_rt", "sample_intensity") expected <- arrow::read_parquet( @@ -46,7 +46,7 @@ patrick::with_parameters_test_that("basic hybrid test", { ) } - expect_equal(actual, expected) + expect_equal(actual, expected, tolerance) }, patrick::cases( mbr = list( diff --git a/tests/testthat/test-prof.to.features.R b/tests/testthat/test-prof.to.features.R index ee809cc..da4e32e 100644 --- a/tests/testthat/test-prof.to.features.R +++ b/tests/testthat/test-prof.to.features.R @@ -22,7 +22,7 @@ patrick::with_parameters_test_that( expected_path <- file.path(testdata, "features", expected_filename) expected <- arrow::read_parquet(expected_path) - expect_equal(actual, expected) + expect_equal(actual, expected, tolerance = 0.01) }, patrick::cases( mbr_test0 = list( diff --git a/tests/testthat/test-unsupervised.R b/tests/testthat/test-unsupervised.R index 915d294..8ebc6ea 100644 --- a/tests/testthat/test-unsupervised.R +++ b/tests/testthat/test-unsupervised.R @@ -9,11 +9,9 @@ patrick::with_parameters_test_that( test_files <- sapply(files, function(x) file.path("../testdata/input", x)) - expected <- arrow::read_parquet(file.path("../testdata/unsupervised", paste0(.test_name, "_unsupervised.parquet"))) - result <- unsupervised(test_files, cluster = get_num_workers()) keys <- c("mz", "rt", "sample", "sample_rt", "sample_intensity") - actual <- result$recovered_feature_sample_table + actual <- as_tibble(result$recovered_feature_sample_table) if (store_reports) { report <- dataCompareR::rCompare( @@ -32,6 +30,9 @@ patrick::with_parameters_test_that( ) } + # arrow::write_parquet(actual, file.path("../testdata/unsupervised", paste0(.test_name, "_unsupervised.parquet"))) + expected <- arrow::read_parquet(file.path("../testdata/unsupervised", paste0(.test_name, "_unsupervised.parquet"))) + expect_equal(actual, expected) }, patrick::cases(