-
Notifications
You must be signed in to change notification settings - Fork 152
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
Eliminate the NetCore runner and the NUnit dotnet tool #1500
Comments
Backgound - Currently supported RunnersAs background for this discussion, here is a list of the ways nunit tests may be run using the packages we create and distribute. Third-party runners are not listed since they will not influence this decision, at least as far as we know.
This issue proposes to eliminate 3 and 4, retaining runners 1, 2 and 5. |
@manfred-brands Could you expand on your comment regarding the new MS test runners? My understanding is that this is a runner for tests using the MSTest framework. Not so? |
@CharliePoole I can answer that. And No, it is not, it is a general new testing platform. It actually does the same as we do with NUnitLite, so that the test project becomes self-executing. In order to hook this up to the existing infrastructure, they have added and adapter into the NUnit3TestAdapter, which I will try to release a beta of as soon as I can. The test project is still selfexecuting, but will actually work through the NUnit3TestAdapter to hook into Visual Studio and dotnet test. |
@OsirisTerje I can't find any link to the general platform, just the MSTest blog post describing executable tests as a new and brilliant idea they just invented. :-) Is the more general thing publicly announced anywhere? |
thanks for tagging and informing me. Eliminating 3 would also mean eliminating the .net version specific agents and eliminating the option to create an ITestRunner using TestEngineActivator.CreateInstance().GetRunner(new TestPackage(dllfile)) ? Of course, this would completely brake my use case. In my use case, I create a console application which creates an ITestRunner as mentioned above. Let me give some insights regarding my motivation and use case and why not using your agent or console:
Edit: After re-reading your summary and my comment and discussing with my colleagues, I assume if you still provide the agents targeting net8.0 in Option 2 (and net9.0 ;) ), I still can use my own agent. Please inform me as soon as a working dev build is available. I will test it asap and give feedback. |
Thank you @CharliePoole for adding me. I share @OsirisTerje's opinion on that for the most part. It's straightforward to install, and it would be sad if the .NET tool were gone. It's very convenient for our case to have it. With 18 Windows machines running UI tests, all we need to do to update the NUnitConsole, is to bump up the version number in a tool manifest of repo. It's also not an issue to go back to a previous version when needed. Without it, we either have to work out an automatic way to provision all the machines (current and new) with a version of NUnitConsole, or update the Windows installation image which is not a straightforward process. |
@MichalMucek For my understanding, why can you not use |
@Sputnik24 This issue proposes to remove the .NET Core builds of the console runner. It does not affect the engine at all. It also doesn't affect the existing "standard" runner (i.e. the console runner currently built under .NET framework which uses agents to run tests). Users would be left with one less way to run tests, but all targets currently supported would be supported. Those using the dotnet CLI would lose dotnet nunit but continue to use dotnet test, which relies on the adapter and the agent. We're looking for input from those who would potentially suffer from that change before making a final decision, but your use case of creating your own runner would not be affected. It's a bit off topic for this issue, but fwiw the existing console runner (option 2) also reverses the typical client server model. It's agents are clients, which connect back to it for instructions. Communication is via TCP or Remoting at this time but the design allows alternate protocols to be added. |
@MichalMucek From the development point of view, I think it would be better to spend time migrating the standard runner to .NET 8.0 or higher rather than continuing to maintain 2 or 3 different builds of the runner each with different capabilities. Of course, if more people were working on this, that may be less of an issue. |
I know, that's why I mentioned that I reversed the client/server logic of your agent and had to develop my own agent being the server. So, to sum up, I would not be affected by this change. Again, thanks a lot for informing me. |
Better filtering. It allows filtering the SpecFlow BDD tests by the examples. It's convenient and useful because different examples may have different categories. |
I am not a Specflow guy. Can you show how you call the console "by examples"? |
@MichalMucek Is filtering any different using SpecFlow vs NUnit by itself? |
@OsirisTerje To be precise, I mean filtering and listing (exploring in terms of NUnit). Let's consider the below test case in the Gherkin language based on an imaginary PrinerHelper application:
Having two PCs, each with a printer connected using a different cable (PC1 - USB; PC2 - Serial). We want to run a specific example on a particular PC. Otherwise, the scenario will fail when running every example on each machine. To resolve it, we have to run each example separately and NUnitConsole allows that. Let's say there are about 800 scenarios with similar examples and we add more PCs to speed up the execution. With the below command, we're able to obtain the IDs (they're the key) and test method names of scenario examples with @serial category. Obtained list can be split into smaller lists that could run in parallel on multiple PCs/agents.
Edit: I forgot to mention that SpecFlow is responsible for generating C# code with test methods from the scenarios written in Gherkin language. Test steps are bonded with methods written in C#. |
@MichalMucek What I'm missing is this... what prevents you from using the standard console runner to generate your test lists? |
To be fair, there is no actual blocker for us. We prefer using the .NET tool because of its ease of installation in our test environment. Implementation-, maintenance-, and time-wise it is cheaper. Relying on the standard executable would mean either a few hours spent each time when updating the Windows installation image with a new version of the Console, or creating a custom way of provisioning automatically Windows machines with NUnitConsole. Chocolatey is a no-go for us in our test environment due to network infrastructure restrictions. We execute the tests using the Console. SpecFlow alone can't do that. https://docs.specflow.org/projects/specflow/en/latest/Execution/Executing-SpecFlow-Scenarios.html BTW SpecFlow development is practically abandoned. It has been taken over by fork project Reqnroll. |
That clears up some things for me, but the looking at the SpecFlow docs confused me. :-( Their docs state that for test discovery and execution, you need
That implies use of Thanks for the info about Reqnroll. I'll take a look at that - maybe the that team will be a bit more transparent than SpecFlow was since they are eliminating the non-open components. |
I'm reaching the conclusion that we can't really get rid of the tool at the moment for two main reasons:
I'd like to do this in a way that minimizes the level of effort we put in, so I'm suggesting the following for 3.19...
The following items are more properly part of issue #1492, so I'll repeat and enlarge on them there.
It may also be helpful to consider adding better filtering to our support of What does everyone think of the above as a resolution? |
I believe what you write is sound. I agree. But |
I'll move on to issue #1492 and continue to build out a plan for 3.19. It looks like this one can be closed, but I'll let it sit for a few days to see if there are any other responses, esp. from @MichalMucek regarding the --where filter. |
Discussion under #1493 have led to this decision. I'll excerpt some of it here so all the discussion can be in one place.
@manfred-brands commented:
@CharliePoole commented:
@OsirisTerje commented:
@CharliePoole commented:
This is an important decision so we want everyone affected to have a chance to express their opinions. In addition to @OsirisTerje and the rest of the @nunit team, the following folks are mentioned because they were recently involved in discussions about the netcore runner: @MichalMucek @kogoel @bouchraRekhadda @Sputnik24
Of course, anybody who uses it is welcome to comment.
The text was updated successfully, but these errors were encountered: