Test result do not show because the extension pick the wrong result file.
See original GitHub issueEnvironment
>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview3-010431
Commit: d72abce213
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\
Host (useful for support):
Version: 3.0.0-preview3-27503-5
Commit: 3844df9537
.NET Core SDKs installed:
3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview3-27503-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview3-27504-2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Steps to reproduce
Create a test project with dotnet new nunit
and create a guarantee passed test (e.g : Assert.AreEqual(1,1)
). Test pass in the Test Explorer Log but the icon near the selected test spin forever :
Expected behaviour
CodeLens and test explorer panel in side bar show tick or pass/fail.
Actual Behaviour
The tick or pass/fail was not shown, in progress icon spin forever.
Note
As you can see, the test result was generated in the windows temp folder, so this is not a permission issue (I tried to change the path to D:\temp but it didn’t work). The important information is the vscode devtool console log:
ERR ENOENT: no such file or directory, unlink 'C:\Users\KOMI-S~1\AppData\Local\Temp\test-explorer\0.trx': Error: ENOENT: no such file or directory, unlink 'C:\Users\KOMI-S~1\AppData\Local\Temp\test-explorer\0.trx'
at Object.fs.unlinkSync (fs.js:1061:3)
at ReadFileContext.parseResults.fs.readFile [as callback] (C:\Users\Komi-San-Supporter\.vscode\extensions\formulahendry.dotnet-test-explorer-0.6.4\out\src\testResultsFile.js:64:20)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:352:13)
It tried to read a file named 0.trx
but the actual file created was 0_2019-03-09_19-06-35-471.trx
. Then, I tried to rename one of the old results file to 0.trx
and run test again, everything worked! The result was show in both editor and side bar (of course it is not the actual result, I just want to verify which file the extension read) and the 0.trx
was deleted!
In addition, I tried to install older version of the extension: 0.6.0 -> 0.6.3 and 0.5.0 (the 0.5.0 didn’t log to the devtool console but the rename trick work) and still had the same issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top GitHub Comments
It work with net core 3.0 now, thank you for the hard work 💯
Ok thanks. I think we’ll have to re-write how we fetch the test results file then in order to be compatible with how the sdk is going to work in coming versions. Thanks a lot for reporting!