PowerShell Task Fails Build If There Is Standard Error Output

28 views
Skip to first unread message

Aaron Jensen

unread,
Mar 15, 2013, 8:18:32 PM3/15/13
to ccnet...@googlegroups.com
I recently filed bug PowerShell task fails if there is any output to standard error.  I think this is a breaking-change with previous versions of CCNet. We were on 1.6 and upgraded to 1.8.3.  After the upgrade, a build which runs some PowerShell tests started failing, even though not tests were failing.  When I look at the code (PowerShellTask.cs, bool Execute(IIntegrationResult) , line 230)), I see this [1]:

ProcessResult newResult = new ProcessResult(
        MakeBuildResult(processResult.StandardOutput, string.Empty),
        MakeBuildResult(processResult.StandardError, "Error"),
        processResult.ExitCode,
        processResult.TimedOut,
        processResult.Failed || !StringUtil.IsWhitespace(processResult.StandardError));

processResult = newResult;

Errors in PowerShell mean what users want them to mean. For some builds, errors are OK.  For others, errors should fail the build.  I think looking at standard error is a good idea, I just don't like that it changed from 1.6.  I'd like to turn this behavior into a configurable option and revert default behaviro back to v1.6? For example,

<failWhenErrors>true</failWhenErrors>

I know that's not the best name and am open to suggestions. If we can decide on a name, I'm happy to code it up and contribute it back to the project.


[1] The somewhat equivalent Executable task doesn't behave this way.  It ignores standard error when determing a task's result (ExecutableTask, bool Execute(IIntegrationResult), line 233):

ProcessResult newResult = new ProcessResult(
        StringUtil.MakeBuildResult(processResult.StandardOutput, string.Empty, this),
        StringUtil.MakeBuildResult(processResult.StandardError, "Error", this),
        processResult.ExitCode,
        processResult.TimedOut,
        processResult.Failed);

Ruben Willems

unread,
Sep 17, 2013, 7:20:28 AM9/17/13
to ccnet-devel
Hi

can you follow up on the issue :
http://www.cruisecontrolnet.org/issues/269



with kind regards
Ruben Willems


--
 
---
You received this message because you are subscribed to the Google Groups "ccnet-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ccnet-devel...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages