Skip to content

R CMD check fails if test_path() contains subfolder named "hold"Β #2093

@lawalter

Description

@lawalter

This is a continuation of #2083.

I created a simple reproducible R package example to illustrate the issue: https://github.com/lawalter/testingtestthat

To summarize, testthat::test_local(paste0(here::here())) passes no matter what subfolders are named under ~/tests/testthat/data/. However, R cmd check fails to access data if and only if the ~/tests/testthat/data/ subfolder is named "hold" (i.e., testthat::test_path("data", "DL0902", "hold"); subfolder "permit" and "holdz" work fine).

Example test-ignoreHolds.R:

test_that("ignoreHolds works", {

  hold_file <-
    list.files(testthat::test_path("data", "DL0902", "hold"),
               full.names = T)

  test_hold_file <-
    listFiles(testthat::test_path("data", "DL0902", "hold"))

  expect_identical(hold_file, test_hold_file[[1]])

  expect_true(length(hold_file) == 1)

  expect_true(length(test_hold_file[[1]]) == 1)
})
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions