Skip to content

Commit

Permalink
Skip unstable test on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Mar 26, 2024
1 parent 0fc3591 commit dc2f78a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
extra-packages: any::covr
needs: coverage

- name: Install extras
run: |
remotes::install_github("pbs-assess/sdmTMBextra")
shell: Rscript {0}

- name: Test coverage
run: |
covr::codecov(
Expand Down
7 changes: 3 additions & 4 deletions tests/testthat/test-nonstationary.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ test_that("Test that non-stationary model works with epsilon trend and delta mod
test_that("Test that non-stationary model works without spatial field and random effects in epsilon", {
local_edition(2)
skip_on_cran()
skip_on_ci()

set.seed(42)
time_steps <- 20
Expand Down Expand Up @@ -273,7 +274,7 @@ test_that("Test that non-stationary model works without spatial field and random
)

par <- fit$sd_report$value[which(names(fit$sd_report$value)=="ln_epsilon_re_sigma")]
expect_equal(as.numeric(par), -14.0, tolerance = 0.002)
expect_equal(as.numeric(par), -14.0, tolerance = 0.01) # unstable mac vs. windows/ubuntu
par <- fit$sd_report$par.fixed[1:2]
expect_equal(as.numeric(par), c(0.2579745,-0.40099), tolerance = 0.002)
})
Expand Down Expand Up @@ -308,7 +309,6 @@ test_that("Test that non-stationary model works without spatial field and trend
seed = 42,
B = c(0.2, -0.4) # B0 = intercept, B1 = a1 slope
)

sim_dat$time <- sim_dat$year
sim_dat$year_centered <- sim_dat$time - min(sim_dat$time)

Expand All @@ -323,8 +323,7 @@ test_that("Test that non-stationary model works without spatial field and trend
control = sdmTMBcontrol(lower = list(ln_epsilon_re_sigma = -15, b_epsilon=-1),
upper = list(ln_epsilon_re_sigma = -1, b_epsilon=1))
)

par <- fit$sd_report$value[which(names(fit$sd_report$value)=="b_epsilon")]
expect_equal(as.numeric(par), 0.01257052, tolerance = 0.002)
expect_equal(as.numeric(par), 0.01257052, tolerance = 0.05)

})

0 comments on commit dc2f78a

Please sign in to comment.