-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
NUnit runner: Handle specific non-zero exit codes #517
Comments
Also, here's the relevant source code for the NUnit runner (v2.6.4): According to the source (Line 183), it appears that a return code > 0 is the sum of the count of errors, failures, and non-runnable tests: |
I didn't know this. Excellent that you added an issue about this 👍 It might make sense to add a virtual member to |
It is the same for NUnit 3. A positive return code is the number of failed tests, a negative return code is an error. |
Has anybody made any progress yet regarding this issue? We are currently facing this problem on our build server and since I have only access to the web interface, I have no clue what actually goes wrong. I tried to hack on this a little bit this evening, but in the end I couldn't test it anymore. 😲 My first idea was to redirect the overall output of NUnit to the console, since the only information we get at the moment is the above mentioned error (no other NUnit output 😒). This seems to be due to the Be aware that I just traced that visually, since I have my developer machine not at hands right now. 😄 |
@molehillrocker What CI server you using? Most output the buildlog. You could redirect all output via the bootstrapper to a file like I do here Also if you set verbosity of cake to diagnostic you will see how it's launched. |
We're using TFS 2015. Until friday I'm out of office, so I can't give you the real log output. But IIRC, it was something like:
Previous tasks such as the build task were logged with lots of details, which is why I assumed that setting |
Actually by setting RedirectStandardOutput it won't output anything as it's redirected to an buffer that needs to be enumerated. By default all tools should be outputted to the console. |
When I run it locally, it works fine. It is included via package.config. |
Back in the office, this is the log output from our TFS 2015:
I'm trying to dig deeper into this now. |
Could you turn on diagnostic logging with Cake (by passing the Also which version of Cake and NUnit are you running? Launching Cake with Also if you check the NUnit3 aliases you can pass an NUnit3Settings, on this you can specify an ErrorOutputFile and Verbose to get more info about what's going on. |
I installed a build of Cake from the develop branch (where the error code is printed) and found out that the process returns error code In addition, on our build server, only .NET framework 4.6 seems to be installed (if I try to build with any other option than So I guess I should install either an older framework version on the build server to support NUnit 2.6.4 or migrate to NUnit 3.0.1. |
After migrating our Cake build script to use NUnit3 instead of NUnit and replacing |
@molehillrocker superb 👍 |
I'd be interested in taking a look at this. We wrote some new scripts for the NUnit code samples recently, and it was this limitation which meant we decided to use NUnit via the console, instead of the tool.
@patriksvensson - I'm not yet familiar with Cake's internal tool architecture, and it sounds like you have some ideas - mind posting a rough overview of what you'd expect this to look like? |
@jrnail23 this should be in the next release of Cake, big thanks to @ChrisMaddock |
Right now, any time the NUnit console tool returns a non-zero exit code, the Cake NUnit runner throws a
CakeException
with the less-than-helpful error message,NUnit: Process returned an error.
I think this behavior is too broad, as it treats failed tests the same as an unexpected problem.
I'd like the flexibility to decide whether to blow up my build based on test failures, errors, etc.
NUnit does have meaningful exit codes (discussed here), so we should throw more specific exceptions as appropriate.
The text was updated successfully, but these errors were encountered: