Skip to content
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

R package testing UI doesn't work in release builds #6345

Open
jonvanausdeln opened this issue Feb 13, 2025 · 9 comments
Open

R package testing UI doesn't work in release builds #6345

jonvanausdeln opened this issue Feb 13, 2025 · 9 comments
Labels
bug Something isn't working lang: r

Comments

@jonvanausdeln
Copy link
Contributor

jonvanausdeln commented Feb 13, 2025

System details:

Positron and OS details:

Positron Version: 2025.02.0 (system setup) build 171
Code - OSS Version: 1.96.0
Commit: 55f7331
Date: 2025-02-10T16:01:00.400Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

Interpreter details:

4.4.1

Describe the issue:

Running R tests in test explorer don't work in release build, but do in a dev build.

See automated R - Verify Basic Test Explorer Functionality test.

Test uses https://github.com/posit-dev/qa-example-content/tree/348e46225221d2a0087618c863b72374a3f3a257/workspaces/r_testing

Release Build:

From Dev build:

Steps to reproduce the issue:

  1. Load the workspace https://github.com/posit-dev/qa-example-content/tree/348e46225221d2a0087618c863b72374a3f3a257/workspaces/r_testing
  2. Go to test explorer
  3. Run all Tests

Expected or desired behavior:

Tests to run in release build

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

Here is the R language pack output channel log:
r-test-explorer-ouput-log.txt

A snippet of that:

2025-02-13 11:42:53.192 [debug] Received test data: {"type":"start_reporter"}
2025-02-13 11:42:53.193 [debug] Received test data: {"type":"start_file","filename":"test-apple-wtf.R"}
2025-02-13 11:42:53.193 [info] Setting hostFile to test-apple-wtf.R
2025-02-13 11:42:53.203 [debug] Received test data: {"type":"start_test","test":"subtraction works"}
2025-02-13 11:42:53.203 [debug] Looking for test with id test-apple-wtf.R&subtraction works
2025-02-13 11:42:53.203 [error] Test with id test-apple-wtf.R&subtraction works could not be found. Please report this.
@jonvanausdeln jonvanausdeln added bug Something isn't working lang: r labels Feb 13, 2025
@jennybc
Copy link
Member

jennybc commented Feb 13, 2025

My current hypothesis is that the tree-sitter parser is missing or corrupt in the release builds (though I am not able to reproduce this locally, i.e. the test explorer is working for me at the moment). Nothing has changed recently in the test explorer code in positron-r, so I am wondering if something about our overall build and packaging has caused this regression.

@juliasilge
Copy link
Contributor

FWIW I cannot use the R package testing UI in release builds right now, and I was thinking it was me!

@juliasilge juliasilge changed the title R tests don't work in release build R package testing UI doesn't work in release builds Feb 13, 2025
@jonvanausdeln
Copy link
Contributor Author

I had to go back to 2024.11.0 (system setup) build 140 to get it to work. I went back through the public releases.

@jennybc
Copy link
Member

jennybc commented Feb 13, 2025

@jonvanausdeln did more git-bisect-ish work and narrowed it down to the diff between https://github.com/posit-dev/positron-builds/releases/tag/2025.02.0-66 and https://github.com/posit-dev/positron-builds/releases/tag/2025.02.0-71. Those are not public release tags, but they correspond to:

I did some spidey-sense-guided forensics in those builds and find that this file is present in 2025.02.0-66 and missing in 2025.02.0-71:

/Volumes/Positron-2025.02.0-66/Positron.app/Contents/Resources/app/extensions/positron-r/dist/tree-sitter.wasm

The big change between these 2 tags is #6007 and it's very easy to believe that the 1.96 upstream merge could have inadvertently caused this problem.

@jmcphers Since you actually did the merge, do you already have any intuition about where to look? I do see quite a lot of changes that look related to the packaging of extensions. I'm just wondering if you already scrutinized those changes and the implications for us.

@jennybc
Copy link
Member

jennybc commented Feb 13, 2025

It feels like our brute force fix for getting tree-sitter.wasm into the positron-r extension in release builds is no longer working:

#1843 (comment)

@jennybc
Copy link
Member

jennybc commented Feb 14, 2025

I can also fix a broken release build by copying tree-sitter.wasm from a good build (so pre 1.96 merge) into the expected location.

@juliasilge
Copy link
Contributor

After the 1.96 upstream merge, we had to follow up with #5756 for some packaged extension dependencies. Would that approach be helpful for how to fix this additional packaging problem?

@jennybc
Copy link
Member

jennybc commented Feb 14, 2025

It looks like #5756 was actually addressing changes from the 1.95 merge, whereas the current problem comes from changes in the 1.96 merge.

@jennybc
Copy link
Member

jennybc commented Feb 15, 2025

I've banged my head against this all day with no success. Nothing I have tried re: using @vscode/tree-sitter-wasm from VS Code / Positron (the trick used for @vscode/windows-registry) or trying to keep tree-sitter.wasm in positron-r has worked. It does not help that our co-pilot settings prevent much examination of the relevant files, because the code in question matches public code (namely, matches VS Code). Lots and lots of this when poking around any files related to building the product:

Image

For whoever attempts this next:

"from": "node_modules/web-tree-sitter/tree-sitter.wasm",
"to":"./dist"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang: r
Projects
None yet
Development

No branches or pull requests

3 participants