Skip to content

Commit 6953b78

Browse files
committed
test(conda): keep is_gha() gate on env-creation block
Restore the is_gha() guard on the construct_conda_yml conda env-creation block that was dropped in ac61194. The block creates a real conda env under ~/miniforge3/envs/testenv and is intentionally GHA-only — running it on a developer machine leaves persistent state behind, and the test's own `condaenv_exists()` cleanup misses orphaned env directories, so subsequent runs fail with `prefix already exists`. is_gha() is the right gate here because the test is genuinely targeting the GHA environment (where setup-miniconda provides conda on PATH and the runner is fresh). Update the NEWS bullet to reflect that is_gha() is retained for this single test; everywhere else the gates are now host-specific skip_if_offline().
1 parent fb4012c commit 6953b78

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

NEWS.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,17 @@ and vignettes.
6262
* Forward the `ncpus` input to `grimbough/bioc-actions/setup-bioc@v1` (as
6363
its `Ncpus` input) so non-Linux R installs use the configured parallel
6464
job count instead of the action's default of 3.
65-
* Tests: replace `if(!is_gha()) skip_if_offline()` gates with
66-
host-specific `skip_if_offline(host=...)` calls
65+
* Tests: replace `is_gha()` gates that were guarding internet access
66+
with host-specific `skip_if_offline(host=...)` calls
6767
(`bioconductor.org`, `github.com`, `raw.githubusercontent.com`,
68-
`ghcr.io`, `conda.anaconda.org`) so individual tests skip when their
69-
actual remote is unreachable rather than relying on a GHA escape hatch.
68+
`ghcr.io`) so individual tests skip when their actual remote is
69+
unreachable. This includes the `get_description` Bioc-repo block,
70+
which previously gated on `is_gha() | is_rstudio()` to dodge CRAN
71+
flakiness (#65); it now skips on `bioconductor.org` instead.
72+
`is_gha()` is retained only for the `construct_conda_yml`
73+
env-creation block, where the test is genuinely GHA-only (creates
74+
and leaves a conda env behind, so should not run on developer
75+
machines).
7076

7177
# rworkflows 1.0.11
7278

tests/testthat/test-construct_conda_yml.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ test_that("construct_conda_yml works", {
3131

3232
#### Construct an actual conda env ####
3333
if("reticulate" %in% rownames(installed.packages()) &&
34-
conda_installed() &&
35-
.Platform$OS.type != "windows"){
34+
conda_installed() &&
35+
is_gha() &&
36+
.Platform$OS.type != "windows"){
3637
envname <- "testenv"
3738
if(condaenv_exists(envname)){
3839
reticulate::conda_remove(envname = envname)

0 commit comments

Comments
 (0)