You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integrate 'testthat' into the Tests feature for R packages #1365
Currently, if you have an R package and open the Testing view, it says that 'No tests have been found in the workspace', even if the workspace contains testthat tests.
We should:
Detect any testthat tests and display them in the Tests pane; support running tests, showing results, and jumping to errors
Have a "Configure R Tests" button that helps new users set up testthat for the first time
I think it's fine to lean on R code; it'd be nicer to have our own UI but not essential. We'll need an RStudio-like mechanism for helping users get bootstrapped by installing the packages needed for this kind of functionality ("configuring R tests requires usethis and testthat, would you like to install those now?").
Having experienced this myself now in build 1214, my leading hypothesis is that it's this, quoting @jmcphers:
One thing you'll need to watch out for when you get closer to making a PR is that it can be a little tricky to get wasm files to get picked up properly when the extension is webpacked for release. You'll probably have to add it to positron-r/positron.json.
It's clear (from logging) that the hang is at the test file parsing stage.
Activity
jennybc commentedon Sep 22, 2023
The first groundwork for this has been laid by @juliasilge in #915. That creates the scaffold for hooking into VS Code's test UI.
At the complete other extreme, I have standalone code that extracts the relevant test info (e.g. coordinates for
test_that()calls, their descriptions) from a folder's worth of test files, using a tree-sitter-generated R parser. In a private repo: https://github.com/jennybc/treesitrrust.The next phase is to create the plumbing that connects those two pieces.
Re: 'Have a "Configure R Tests" button that helps new users set up testthat for the first time'
☝️ if one can use R code, that is
usethis::use_testthat()and, if not, then replicating that.jmcphers commentedon Sep 22, 2023
I think it's fine to lean on R code; it'd be nicer to have our own UI but not essential. We'll need an RStudio-like mechanism for helping users get bootstrapped by installing the packages needed for this kind of functionality ("configuring R tests requires usethis and testthat, would you like to install those now?").
juliasilge commentedon Oct 3, 2023
With #1445 we can now run tests in a little self-contained R session or alternatively in the console.
juliasilge commentedon Oct 4, 2023
With #915 merged in, we can now move on to a next step, such as parsing the test files.
juliasilge commentedon Nov 16, 2023
In build 1214 I see:
When I click to run a test, it looks like it is going but it never finishes (will wait for minutes) or returns success/failure info to the UI.
jennybc commentedon Nov 16, 2023
Having experienced this myself now in build 1214, my leading hypothesis is that it's this, quoting @jmcphers:
It's clear (from logging) that the hang is at the test file parsing stage.
jennybc commentedon Nov 18, 2023
Oh lordy, we're back in business and I think this is fixed now in release builds. A simple fix but rather hard to divine.
juliasilge commentedon Nov 22, 2023
In build 1327, I can use the testing extension for R packages. Looking so great! 🎉
Passing tests:
A failing test: