Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests for connect_to_etn() deprecation fail in R CMD CHECK, order matters? #319

Open
PietrH opened this issue Sep 30, 2024 · 0 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PietrH
Copy link
Member

PietrH commented Sep 30, 2024

I found a strange bug in #313

The tests for the connect_to_etn() deprecation fail, but only when running R CMD CHECK, or devtools::test(filter = "connect_to_etn"), but not when clicking Run Tests or when I try running R CMD CHECK locally. Maëlle also tried, and had no failures locally.

The order of the tests also seems to matter, as the first test always passes, and the 2nd and 3rd then fail:

test_that("connect_to_etn() returns deprecation warning when used with named arguments", {
  lifecycle::expect_deprecated(
    connect_to_etn(username = "my name", password = "my password")
  )
})

test_that("connect_to_etn() returns deprecation warning when used with unnamed arguments", {
  skip("")
  lifecycle::expect_deprecated(
    connect_to_etn("my name", "my password")
  )
})

test_that("connect_to_etn() returns deprecation argument when used without arguments",{
  lifecycle::expect_deprecated(
    connect_to_etn()
  )
})

We suspected for a moment it might have something to do with the lifecyle behavior around options(lifecycle_verbosity). However, expect_deprecated() should set this option to warn:

expect_deprecated() sets the lifecycle_verbosity option to "warning" to enforce deprecation warnings which are otherwise only shown once every 8 hours.

And, our function has always = TRUE so it should warn every time anyways.

Also tried with expect_warn and have the same issues there.

@PietrH PietrH added bug Something isn't working help wanted Extra attention is needed labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant