-
Notifications
You must be signed in to change notification settings - Fork 31
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
IDriverFactory extension does not yet work correctly #1088
Comments
You are correct. Most extensions are intended to be loaded by the engine itself in the same process as the GUI. The drive extension is currently the only exception. It really should not be considered an "engine" extension but an agent extension. In beta5, we don't currently yet that extension and I probably should have documented that somewhere. From the information you give, I can't locate the code you modified. Are you working from the current master or the source code for the beta5 release? The code is constantly changing and the current master has changed a great deal since beta5. If you can post further details I'll comment further. That said, if such a simple change makes your extension load and run, I would suggest using it but watching out for changes in the future. I'm renaming this issue for use in tracking the fact that the IDriverFactory extension does not yet work. |
Thanks for the explanation and the details about the IDriverFactory extension. So I seen now, that this extension point is a little different than the other extension points and it's OK to add special handling for it. I started to work on beta5 release, but finally switched to the current master. This issue exists on both builds. However I was a little inaccurate by talking about the TestCentricGUI, because my fix is located in the project TestCentric.Agent.Core. And I would call it more a 'proof-of-concept': if we pass in the TestCentric.Engine.Api assembly to the ExtensionManager, the Manager is capable to extract the extension point IDriverFactory - that will work fine! I'm working with screenshots now, because I did not manage to push to the server: Finally there's one more challenging question in my mind: |
TestCentric.Agent.Core is a common file shared by all pluggable TC agents, i.e. all TC agents as they are all pluggable. :-) In beta5, only TestCentric agents are supported. In the current master, I'm working one at a time to get those agents defined by the NUnit api supported. Once that happens, I'll remove the TC api interface definitions. As noted, the IDriverFactory extension point is unique because it isn't really used by the engine itself but only by agents. In future there could be more such extension points. This could be a good area for you to work on but it's not quite ready to be worked. There are a few preliminary things to do, which I'll send your way separately. |
Description
I made an attempt to activate a IDriverFactory extension using TestCentric-Gui 2.0.0-beta5 - unfortunately without success. While trying to get it activated, I searched for the missing detail and also looked into the TestCentric source code and log files. Finally I came to the conclusion that there's a gap in the TestCentric agent for this use case, so I raised this bug. But please review my attempt in general, if I'm on the right track.
Overview
The IDriverFactory extension is successfully detected by the TestCentric GUI. It's listed in the extension dialog with the state enabled. However the agent fails to load the IDriverFactory and there's an error message in the GUI while loading a test.
Exception callstack:
IDriverFactory implementation
../MyTestCentricAddin/*.dll
TestCentric.Extension.Net462PluggableAgent.2.5.0\tools\agent
And contains a similar line:
../../../MyTestCentricAddin/*.dll
My assumption was that these steps would be sufficient to enable the extension also for the agent.
Observations
I'm adding some observations from analyzing this issue - it might be helpful.
I activated the detailed logging and compared the log file from the agent with the log file from the GUI:
Here's the essential part from the GUI log file:
21:45:39.493 Info [ 1] ServiceManager: Initializing ExtensionService
21:45:39.493 Info [ 1] ExtensionManager: Initializing ExtensionPoints...
21:45:39.493 Info [ 1] ExtensionManager: Assembly: testcentric.engine
21:45:39.493 Info [ 1] ExtensionManager: Assembly: TestCentric.Engine.Api
21:45:39.493 Info [ 1] ExtensionManager: Found Path=/TestCentric/Engine/TypeExtensions/ITestEventListener, Type=TestCentric.Engine.ITestEventListener
21:45:39.493 Info [ 1] ExtensionManager: Found Path=/TestCentric/Engine/TypeExtensions/IService, Type=TestCentric.Engine.Services.IService
21:45:39.493 Info [ 1] ExtensionManager: Found Path=/TestCentric/Engine/TypeExtensions/IAgentLauncher, Type=TestCentric.Engine.Extensibility.IAgentLauncher
21:45:39.493 Info [ 1] ExtensionManager: Found Path=/TestCentric/Engine/TypeExtensions/IDriverFactory,
...
And here's the log file from the agent:
21:45:40.497 Debug [ 5] DriverService: Creating ExtensionManager
21:45:40.497 Debug [ 5] DriverService: Initializing ExtensionManager
21:45:40.497 Info [ 5] ExtensionManager: Initializing ExtensionPoints...
21:45:40.497 Info [ 5] ExtensionManager: Assembly: TestCentric.Agent.Core
21:45:40.497 Info [ 5] ExtensionManager: Found Path=/NUnit/Engine/NUnitV2Driver, Type=TestCentric.Engine.Extensibility.IFrameworkDriver
21:45:40.497 Info [ 5] ExtensionManager: Initializing Extensions...
...
From my point of view the essential difference is the set of assemblies which are used by the ExtensionManager to get the list of available extension points. The GUI uses the assembly TestCentric.Engine.Api whereas the agent only uses the assembly TestCentric.Agent.Core. So overall the agent is not aware of the extension point IDriverFactory and cannot load the extension properly.
I also had a quick look into the code base and noticed the construction of the ExtensionManager here:
TestCentric.Agent.Core\Drivers\DriverService.cs
And yes indeed, here only the TestCentric.Agent.Core assemby is passed in.
As a final step I extended this line by passing in the TestCentric.Engine.Api assembly additionally and by that the extension gets successfuly loaded and also be invoked during test execution.
However I have no clue if this is a suitable fix at all and if it fits into the general concepts, it was just an attempt. But overall I hope that these observations help to narrow down this issue.
Environment
The text was updated successfully, but these errors were encountered: