Open eatdrinksleepcode opened 9 years ago
Hi @eatdrinksleepcode, thanks for raising this, it's an interesting proposal. In response to your points:
Another thing to consider is that it will be easier to support both xunit 1.x and 2.x in Bau.Xunit if command line execution is being used. If it were in-process, we'd have to reference both the relevant 1.x and 2.x assemblies and this would likely involve more 1.x/2.x abstraction in our code. I suspect that the best solution here would be to have separate xunit 1.x and xunit 2.x Bau plugins.
Also, given that the move from xunit 1.x to 2.0 is the driver behind this, it's worth remembering that this is the first time in xunit's history that such a breaking change has been made, and xunit 3.0 is not coming any time soon. The intention is for xunit 2.0 to live for a very long time.
Ultimately, it's a trade off between tight/loose coupling and the benefits/costs associated with each. Right now I'm not really seeing enough benefit from the move from loose coupling (external process via command line) to tight coupling (internal via API).
Of course, you are more than welcome to offer your own alternate in-process xunit plugin for Bau on NuGet. In fact, this would be a good way to test and prove the approach which, if successful, could be adopted by the official package later.
I am willing to prove out my recommended approach in a separate plugin. But it may be a while before I can get to that.
@eatdrinksleepcode you make some interesting points. I must admit the world of DNX etc. is still somewhat mysterious to me. One thing to bear in mind is that if you run in-process, you are tied to whatever runtime scriptcs, and therefore Bau, is executing under. I think if you launch a separate process there may be more scope for choosing which runtime under which to execute your tests. The general idea of Bau is not really to invoke the software under test within the same runtime as Bau is running, but I can see that in some cases this may be desirable. I think, for now, this is probably best placed as an alternative xunit plug in for Bau. If the approach is proven and turns out to be better than Bau.Xunit, which for now will remain an out of process plug in, then I'll be more than happy to deprecate Bau.Xunit and recommend the in-process plug in instead.
I must admit the world of DNX etc. is still somewhat mysterious to me.
DNX is still pretty mysterious to me too :) That being said, I am pretty excited about the potential, and I would really like to see Bau support it.
The general idea of Bau is not really to invoke the software under test within the same runtime as Bau is running, but I can see that in some cases this may be desirable.
Where applicable, I have always run my build with the same runtime that I use to compile/test/run my app. I don't see much advantage to doing otherwise, and it makes things so much simpler than having to manage multiple runtimes. I can't say there would never be a case in which you might want to invoke your build under a different runtime than your app, but I would think that would be the exception, not the rule.
If the approach is proven and turns out to be better than Bau.Xunit, which for now will remain an out of process plug in, then I'll be more than happy to deprecate Bau.Xunit and recommend the in-process plug in instead.
Fair enough.
Currently the Xunit task Xunit as an external process. This has a number of downsides:
1) The task must detect what runtime to use in order to launch the process. Both the detection and the specification of the runtime are prone to error. 2) The task is vulnerable to changes in the command line syntax (#195). 3) There is extra overhead in launching and waiting for the external process.
An alternative approach would be to execute in-process with Bau. This is the default approach taken by both Maven and Gradle when running JUnit tests, and it avoids the downsides noted above (most importantly the error-prone runtime detection and specification).