diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index ba89f18..21b8a93 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -2,9 +2,9 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master, development] + branches: [main, master] pull_request: - branches: [main, master, development] + branches: [main, master] name: test-coverage @@ -23,22 +23,9 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr remotes + extra-packages: any::covr needs: coverage - - uses: actions/setup-python@4 - with: - Python-version: '3.11' - - - name: setup r-reticulate venv - shell: Rscript {0} - run: | - remotes::install_local() - reticulate::virtualenv_create("agcounts", Sys.which("python")) - reticulate::virtualenv_install("agcounts", c("numpy", "pandas", "pygt3x")) - python <- reticulate::virtualenv_python("agcounts") - writeLines(sprintf("RETICULATE_PYTHON=%s", python), Sys.getenv("GITHUB_ENV")) - - name: Test coverage run: | covr::codecov( diff --git a/tests/testthat/test_actilife_counts.R b/tests/testthat/test_actilife_counts.R index 7aa6fbf..7e73a42 100644 --- a/tests/testthat/test_actilife_counts.R +++ b/tests/testthat/test_actilife_counts.R @@ -2,7 +2,7 @@ testthat::test_that("agcounts and Actilife counts are the same",{ - #skip_if(!py_module_available("pygt3x")) + skip_if(!py_module_available("pygt3x")) gt3xPath <- system.file("extdata/example.gt3x", package = "agcounts") agdPath <- system.file("extdata/example5sec.agd", package = "agcounts") diff --git a/tests/testthat/test_agread.R b/tests/testthat/test_agread.R index 957d6ff..36de5c0 100644 --- a/tests/testthat/test_agread.R +++ b/tests/testthat/test_agread.R @@ -1,16 +1,17 @@ # Copyright © 2022 University of Kansas. All rights reserved. -testthat::test_that("Check that data can be read into agcounts using each agread method", { - - #skip_if(!py_module_available("pygt3x")) - +testthat::test_that("Check that data can be read into agcounts using pygt3x", { + skip_if(!py_module_available("pygt3x")) file <- system.file("extdata/example.gt3x", package = "agcounts") - - expect_error(agread(path = file, parser = "no parser")) - pygt3x <- agread(path = file, parser = "pygt3x", verbose = FALSE) expect_equal(nrow(pygt3x), 18000) expect_equal(ncol(pygt3x), 4) +}) + + +testthat::test_that("Check that data can be read into agcounts using each agread method", { + file <- system.file("extdata/example.gt3x", package = "agcounts") + expect_error(agread(path = file, parser = "no parser")) invisible(capture.output(ggir <- agread(path = file, parser = "GGIR", verbose = FALSE))) expect_equal(nrow(ggir), 18000) diff --git a/tests/testthat/test_shinyReactable.R b/tests/testthat/test_shinyReactable.R index ad0bac1..41c074e 100644 --- a/tests/testthat/test_shinyReactable.R +++ b/tests/testthat/test_shinyReactable.R @@ -1,7 +1,6 @@ # Copyright © 2022 University of Kansas. All rights reserved. testthat::test_that("Test raw module reactable table output", { - #skip_if(!py_module_available("pygt3x")) app <- shinytest2::AppDriver$new(agShinyDeployApp()) app$upload_file(`rawDataModule-gt3xFile` = system.file("extdata/example.gt3x", package = "agcounts")) app$set_inputs(`rawDataModule-parser` = "read.gt3x") diff --git a/tests/testthat/test_shinyServer.R b/tests/testthat/test_shinyServer.R index 2f7ff47..5b71e7f 100644 --- a/tests/testthat/test_shinyServer.R +++ b/tests/testthat/test_shinyServer.R @@ -1,7 +1,7 @@ # Copyright © 2022 University of Kansas. All rights reserved. testthat::test_that("Shiny app rawDataModuleServer loads raw acceleration data", { - #skip_if(!py_module_available("pygt3x")) + skip_if(!py_module_available("pygt3x")) shiny::testServer(rawDataModuleServer, { path = system.file("extdata/example.gt3x", package = "agcounts") session$setInputs(gt3xFile = list(datapath = path), parser = "pygt3x", @@ -31,7 +31,7 @@ testthat::test_that("Shiny app rawDataModuleServer loads raw acceleration data", }) testthat::test_that("Shiny app rawDataModuleServer loads dynamic UI", { - #skip_if(!py_module_available("pygt3x")) + app <- shinytest2::AppDriver$new(agShinyDeployApp()) app$upload_file(`rawDataModule-gt3xFile` = system.file("extdata/example.gt3x", package = "agcounts")) app$set_inputs(`rawDataModule-parser` = "read.gt3x") @@ -52,7 +52,6 @@ testthat::test_that("Shiny app rawDataModuleServer loads dynamic UI", { testthat::test_that("Shiny app compareCountsModule loads agd data", { - #skip_if(!py_module_available("pygt3x")) shiny::testServer(compareCountsModuleServer, { path = system.file("extdata/calibration1sec.agd", package = "agcounts") data <- .read_agd(path)