Skip to content

R: Test wrappers not detected by Test Explorer #7213

@samclark2015

Description

@samclark2015

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"}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions