Change PowerShell Task Behaviro of Failinl on Errors a Configurable Option

7 views
Skip to first unread message

Jensen, Aaron

unread,
Mar 18, 2013, 2:37:47 PM3/18/13
to ccnet...@googlegroups.com, ccnet-devel (ccnet-devel@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 no 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));

 

Errors in PowerShell mean only what I the user wants them to mean.  For some builds, errors are OK.  For others, errors should fail the build.  I think being able to fail a build if there are errors is a good change, advantages, I just don't like that it breaks behavior in 1.6.  Anyway we can make this a configuration option and revert back to 1.6 behavior? 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.

 

Sorry for the cross post.  I signed up for and posted this on the ccnet-devel list on Friday, but my message seems to have disappeared.

 

     <:> Aaron

 

 

[1] For contrast, the Executable task doesn’t behave this way (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);

 

 

Reply all
Reply to author
Forward
0 new messages