-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fails to expand or run tests on macOS and Debian #104
Comments
Since I don't get an error anywhere what I can see. Is it possible to see what is going on in some way? |
Are you on insiders? If so this may be a dupe of #106. If you go to developer tools you'll probably see an error saying something about the streams method, if so then it is this problem. I'm working on it, but it should still work on stable. |
Not on Insiders - running Stable only. VS Code version: Seeing this in the "Console" tab in developer tools (this is on macOS). I get this error each time I run a test from the Test Explorer.
|
When you debug a test, it should show a PesterInterface script being ran. Can you run that directly in the terminal and send me the raw output? It should be a bunch of json. Unexpected token indicates maybe your test name or result has a special character in it that the json parser can't support? |
In output I got this:
S I ran this in PSIC:
|
When I clicked on "Debug Test" in the test explorer, the test actually started to run in the PSIC, but froze in the middle pf the test... Stopping debug did not release PSIC either - the PSIC "froze" so only way to get back was to terminate the PSIC and start a new one. Using "Debug Test" did not generate any error in the developer tools. |
It should be all english language text in test names. Not sure what you mean by result. Results are from Pester? |
So that JSON above is what gets fed to the extension, it reads it in line-by-line, converts from JSON, and then adds it to the test tree. The error you're showing suggests it is unable to parse the JSON for one of these entries because it contains a non-unicode character (the ? with the diamond around it icon). If I get a chance I'll run them thru the parser and find which one. |
I got you. But the same error is shown for every test I made, and also for those tests that did work half a year ago, and those tests has not changed. So in that case it feels like the parsing of the JSON is different on macOS and Debian than Windows? I do not get that issue on Windows. 🤔 |
@JustinGrote can you point me to where in the code it parses the input? See if I can debug this on the macOS Looking at the output between Windows and macOS I see that it does something different. On Windows it outputs all tests in CAPS. Otherwise I can't se a difference (except for the obvious path). This is from Windows during discovery:
And this is from macOS during discovery:
|
There are some quirks about how nodejs resolves drive letters that messed up casing so I just uppercase everything for the test ID. Apparently that's not taking effect on Mac. |
I am getting the same JSON token error with a test just as basic as that one. |
Since it can be reproduced in a devcontainer and not MacOS specific I can probably do some testing on that. I plan to hopefully look into this in the next few weeks, I've needed to have priorities elsewhere unfortunately. |
Curious if there's a workaround for this issue (manually fixing the JSON file perhaps)? I'm using Pester for some development I'm doing and not having an IDE plugin is cramping my style :-D |
@markcandelora @KevinMarquette @fabian-lohauss @johlju can you please test with the latest 2023.7.0 release? This should be fixed now. |
OK, I don't think the Mac respects the ansi handling as nicely as Linux does, let me see if I can wire up a Mac github action. |
@johlju can you try this build? It should give more detailed error as to exactly what JSON it is choking on. As far as I can tell it should be stripping those (rename the .zip to .vsix and install it to vscode) |
Installed it but now when I click on "Testing" icon it errors directly with the following and does not load the test pane:
|
Gotta love when the "never happen" errors happen eh? give me a bit, I'm rewriting the tests that should be able to catch when this happens and clean it up and I'll put out a new build, thanks for your patience, I don't have a Mac directly so I can't see exactly what's going on. |
No worries. Happy to test builds to get this working 😊 |
@johlju I probably wont get to it today but the problem you ran into was because I included some code on something else I was working on (updating the output channel to allow for custom log formats). I implemented a safer JSON parsing method that should surface the stream problems a lot better, I'll get a build out when I get a chance to finish it. Ultimately a "big picture" refactor goal is to get all of this running within the PSES instance and not require a separate PowerShell process. It should be doable and should alleviate a lot of these issues. |
@johlju here's a new build to try, it probably wont fix but will at least show better whats going on. |
That build works! It can expand tests, run tests and debug tests. So I think we can close this issue once that change is merged. I saw some other problems now that I can actually run the tests on this large codebase (with thousands of tests), but they are unrelated to this issue. 🙂 |
@johlju I've released 2021.7.1 and I'll close this as complete then unless someone else reports another issue. Glad that worked! |
I ran into this issue on macOS, so I set up a Debian in a Hyper-V VM just to verify if it worked on Linux (this does work on Windows and Ubuntu WSL), but the same issue happens in the Debian VM. This did work in macOS half a year ago as mentioned here #30 (comment).
When expanding a test the icon in the test explorer starts spinning and nothing happens, in the output this is shown.
For reference I'm using these settings:
User:
Workspace:
The text was updated successfully, but these errors were encountered: