AxoCover
AxoCover copied to clipboard
Could not open test file
Hi,
if I double click on a unit test in AxoCover I will get the following error message in a message box: Could not open file: <path2File>. Although it opens the file but not jumping to it actually. What can I do about it?
BR, Hendrik
Hmm, maybe there is a problem with reaching the specific line in the file. This is likely a bug. It could also be that the source file has been modified since test build - note AxoCover will NOT rebuild your tests when you run them, you need to do it manually.
Hmm it is completely rebuilt before each test run. Can I do anything else?
BR,
Hendrik Freund Software Engineer (8SIN) Rohde & Schwarz INRADIOS GmbH Nossener Brücke 12, 01187 Dresden, Germany
Phone: +49 (0)351 340907-70 Fax: +49 (0)351 340907-99 Web: http://www.inradios.com/
INRADIOS GmbH; Geschäftsführer (Managing Directors): Dr. Steffen Bittner, Dr. Marco Krondorf; Sitz (Registered Office): Dresden; WEEE-Reg.-Nr. (WEEE Register No.): DE 81158062; USt-IdNr. (VAT Identification No.): DE 815159074; HRB (Commercial Register No.): 28693; Amtsgericht (Registration Court): Dresden
This email and any attachments are intended only for the person to which this email is addressed and may contain confidential and/or privileged information. If you received this email in error, please do not disclose the contents to anyone, but notify the sender by return email and delete this email (and any attachments) from your system.
From: Péter Major [mailto:[email protected]] Sent: Wednesday, February 7, 2018 10:36 AM To: axodox/AxoCover [email protected] Cc: Freund Hendrik 8SIN [email protected]; Author [email protected] Subject: [Newsletter] Re: [axodox/AxoCover] Could not open test file (#146)
Hmm, maybe there is a problem with reaching the specific line in the file. This is likely a bug. It could also be that the source file has been modified since test build - note AxoCover will NOT rebuild your tests when you run them, you need to do it manually.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/axodox/AxoCover/issues/146#issuecomment-363710814, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AiVmPTzh-whcpTShqrOuLAF7DWsrk8Giks5tSW6IgaJpZM4R0Npt.
Content provided within this e-mail including any attachments, is for the use of the intended recipients and may contain Rohde & Schwarz company restricted information. Any unauthorized use, disclosure, or distribution of this communication in whole or in part is strictly prohibited. If you are not the intended recipient, please notify the sender by reply email or by telephone and delete the communication in its entirety.
I will review the affected part of the code and add some logging sometime this week. With that we should be able to get a better look at the problem. If you can share a sample project which reproduces the issue that would be very useful.
I attached a sample project where the issue happens on my side.
Hendrik Freund Software Engineer (8SIN) Rohde & Schwarz INRADIOS GmbH Nossener Brücke 12, 01187 Dresden, Germany
Phone: +49 (0)351 340907-70 Fax: +49 (0)351 340907-99 Web: http://www.inradios.com/
INRADIOS GmbH; Geschäftsführer (Managing Directors): Dr. Steffen Bittner, Dr. Marco Krondorf; Sitz (Registered Office): Dresden; WEEE-Reg.-Nr. (WEEE Register No.): DE 81158062; USt-IdNr. (VAT Identification No.): DE 815159074; HRB (Commercial Register No.): 28693; Amtsgericht (Registration Court): Dresden
This email and any attachments are intended only for the person to which this email is addressed and may contain confidential and/or privileged information. If you received this email in error, please do not disclose the contents to anyone, but notify the sender by return email and delete this email (and any attachments) from your system.
From: Péter Major [mailto:[email protected]] Sent: Wednesday, February 7, 2018 11:23 AM To: axodox/AxoCover [email protected] Cc: Freund Hendrik 8SIN [email protected]; Author [email protected] Subject: [Newsletter] Re: [axodox/AxoCover] Could not open test file (#146)
I will review the affected part of the code and add some logging sometime this week. With that we should be able to get a better look at the problem. If you can share a sample project which reproduces the issue that would be very useful.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/axodox/AxoCover/issues/146#issuecomment-363723719, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AiVmPUqdpQTQ_mwYOV41FwfiiOo3mwyWks5tSXmagaJpZM4R0Npt.
Content provided within this e-mail including any attachments, is for the use of the intended recipients and may contain Rohde & Schwarz company restricted information. Any unauthorized use, disclosure, or distribution of this communication in whole or in part is strictly prohibited. If you are not the intended recipient, please notify the sender by reply email or by telephone and delete the communication in its entirety.
Hmm... It seems GitHub is not supporting these kind of email attachments. You could either drag and drop it on the Web based UI, or send it to AxoCover [at] outlook [dot] com.
Thank you, I will get back to you after I have checked the issue, likely later this week.
I tried to reproduce the issue, but for me it seems to work (I am using latest VS2017 + latest AxoCover). If you have 20min I would suggest you to try to debug issue locally. For this you can fetch the code from GitHub, then build it (you will need vs2015+ and Visual Studio SDK installed). The issue will be around the call to method NavigateToMethod in class EditorContext.
Put a guide here on how to build: https://github.com/axodox/AxoCover/wiki/How-to-build-AxoCover%3F I will also create one about how the code is laid out.
I too suffer this issue with all my diverse projects. Double clicking opens the file, but stays at the top. The error dialog shows the correct file name. This issue applies to both Tests tab and Reports tab navigation. However, the Test tab Debug button works fine. Here is a project with the issue:
https://github.com/kaosborn/SimpleApps
Strange you can't reproduce. My configuration is current and simple:
Visual Studio 2017 Community 15.6.4 AxoCover 1.1.5.5 Windows 10 Pro build 1709
And thanks for AxoCover! You are definitely on the right track.
@kaosborn I tested AxoCover with your SimpleApps repo, I have the exact same software versions as you list and it works for me. Could it be some compatibility problem with another extension?
Here is how to debug (no need to build or install anything!):
- Go to the releases and download the vsix and corresponding source code.
- Install the VSIX. + Unpack the source.
- The vsix has all the PDB in it, when you run tests the path of installation is printed out with some test DLL paths, e.g. >> Loading assembly from C:\Users\Axodox\AppData\Local\Microsoft\VisualStudio\15.0_46f4e761\Extensions\honzmv02.jc5 \ MSTestAdapter\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll...
- Add the above folder to your symbol's path.
- Open AxoCover.sln and then navigate to D:\dev\AxoTools\AxoCover\ViewModels\TestExplorerViewModel.cs and add a breakpoint to private void NavigateToTestItem(TestItemViewModel testItem) - this is the method used to navigate to test code.
- Open other VS with your problematic project.
- Attach the AxoCover VS to this.
- Reproduce problem.
- Check what is going wrong.
Well I gave it a go with release 1.1.336 but any breakpoints show the warning
The breakpoint will not currently be hit. No Symbols have been loaded for this document.
And indeed the set breakpoint is not hit. I assume this is because building the project failed. (Or maybe I set up the symbols directory wrong?)
The first build error is:
...\easyhook.h(45): fatal error C1083: Cannot open include file: 'winternl.h': No such file or directory
Bummer. As far as other extensions go, not much out of the usual except perhaps Sandcastle Help File Builder. An expired Visual Studio 2017 Enterprise is present if that matters.
You don't need to build it, however you need to load the symbols from the extension's directory. You can do this by opening the Modules window from Debug / Windows, selecting the AxoCover DLLs and right click Load symbols.
If you still want to build it, please refer to this.
Ah, Debug>Windows>Modules then Load Symbols. That did the trick. A couple items of note:
- The extension gets automatically updated which desynchronizes the source. Disabling automatic updates of extensions in Tools>Options solved this.
- I'm still using release-1.1.336 because it is not clear what release maps to the new v1.1.5.18.
So now I can drill down into the codebase. In method NavigateToCodeElement, line is calculated as 0.
I've tried inspecting codeElement but VS won't let me because it is native code. Strange, I've enabled Native Code Debugging in Project>Properties but still can't inspect native code.
So now I'm stuck. Any advice?
CodeElement is a Visual Studio COM component. I used to debug these by capturing their properties in variables (watches and immediate window seem to not work with them). But their source is closed and native, so we cannot really look inside.
I can add some code to clamp line argument of NavigateToFile between 1 to number of lines in file. That would not solve the issue, but would at least open / switch to the file without showing an error.
Other notes:
- I have added more information about debugging here: https://github.com/axodox/AxoCover/wiki/Debugging-issues
- Please refer to releases for mapping (see the version number in the #Uri part).
I looked at the code, and at first glance the issue could be:
- VS somehow fails to calculate the line number.
- The code element is not the right one, so the issue is coming from earlier calculations.
Thanks. I'll work on getting a build going against the current release to help further. And try to answer the question what makes my environment (or the OP's) different.
If you took the approach to change line from 0 to 1, that would make the error go away but might also cause confusion because people might think this is normal behavior. So I'm not sure what the best approach might be.
OK, in the meantime I am adding a debug version of the plug-in to releases, as I noticed that debugging on the release build version is quite limited because the code is optimized.
Do you have the SandCastle extension installed?
I just run into this issue yesterday, as SandCastle somehow corrupts the Edit.GoTo command, as it does not accept the line argument anymore.
https://github.com/EWSoftware/SHFB/issues/594