huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Failed builds do not upload an artifact #209

Closed johnqa closed 2 years ago

johnqa commented 2 years ago

Hi,

I am using this task in a Release, in order to trigger some builds that execute different kind of tests. I use the functionality to download the build artifacts but this does not work when the build is failed due to failing tests (that fail tasks inside the build).

This is an issue because I cannot retrieve the results of tests executions.

Thank you, John

huserben commented 2 years ago

Hi @johnqa

Yes downloading artifacts currently is only supported if the build that is triggered did not fail. You could setup the triggered builds not to fail on a failing test but instead mark it as "partially successful". Then you can setup the trigger build task to treat partially successful builds as successful and then download the artifacts.

I think that could work, so maybe you can give this a try?

Edit: Another option that should work and maybe is easier is to not fail the task if the triggered builds fail. You are able to wait for the builds to complete but not fail the tasks in this case. That way you would not need to adjust your other pipelines.

johnqa commented 2 years ago

Hi,

I have tried your suggestions but without success.

First of all for some tools and ways of executing tests there is no option (at least that I know of) to make the task not fail so this cannot apply.

Secondly the other option to not fail the task if the triggered build fails, does not allows to have the artifact downloaded. The check box for download artifact is only visible if "Fail the build if the tasks were not successful" is checked.

Thanks for having a look.

huserben commented 2 years ago

Ok, sorry I was not aware that I've set it up like this.

I'm planning on creating a new version in the coming days, so I could remove that check. However it would of course be "use at your own risk" as the artifacts might not be available if the build fails (so whatever artifact you need you must make sure they are uploaded). I don't plan on adding any extensive error handling, so if the artifacts are not available I assume it will fail.

Would that work for you like that?

johnqa commented 2 years ago

Hi, it would be great like that.

huserben commented 2 years ago

Hi @johnqa

I've uploaded a new version of the task that removes the constraint - now artifacts can be downloaded as long as we're waiting for the build to finish, but independent of the builds success.

Would you please let me know whether this works for you now?

Thanks for your help.

johnqa commented 2 years ago

Hi, It works nicely, thank you.