-
Notifications
You must be signed in to change notification settings - Fork 179
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
The test run did not record any output #3090
Comments
Thank you for the report. Currently, our implementation for the test explorer is a bit simplistic and we need to improve it. For example, we have no way to tell test frameworks to return JSON structured results so that we can return that to the editor. Our only option is to try to parse the output printed to stdout manually. Do you happen to be using any specific reporter for Minitest other than the default one? Or do you have a test example that reproduces the problem? The correct solution, which we prototyped but haven't had the time to finish yet, is to have a special LSP reporter that we force tests to use and that returns us structured JSON responses, so that we can easily attach that to the test items in the extension rather than trying to parse arbitrary output. |
An alternative may be to use the JUnit XML format which is already supported by several test frameworks: https://github.com/testmoapp/junitxml |
@vinistock thank you for the context. I tried reproducing it with a new Rails 8 app but its appears to work there. Do you have a way I can debug this in the problematic app? |
There's no easy way, but if you're willing to dig into the code, then you could try to figure out what's going on by:
You will need to start the extension in development mode (described in the contributing docs) and in the second VS Code window you would open the project that reproduces the issue and run tests to trigger the breakpoint. |
When a test fails `assertTestPasses` throws an error with the stdout of the command. This wasn't added to the test's output in the `catch` handler which made VSCode report the test run as not recording any output. Fixes Shopify#3090
Thanks @vinistock I think I managed to find the issue. |
For my own sanity I think there are several situations that may need different solutions. I tested these scenarios in both the Rails app that I initially reported the problem for and a brand new Rails 8 app. A single passing testTest run output
Test case output
A single failing testTest run output
This is solved by #3146. It's not appending double for me. Perhaps I'm misunderstanding the APIs and what I'm seeing but it looks like the call to Test case output
A file with a failing and passing testTest case output
This only showing the passing test. I believe this is because even though we're running tests for the entire file we're executing separate commands for each test. Passing test output
Failing test output
|
Description
Ruby LSP Information
Ruby LSP Information
VS Code Version
1.96.4
Ruby LSP Extension Version
0.8.18
Ruby LSP Server Version
0.23.6
Ruby LSP Add-ons
Ruby Version
3.3.0
Ruby Version Manager
none
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Code snippet or error message
The “TEST RESULTS” tab opens with “Ruby LSP” selected on the right side and “The test run did not record any output.” on the left. When I click on a specific test I do see the output. I always have to select a specific test to see its output. Is this intended behavior or is there something wrong with my setup?
The text was updated successfully, but these errors were encountered: