TestCentric / testcentric-gui

TestCentric GUI Runner for NUnit
Other
66 stars 31 forks source link

Engine Extensions dialog stopped working #1104

Closed FlorianAsal closed 3 hours ago

FlorianAsal commented 5 days ago

Describe the bug Can't see the Extensions Assembly Path on the Extensions dialog, as the dialog crashes

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Tools'
  2. Go to 'Extensions'
  3. Click on '/TestCentric/Engine/TypeExtensions/IAgentLauncher'
  4. Installed Extensions ListView updates Items/flashing all the time, may caught in infinite loop -> no response from tool at all -> crash of Gui

Expected behavior See the entries

Screenshots grafik

Environment (please complete the following information):

Wanted to debug the behavior but don't know where to provide the extensions. Starting the TestCentric.Gui.Exe from VisualStudio, no agent will be found and the extensions view is empty. Some help very much appreciated, as I want to have a closer look on other problems: Facing null exceptions on the gui and the agents when loading my net7.dll compiled as x86

CharliePoole commented 5 days ago

Can you try this with the latest dev build in our myget feed? Use this command

choco install testcentric-gui --version 2.0.0-dev00444 --source https://www.myget.org/F/testcentric/api/v2
rowo360 commented 3 days ago

I can confirm the described behavior using TestCentric Version 2.0.0-beta5(Release). The behavior can also be reproduced with the latest dev version (using your choco command). But surprisingly the error does not show up with my own dev build. I didn't figure out the difference.

rowo360 commented 3 days ago

@Galgemaennle: I am a newbie myself regarding the development of TestCentricGUI, so I can explain how I managed to debug TestCentric.GUI.Exe from VisualStudio. But please don't see it as some official recommendation - it's just my personal experience :-) Currently TestCentric complains about missing agents, so I copied them to the correct location. The folder for the agents are named: TestCentric.Extension.Net462PluggableAgent.2.5.0 TestCentric.Extension.Net60PluggableAgent.2.5.0 TestCentric.Extension.Net70PluggableAgent.2.5.0 TestCentric.Extension.Net80PluggableAgent.2.5.0

Those folders should already be located on your computer. When installing the TestCentric.Gui nuget package (2.0.0-beta5) they are getting deployed next to the TestCentric GUI. So I copy those folders to the output directory of my VisualStudio TestCentric.GUI project (that's "testcentric-gui\bin" in my case).

The last step is to tell TestCentric.Gui where to find these extensions: There's an additional file required for this purpose: it's called testcentric.nuget.addins I needed to create it manually (it should be next to the TestCentric.exe file - in folder testcentric-gui\bin\Debug) and add these lines: ../TestCentric.Extension.*/*/tools/ # nuget v2 layout ../../TestCentric.Extension./**/tools/ # nuget v3 layout

You should find this file also in your nuget install folder of TestCentric.GUI, so you can use this as a template. I hope this description helps you to get this working. :-)

CharliePoole commented 3 days ago

@Galgemaennle There are several potential problems here...

  1. If no extensions are installed, the dialog should just say so rather than flashing! That's one bug
  2. Four pluggable agent extensions should be installed automatically when you install the GUI via choco.exe. If not, that's also a bug.

Stuff you can try yourself:

  1. Are the choco versions of the extensions actually installed? Rather than asking the GUI, use choco.exe to list all your local extensions.
  2. If they are, uninstall and reinstall using choco.exe and check again.
  3. If they are not or if (2) didn't work, install the extensions separately using choco.exe by specifying their ids:
    • testcentric-extension-net462-pluggable-agent
    • testcentric-extension-net60-pluggable-agent
    • testcentric-extension-net70-pluggable-agent
    • testcentric-extension-net80-pluggable-agent

@rowo360 It was good of you to help out. Here's some more detail, just in case.

The packages for chocolatey and nuget are different and have different ids. (I hate this but there was no choice.) Also, the GUI and all extensions have to be installed in the same way... either via chocolatey or via nuget. Folks using chocolatey want a common install for all projects, so nothing goes in the project. Of course, anything can be made to work if you have a deep understanding of how we find extensions, but that's another matter - more for us to do in debugging the app.

All of this is stuff I'd like to make work better but sticking with either chocolatey or nuget works best at the moment.

I think the key here is figuring out if this is a bug specific to the chocolatey install.

FlorianAsal commented 2 days ago

Thanks for the fast support! First of all:

@rowo360 thanks for the hint with the addins file. I was placing the nuget packages everywhere in my output directory in the hope to catch any default path by chance. With the file, I was able to load the runners from the choco packages (as @CharliePoole mentioned, they appear to be different from the nuget packages). After loading, I directly found the bug: AutoSizeFirstColumnOfListView() is called when the selected index has changed extensionPointsListBox_SelectedIndexChanged and gets recalled by the extensionListView_Resize event. So selecting any index will result in an infinite loop resizing the list and crashing the GUI. See PR #1107 for a fix candidate

CharliePoole commented 2 days ago

@Galgamennie Could you clarify your use case for me? Are you trying to avoid installing some extensions globally via chocolatey and wanting them to be available only in a particular project? At one time I gave some thought to that but it didn't seem that there would be a need for it.

Regarding nuget vs choco packages: chocolatey requires some metadata, which nuget would reject. They also want some files, which I normally place in the root to be under tools. And they have a different naming convention for packages. But the binaries are exactly the same.

Really, it's a bit of an annoyance. I've actually considered adding a command in my scripts to take a nuget nuspec and convert it to chocolatey format.

Thanks for the PR! @rowo360 If you can review it that will be great.

FlorianAsal commented 2 days ago

My use case: getting this repo with agents running for debug purposes.

Only cloning from git results in the message: "no agents installed". Also placing the nuget packages for the agents in the output directory or in a lib directory a level above like it's done in the choco directory did not work. I thought, the search path was hard coded or something. So, I wanted to so see the install/search path of the extensions in the choco environment for further guidance - but the GUI crashed. So I ended up here asking for help.

I do know reporting this issue was a x-y problem, but also wanted to contribute to fix the bug I've investigated and not simply begging for help. Sorry for the confusion caused. Now I know, you have to provide an *.addin file with the paths to the extensions externally. Also the metadata of the nuget and the choco packages are different from each other, which makes it mandatory to add the choco packages at those locations.

Making this info public, or as @rowo360 suggested "official" could help other developers in future. As I'm still not fully aware of the logic behind, Idk if it make sense to at least check in an dummy addins file? Or a separate project with choco pipeline and default paths..

In my case, I'm able to debug my original problem now and will most likely report it in another issue. Thanks again

CharliePoole commented 2 days ago

I'll take a look at what we have documenting how extensions are found and where it is. This knowledge is somewhat esoteric and not likely to be needed by the average user but it should be available to anyone who does need it..

rowo360 commented 3 hours ago

This issue is solved by PR #1107 now - therefore closing this issue.