views:

246

answers:

2

hi,

I am new at this and I was wondering how I can setup that I save the artifacts, only if less than 90% of the tests have passed.

Any idea how I can do this?

thanks

A: 

This is not currently possible with Hudson. What is the motivation to avoid archiving artifacts on every build?

Michael Donohue
Hi Michael,we run some sanity checks to see if our environment is stable. And if everything is perfect (or almost perfect) we don't need the artifacts and the report me made (its a heavy one with plently of screenshots) and we would only like to have there report and/or artifacts when there are failures.Do you see any other way for doing this?thanks again
You could write your own plugin that does this conditional archive step - the Hudson dev list could help you with that.Without really knowing what is in your reports, I would say it is still useful to archive the successful ones. It helps when diagnosing a failure, for example, to see what the successful output was.
Michael Donohue
A: 

How about a rather simple workaround. You create a post build step (or additional build step) that calls your tests from the command line. Be sure to capture all errors so Hudson don't count it as a failure. Than you evaluate your condition and set the error level accordingly. In addition you need to save reports (probably outside hudson) before you set the error level, so they are available even or only when the build fails.

My assumption here is, that it is OK, not to run the tests when building the app fails. However, you can separate the building and testing in two jobs. See here.

Peter Schuetze

related questions