-
Notifications
You must be signed in to change notification settings - Fork 318
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
testthat::expect_snapshot_value: Can't find bottom
on the call tree. Backtrace:
#1646
Comments
I also got this a bit confusing error and I think I could reproduce it. In my case, it happened with
Here is a MRE: library(magrittr)
library(testthat, warn.conflicts=FALSE)
f = function() {
rlang::warn("foobar", class="x")
}
expect_warning(f(), class="y")
#' Warning: foobar
#' Error: `f()` did not throw the expected warning.
f() |> expect_warning(class="y")
#' Warning: foobar
#' Error: `f()` did not throw the expected warning.
f() %>% expect_warning(class="y")
#' Warning: foobar
#' Error in `trace_back()`:
#' ! Can't find `bottom` on the call tree.
#' Run `rlang::last_error()` to see where the error occurred. Tracerlang::last_error()
#'<error/rlang_error>
#' Error in `trace_back()`:
#' ! Can't find `bottom` on the call tree.
#'---
#'Backtrace:
#' 1. f() %>% expect_warning(class = "y")
#' 2. testthat::expect_warning(., class = "y")
#' 3. testthat:::expect_condition_matching(...)
#' 4. testthat::expect(...)
#' 5. rlang::trace_back(top = getOption("testthat_topenv"), bottom = trace_env)
#'Run `rlang::last_trace()` to see the full context.
rlang::last_trace()
#'<error/rlang_error>
#'Error in `trace_back()`:
#'! Can't find `bottom` on the call tree.
#'---
#' Backtrace:
#' ▆
#'1. ├─f() %>% expect_warning(class = "y")
#'2. └─testthat::expect_warning(., class = "y")
#'3. └─testthat:::expect_condition_matching(...)
#'4. └─testthat::expect(...)
#'5. └─rlang::trace_back(top = getOption("testthat_topenv"), bottom = trace_env)
#'6. └─rlang:::trace_find_bottom(bottom, frames)
#'7. └─rlang::abort(msg, call = call) |
For future travelers: I was running into an issue similar to @kapsner but I eventually found that the If you're using GH actions, I found the |
Note: I switched the warning test to use a snapshot because I was running into something similar to r-lib/testthat#1646
Occured to me today. If working on version control, deleting the original snapshot file is useful to use git to see what changed in the snapshot, so that the underlying error can be more easily identified |
Duplicate of #1994, which will be fixed shortly 😄 |
testthat::expect_snapshot_value
results in the error below when running the Github-Actions in the repository of the DQAgui R package, however, only for the runnersmacOS-latest(release)
andubuntu-latest(devel)
(windows-latest(release)
andubuntu-latest(release)
are both passing without this error).This error is difficult to debug, as it is not reproducible running
devtools:test()
on my local machine.Does anyone have an idea, why this error occurs and maybe even how to fix it?
Thanks in advance, Lorenz
The text was updated successfully, but these errors were encountered: