Skip to content

Commit

Permalink
using skip if not on long kendalltau
Browse files Browse the repository at this point in the history
and on the logging test that is failing on r-universe
  • Loading branch information
rmflight committed Oct 19, 2024
1 parent e5d9178 commit db937a5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ICIKendallTau
Title: Calculates information-content-informed Kendall-tau
Version: 1.2.6
Version: 1.2.7
Authors@R: c(
person(
given = c("Robert", "M"),
Expand Down
35 changes: 18 additions & 17 deletions tests/testthat/test-kendall-tau.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,26 @@ test_that("large kendall returns correct", {
expect_snapshot(ici_val)
})

if (run_long_kendallt) {
test_that("big kendall works", {
x = sort(rnorm(50000))
y = x + 1
x[1:5000] = NA
t1 = ici_kt(x, y, perspective = "global")
t2 = ICIKendallTau:::ici_kt_pairs(x, y, perspective = "global")
expect_equal(t1[c(1, 2)], t2)
})
test_that("big kendall works", {
skip_if_not(run_long_kendallt)
x = sort(rnorm(50000))
y = x + 1
x[1:5000] = NA

t1 = ici_kt(x, y, perspective = "global")
t2 = ICIKendallTau:::ici_kt_pairs(x, y, perspective = "global")
expect_equal(t1[c(1, 2)], t2)
})

test_that("lots of kendall works", {
x = matrix(rnorm(500000), 5000, 100)
colnames(x) = paste0('s', seq_len(ncol(x)))
test_that("lots of kendall works", {
skip_if_not(run_long_kendallt)
x = matrix(rnorm(500000), 5000, 100)
colnames(x) = paste0('s', seq_len(ncol(x)))

t1 = ici_kendalltau(x)
expect_lt(t1$run_time, 9)
})

t1 = ici_kendalltau(x)
expect_lt(t1$run_time, 9)
})
}


test_that("include_only works as intended", {
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-logging.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
run_long_kendallt = as.logical(Sys.getenv("run_long_kendallt"))
if (is.na(run_long_kendallt)) {
run_long_kendallt = FALSE
}

test_that("logger detection works", {
skip_if_not(run_long_kendallt)
new_lib = tempfile()
dir.create(new_lib)
withr::with_libpaths(new_lib, {
Expand Down

0 comments on commit db937a5

Please sign in to comment.