-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
NOTE: Before submitting an issue, please make sure to install the latest version of both the vscode extension and the R package. This can usually be achieved by running the command r.debugger.updateRPackage in vscode's command palette (F1).
Describe the bug
devtools::test() doesn't trigger breakpoints in testing file or package.
MRE
- Open this repo as an r project with vsc r debugger enabled: https://github.com/katrinabrock/minimal-r-package
- Open tests/testthat/test-output.R).
- Add some breakpoints.
- Run the
Debug testthat testconfig. (This runsdevtools::test(filter='output'))

Your Launch config
If applicable, the launch config that causes the bug. E.g.:
https://github.com/katrinabrock/minimal-r-package/blob/main/.vscode/launch.json#L15-L23
Expected behavior
Dropped into debug console at breakpoints.
Actual behavior
Tests run without stopping at breakpoints.
Desktop (please complete the following information):
- OS: Desktop is Mac OS, using VS Code Remote..remote (where R is running) is Ubuntu
- R Version: 4.3.2
- VSCode version: 1.92.2
- vscDebugger Version: 0.5.3
- vscode-r-debugger Version: v0.5.4
Additional context
- Breakpoints in the code that calls devtools::test (in this case
example2.R): working ✅ - Breakpoints in the test files themselves: not working ❌
- Breakpoints in package functions called within the tests: not working: ❌
- Direct
browsercalls: working everywhere ✅
I believe this is failing because testthat runspkgload::load_all(): https://github.com/r-lib/testthat/blob/fe38519d72247a8907228a4ecaf926483aa5d4ff/R/test-files.R#L235 and that call is not successfully getting overwritten with vscDebugger::.vsc.load_all
Metadata
Metadata
Assignees
Labels
No labels