Closed elm- closed 11 months ago
(techincal paragraph) Test Explorer might not be updated because it relies on events which are being sent through Debug Adapter Protocol between debugee (vs code) and debugger. So I guess this exception could be the reason for that.
Could you follow https://scalameta.org/metals/docs/contributors/getting-started#json-rpc-trace and create trace files - dap-server.trace.json
and dap-client.trace.json
in .metals? Then after running/debugging something try to search for "event": "testResult"
in those files. This will tell us if this exception is related to the problme or not.
Thanks, here the relevant event, the rest of the trace seems to correctly pass the additional output of the test run as events as well. The only thing which looks "weird" to me in the event is that all test have the same timings instead of individual timings, not sure if that is normal or not.
server
[Trace][04:29:22 PM] Received notification:
{
"type": "event",
"seq": 40,
"event": "testResult",
"body": {
"category": "testResult",
"data": {
"suiteName": "com.cupenya.sqlstreamsync.sql.RowEventProcessorTest",
"duration": 1774,
"tests": [
{
"kind": "passed",
"testName": "RowEventProcessor.extractRow should::return a list of extracted values from ResultSet",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor.extractRow should::return None for null values",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::format date",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::parse date",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::parse date for epoch",
"duration": 1774
}
]
},
"type": "testResult"
}
}
client:
[Trace][04:29:22 PM] Sent notification:
{
"type": "event",
"seq": 40,
"event": "testResult",
"body": {
"category": "testResult",
"data": {
"suiteName": "com.cupenya.sqlstreamsync.sql.RowEventProcessorTest",
"duration": 1774,
"tests": [
{
"kind": "passed",
"testName": "RowEventProcessor.extractRow should::return a list of extracted values from ResultSet",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor.extractRow should::return None for null values",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::format date",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::parse date",
"duration": 1774
},
{
"kind": "passed",
"testName": "RowEventProcessor utils should::parse date for epoch",
"duration": 1774
}
]
},
"type": "testResult"
}
}```
@elm- duration is incorrect but it's fixed already https://github.com/scalacenter/scala-debug-adapter/pull/366 so after some internal guts are updated, duration should be correct.
I tried already cleaning everything and resetting the project, the problem persists and is happening across any project I try.
This might indicate that problem is somewhere else, but on the other hand, there are events in trace files and metals extension should capture those events and interpret them. Could you try to provide some repository with reproduction? Also, what test framework do you use?
I'll see if I can reproduce this over the weekend in a simpler project and I'll also double check if this works potentially in a devcontainer, just to make sure nothing is locally broken.
This issue was closed because no new information was added for the last 30 days. If you have any relevant information, feel free to add it and reopen the issue.
Running any test command in the project does not update the test explorer view.
By using run test or run all tests in project, the tests are correctly executed (as seen in the debug console output), but the test results are not shown in the testing UI or lenses (I tried switching the setting, same result).
I tried already cleaning everything and resetting the project, the problem persists and is happening across any project I try.
The following exception is shown in the Metals output console:
Expected behaviour:
Testing results are parsed and visualized.
Operating system: Mac OS X
Java version: 17.0.6
Editor/extension: Visual Studio Code v1.76.2
Metals version: 0.11.11
Extra context or search terms:
Workspace information: