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.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);