-
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
testcentric-gui and extensions #670
Comments
The code for the extension dll looks like this: [Extension] public void WriteResultFile(XmlNode resultNode, string outputPath) public void WriteResultFile(XmlNode resultNode, TextWriter writer) [TypeExtensionPoint(Description = "Supplies a writer to write the result of a test to a file using a specific format.")] |
The outline of your definition of the extension looks OK to me. However, you should not be defining |
You were right. that was the mistake. Thank you very very much. I looked for my mistake for three days. I am so happy now. Thanks alot. |
Unfortunately, I am already facing the next problem. I also wanted to add an EventListener as an addin. Did this exactly as with the result writer. Just use the example from the NUnit page: [Extension(Description = "Test Reporter Extension", EngineVersion = "3.4")] What am I doing wrong here? I also changed the version to 3.11, 3.11.1 and 3.11.1.0, but the extension is not displayed in the Gui. |
The next problem is that the ResultWriter extension is not running. Do I have to specify a value for the property values as in the description for Nunit? |
There is no such option to the GUI. Use It seems that the dialog used for saving results needs to include a Shall we rename this issue to track that change or shall I create a new one while we keep using this to discuss your overall problems with extensions? |
Re your test writer extension: Why are you specifying a minimum engine version at all? |
You are welcome to open a new case where we can discuss everything. That would be very nice. |
The problem with the EventListener has been resolved. I thought I had to bring in this trait. I had only used the basic example from the NUnit page. But if I leave the properties out it works and my code is even executed :-) |
I'm making a note to test setting the minimum engine version. However, it could be that your problem resulted from simply not specifying the correct engine version, which is not related to the NUnit framework version. The minimum version should only be specified if you require some feature not present in earlier engine versions. I doubt that's the case here. |
I opened a new issue to track setting the format and labeled this issue as a Question - or series of Qs. 😄 |
Yes, you are right. I don't need the version. Without specifying the version, everything works as I want it to. Many thanks for the help. |
A question about extensions using IResultWriter: When you need to specify the location and format [ExtensionProperty ("Format", "custom")] how and where can this be specified? As I said, I call up the tests via a cmd file and you can't pass this specification there. Info: |
@cowinnie That's why I created issue #671 For the result writer, the user needs to be able to specify that the format should be "custom". In the GUI, the natural place to do that is when specifying the location to save the XML. If you have further questions or comments about that issue, we should discuss them there. Each type of extension is called at a particular point. The ITestEventListener is the only one that called during the running of the tests. It's not suitable for things that are done before the tests start or after the test run is complete. Saving the result file only happens after the test run is over. You could have some sort of a log that you created while the test was running, but won't have any effect on the NUnit result file. Note that the description of how to create a ResultWriter extension on nunit.org is only referring to how a batch command-line runner like nunit3-console could specify the format to be used. The NUnit project, of course, doesn't have a GUI runner. The current version 1 GUI isn't really intended to be used as a batch runner in a CI environment. I plan to expand its capabilities for version 2, in which case a command-line option may make more sense. |
One other question. I hope the last one ;-) Maybe I am asking in the wrong place, but maybe you also have an idea? Resolve failed: nunit.framework, Version = 3.13.0.0, Culture = neutral, PublicKeyToken = 2638cd05610744eb This line makes up more than half of the entire log file. |
Since this is appearing in your own log file, you would have to control it somehow in your own code. My guess is that you are using an assembly resolve hook in the AppDomain where the test is running. So it's a question of how your code interacts with NUnit. And of course, the nunit framework has nothing to do with TestCentric. I'll mark this question closed for now, but if you need to follow-up, I'll still see it here. |
Hello,
I have a question about installing extensions in Testcenric. I followed everything exactly as it can be found in the instructions for NUnit3 and testcentric. I wrote an extension with the interface IResultWriter. I put this dll in an addins folder and specified the relative path to it in the .addins file. Everything in the Nunit directory (unzipped zip file version 1.6.1). When I start Testcentric's exe and find the dll, the GUI does not open. If no dll is found, the GUI opens. Can I look up where the problem is, e.g. in a log file? I use version 3.13.0 for NUnit. The actual unit tests are also running, but I don't have any extensions to run. What I simply want is an output of the unit test results as xml.
Can anyone help me further?
The text was updated successfully, but these errors were encountered: