R: Test wrappers not detected by Test Explorer

Open
#7,213 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
testing-qa

Research direction

Reproduce the issue in the R Test Explorer with a testthat wrapper such as the reported targets test and customtest example, then inspect the R Language Pack output for test identifiers that cannot be found. Done means tests declared directly with testthat and through wrappers are both displayed and their results are associated correctly in the explorer.

Written by the indexing model from the issue text.

Description

enhancement lang: r support

System details:

Positron and OS details:
Positron Version: 2025.04.0 (Universal) build 250
Code - OSS Version: 1.98.0
Commit: 627b3d723ee0b3a5bd86731a75902d419cafe22d
Date: 2025-04-03T16:31:38.728Z
Electron: 34.2.0
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Darwin arm64 24.3.0
Interpreter details:

R 4.4.0, but affects any version

Describe the issue:

The R test explorer does not display tests that are generated using wrappers of testthat, as described in #7210.

The below screenshot shows a testing file which leverages a targets test, and implements a custom test wrapper customtest, neither of which are displayed in the test explorer sidebar.

Image

Expected or desired behavior:

All tests, declared directly using testthat or by using another wrapper, are displayed in the test explorer.

Were there any error messages in the UI, Output panel, or Developer Tools console?

From R Language Pack output channel:

2025-04-10 11:40:39.772 [debug] Received test data: {"type":"start_reporter"}
2025-04-10 11:40:39.772 [debug] Received test data: {"type":"start_file","filename":"test-rename-me.R"}
2025-04-10 11:40:39.772 [info] Setting hostFile to test-rename-me.R
2025-04-10 11:40:39.775 [debug] Received test data: {"type":"start_test","test":"test_tar"}
2025-04-10 11:40:39.775 [debug] Looking for test with id test-rename-me.R&test_tar
2025-04-10 11:40:39.775 [error] Test with id test-rename-me.R&test_tar could not be found. Please report this.
2025-04-10 11:40:39.775 [debug] Received test data: {"type":"add_result","context":{},"test":"test_tar","result":"skip","location":"test-rename-me.R:4:1","filename":"test-rename-me.R","message":"Reason: empty test"}
2025-04-10 11:40:39.775 [debug] Looking for test with id test-rename-me.R&test_tar
2025-04-10 11:40:39.775 [error] Test with id test-rename-me.R&test_tar could not be found. Please report this.
2025-04-10 11:40:39.776 [debug] Received test data: {"type":"end_test","test":"test_tar"}
2025-04-10 11:40:39.777 [debug] Received test data: {"type":"start_test","test":"multiplication works"}
2025-04-10 11:40:39.777 [debug] Looking for test with id test-rename-me.R&multiplication works
2025-04-10 11:40:39.778 [debug] Received test data: {"type":"add_result","context":{},"test":"multiplication works","result":"success","location":"test-rename-me.R:9:3","filename":"test-rename-me.R"}
2025-04-10 11:40:39.778 [debug] Looking for test with id test-rename-me.R&multiplication works
2025-04-10 11:40:39.781 [debug] Received test data: {"type":"end_test","test":"multiplication works"}
2025-04-10 11:40:39.784 [debug] Received test data: {"type":"end_file","filename":"test-rename-me.R"}
2025-04-10 11:40:39.784 [debug] Received test data: {"type":"end_reporter"}
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.