Skip to content

Commit

Permalink
Drop most skip_on_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Mar 26, 2024
1 parent f5125fd commit 0fc3591
Show file tree
Hide file tree
Showing 41 changed files with 5 additions and 147 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

env:
Expand Down Expand Up @@ -72,6 +72,7 @@ jobs:
remotes::install_cran("sf")
remotes::install_cran("rcmdcheck")
remotes::install_cran("textshaping")
remotes::install_github("pbs-assess/sdmTMBextra")
install.packages("Matrix", type = "source")
install.packages("TMB", type = "source")
shell: Rscript {0}
Expand All @@ -83,6 +84,7 @@ jobs:
remotes::install_cran("knitr")
remotes::install_cran("rmarkdown")
remotes::install_cran("rcmdcheck")
remotes::install_github("pbs-assess/sdmTMBextra")
install.packages("Matrix", type = "source")
install.packages("TMB", type = "source")
shell: Rscript {0}
Expand All @@ -94,6 +96,7 @@ jobs:
remotes::install_cran("knitr")
remotes::install_cran("rmarkdown")
remotes::install_cran("rcmdcheck")
remotes::install_github("pbs-assess/sdmTMBextra")
install.packages("Matrix", type = "source")
install.packages("TMB", type = "source")
shell: Rscript {0}
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-1-fit-basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ test_that("sdmTMB model fit with a covariate beta", {
})

test_that("Anisotropy fits and plots", {
skip_on_ci()
skip_on_cran()
local_edition(2)
m <- sdmTMB(
Expand Down Expand Up @@ -176,7 +175,6 @@ test_that("A spatiotemporal version works with predictions on new data points",

test_that("Predictions on the original data set as `newdata`` return the same predictions", {
skip_on_cran()
skip_on_ci()
local_edition(2)
set.seed(1)
x <- stats::runif(500, -1, 1)
Expand Down Expand Up @@ -219,7 +217,6 @@ test_that("Predictions on the original data set as `newdata`` return the same pr

test_that("poly() works on newdata", {
skip_on_cran()
skip_on_ci()

# https://github.com/pbs-assess/sdmTMB/issues/77
d <- pcod_2011
Expand Down
11 changes: 0 additions & 11 deletions tests/testthat/test-2-fit-less-basic.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
test_that("Regularization works", {
skip_on_cran()
skip_on_ci()
local_edition(2)
d <- subset(pcod, year >= 2015)
d$depth_scaled <- as.numeric(scale(d$depth_scaled))
Expand Down Expand Up @@ -31,7 +30,6 @@ test_that("Regularization works", {

test_that("A time-varying model fits and predicts appropriately", {
skip_on_cran()
skip_on_ci()
local_edition(2)
# SEED <- 42
# set.seed(SEED)
Expand Down Expand Up @@ -84,7 +82,6 @@ test_that("Year indexes get created correctly", {

test_that("A spatially varying coefficient model fits", {
skip_on_cran()
skip_on_ci()
d <- subset(pcod, year >= 2011) # subset for speed
pcod_spde <- make_mesh(d, c("X", "Y"), cutoff = 30)
d$scaled_year <- (d$year - mean(d$year)) / sd(d$year)
Expand All @@ -101,7 +98,6 @@ test_that("A spatially varying coefficient model fits", {
test_that("SPDE as generated by make_mesh is consistent", {
set.seed(42)
skip_on_cran()
skip_on_ci()
set.seed(1)
local_edition(2)
x <- stats::runif(70, -1, 1)
Expand Down Expand Up @@ -173,7 +169,6 @@ test_that("SPDE as generated by make_mesh is consistent", {

test_that("profile option works", {
skip_on_cran()
skip_on_ci()
d <- subset(pcod, year == 2013)
pcod_spde <- make_mesh(d, c("X", "Y"), cutoff = 10)
mp <- sdmTMB(density ~ depth_scaled + depth_scaled2,
Expand All @@ -192,7 +187,6 @@ test_that("profile option works", {

test_that("The mapping off spatial and spatiotemporal fields works.", {
skip_on_cran()
skip_on_ci()
d <- subset(pcod, year >= 2013)
pcod_spde <- make_mesh(d, c("X", "Y"), cutoff = 50)
m <- sdmTMB(density ~ 0 + as.factor(year),
Expand Down Expand Up @@ -251,7 +245,6 @@ test_that("Large coordinates cause a warning.", {

test_that("Random walk fields work", {
skip_on_cran()
skip_on_ci()
d <- subset(pcod, year >= 2013)
pcod_spde <- make_mesh(d, c("X", "Y"), cutoff = 15)
m_rw <- sdmTMB(density ~ 1,
Expand Down Expand Up @@ -281,7 +274,6 @@ test_that("Random walk fields work", {

test_that("start works", {
skip_on_cran()
skip_on_ci()

expect_error({
m2 <- sdmTMB(density ~ poly(depth, 2),
Expand All @@ -300,7 +292,6 @@ test_that("start works", {

test_that("Multiple SVC works", {
skip_on_cran()
skip_on_ci()

mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 15)

Expand All @@ -324,7 +315,6 @@ test_that("Multiple SVC works", {

test_that("More esoteric prediction options work", {
skip_on_cran()
skip_on_ci()
fit <- sdmTMB(
density ~ depth_scaled,
data = pcod_2011, mesh = pcod_mesh_2011,
Expand Down Expand Up @@ -369,7 +359,6 @@ test_that("More esoteric prediction options work", {

test_that("update() works", {
skip_on_cran()
skip_on_ci()
fit <- sdmTMB(
density ~ depth_scaled,
data = pcod_2011, mesh = pcod_mesh_2011,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-2-print-anisotropy.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("Print anisotropy prints correctly", {
skip_on_cran()
skip_on_ci()
skip_on_ci() # slow

# No anisotropy
fit1 <- sdmTMB(
Expand Down
11 changes: 0 additions & 11 deletions tests/testthat/test-3-families.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ loc <- data.frame(x = x, y = y)
spde <- make_mesh(loc, c("x", "y"), n_knots = 50, type = "kmeans")

test_that("Student family fits", {
skip_on_ci()
skip_on_cran()
set.seed(3)
initial_betas <- 0.5
Expand All @@ -57,7 +56,6 @@ test_that("Student family fits", {
})

test_that("Lognormal fits", {
skip_on_ci()
skip_on_cran()
range <- 1
x <- stats::runif(500, -1, 1)
Expand All @@ -77,7 +75,6 @@ test_that("Lognormal fits", {
})

test_that("NB2 fits", {
skip_on_ci()
skip_on_cran()
set.seed(1)
x <- stats::runif(300, -1, 1)
Expand All @@ -93,7 +90,6 @@ test_that("NB2 fits", {
})

test_that("Truncated NB2, truncated NB1, and regular NB1 fit", {
skip_on_ci()
skip_on_cran()
set.seed(1)
x <- stats::runif(300, -1, 1)
Expand Down Expand Up @@ -129,7 +125,6 @@ test_that("Truncated NB2, truncated NB1, and regular NB1 fit", {
})

test_that("Poisson fits", {
skip_on_ci()
skip_on_cran()
d <- pcod
spde <- make_mesh(pcod, c("X", "Y"), cutoff = 10)
Expand All @@ -144,7 +139,6 @@ test_that("Poisson fits", {
})

test_that("Binomial fits", {
skip_on_ci()
skip_on_cran()
d <- pcod[pcod$year == 2017, ]
d$density <- round(d$density)
Expand All @@ -158,7 +152,6 @@ test_that("Binomial fits", {
})

test_that("Gamma fits", {
skip_on_ci()
skip_on_cran()
d <- pcod[pcod$year == 2017 & pcod$density > 0, ]
spde <- make_mesh(d, c("X", "Y"), cutoff = 10)
Expand All @@ -176,7 +169,6 @@ test_that("Gamma fits", {
})

test_that("Beta fits", {
skip_on_ci()
skip_on_cran()
set.seed(1)
x <- stats::runif(400, -1, 1)
Expand All @@ -200,7 +192,6 @@ test_that("Beta fits", {
})

test_that("Censored Poisson fits", {
skip_on_ci()
skip_on_cran()
set.seed(1)

Expand Down Expand Up @@ -434,7 +425,6 @@ test_that("Binomial simulation/residuals works with weights argument or cbind()"

test_that("Generalized gamma works", {
skip_on_cran()
skip_on_ci()
d <- subset(pcod_2011, density > 0)
fit1 <- sdmTMB(
density ~ 1 + depth_scaled,
Expand Down Expand Up @@ -480,7 +470,6 @@ test_that("Generalized gamma works", {

test_that("Generalized gamma matches Gamma when Q = sigma", {
skip_on_cran()
skip_on_ci()

# Generate values drawn from generaliased gamma distribution given the mean of those values
rgengamma <- function(n, mean, sigma, Q) {
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/test-3-spatial-varying.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
test_that("SVC are estimated correctly for binomial and delta models", {
skip_on_cran()
skip_on_ci()
local_edition(2)
d <- pcod
d$year_scaled <- as.numeric(scale(d$year))
Expand Down Expand Up @@ -93,7 +92,6 @@ test_that("SVC are estimated correctly for binomial and delta models", {
test_that("Delta model with spatially varying factor predictor and no spatiotemporal field works #237", {
# https://github.com/pbs-assess/sdmTMB/issues/237
skip_on_cran()
skip_on_ci()
pcod_q2 <- pcod_2011
pcod_q1 <- pcod_2011
pcod_q1$quarter <- as.factor(1)
Expand All @@ -119,7 +117,6 @@ test_that("Delta model with spatially varying factor predictor and no spatiotemp

test_that("Factor handling for SVC models works #269", {
skip_on_cran()
skip_on_ci()
set.seed(1)
pcod_2011$vessel <- sample(c("A", "B"), size = nrow(pcod_2011), replace = TRUE)
pcod_2011$vessel <- as.factor(pcod_2011$vessel)
Expand All @@ -140,7 +137,6 @@ test_that("Factor handling for SVC models works #269", {

test_that("SVC throws a warning if character class #269", {
skip_on_cran()
skip_on_ci()
pcod_2011$vessel <- sample(c("A", "B"), size = nrow(pcod_2011), replace = TRUE)
expect_warning({
fit <- sdmTMB(present ~ vessel,
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-4-index-calculation.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
test_that("get_index(), get_index_sims(), and get_cog() work", {
local_edition(3)
skip_on_ci()
skip_on_cran()
pcod_spde <- make_mesh(pcod, c("X", "Y"), cutoff = 20)
m <- sdmTMB(
Expand Down Expand Up @@ -56,7 +55,6 @@ test_that("get_index(), get_index_sims(), and get_cog() work", {
})

test_that("index errors are returned as needed", {
skip_on_ci()
skip_on_cran()

g <- replicate_df(qcs_grid, "year", unique(pcod_2011$year))
Expand Down
5 changes: 0 additions & 5 deletions tests/testthat/test-5-residuals.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# test_that("Simulated residuals work", {
# skip_on_cran()
# skip_on_ci()
# skip_if_not_installed("INLA")
# fit <- sdmTMB(density ~ as.factor(year) + poly(depth, 2),
# data = pcod_2011, time = "year", mesh = pcod_mesh_2011,
Expand All @@ -19,7 +18,6 @@

test_that("randomized quantile residuals work,", {
skip_on_cran()
skip_on_ci()

set.seed(1)
predictor_dat <- data.frame(X = runif(2000), Y = runif(2000))
Expand Down Expand Up @@ -298,7 +296,6 @@ test_that("MCMC residuals work with sdmTMBextra", {
skip_on_cran()
skip_if_not_installed("sdmTMBextra")
skip_if_not_installed("rstan")
skip_on_ci()
d <- pcod_2011
set.seed(1)
d$offset <- rnorm(nrow(d))
Expand Down Expand Up @@ -339,7 +336,6 @@ test_that("predict_mle_mcmc() works with extra_time #297", {
skip_on_cran()
skip_if_not_installed("sdmTMBextra")
skip_if_not_installed("rstan")
skip_on_ci()
fit <- sdmTMB(
density ~ 1,
time = "year",
Expand All @@ -357,7 +353,6 @@ test_that("predict_mle_mcmc() works with extra_time #297", {

test_that("all residuals work with extra time and offsets #326", {
skip_on_cran()
skip_on_ci()
skip_if_not_installed("sdmTMBextra")
mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 30)
pcod$os <- rep(log(0.01), nrow(pcod)) # offset
Expand Down
5 changes: 0 additions & 5 deletions tests/testthat/test-6-tmb-simulation.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
test_that("TMB IID simulation works", {
skip_on_ci()
skip_on_cran()

set.seed(1)
Expand Down Expand Up @@ -32,7 +31,6 @@ test_that("TMB IID simulation works", {
})

test_that("TMB AR1 simulation works", {
skip_on_ci()
skip_on_cran()

set.seed(1)
Expand Down Expand Up @@ -68,7 +66,6 @@ test_that("TMB AR1 simulation works", {
})

test_that("TMB RW simulation works", {
skip_on_ci()
skip_on_cran()

set.seed(1)
Expand Down Expand Up @@ -121,7 +118,6 @@ test_that("TMB RW simulation works", {

test_that("TMB (custom) AR1 simulation is unbiased", {
# run many times; check for bias
skip_on_ci()
skip_on_cran()

do_sim_fit <- function(i) {
Expand Down Expand Up @@ -165,7 +161,6 @@ test_that("TMB (custom) AR1 simulation is unbiased", {


# test_that("TMB Delta simulation works", {
# skip_on_ci()
# skip_on_cran()
# skip_if_not_installed("INLA")
#
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-7-visreg.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
test_that("visreg works", {
skip_on_cran()
skip_on_ci()
skip_if_not_installed("visreg")

# first test against glmmTMB outputs
Expand Down
Loading

0 comments on commit 0fc3591

Please sign in to comment.