Have you thought about changing the logic.

 Make the xunit mark the build as unstable and then fail if there are more 
than N.

 That way you adhere to only changing the result on X failure and also only 
change the result from better to worse.

 There was a reason why this was implemented – I can’t recall it but if you 
search the history of the code that has the check the commit comment will 
probably tell you why.

 /James

On Tuesday, 10 September 2013 15:15:58 UTC+1, Mads Nielsen wrote:
>
> Hey everyone,
>
> I'm trying to create a plugin that should be able to override the result 
> of a given build (to be specific it's the JUnit plugin and xUnit projects 
> TestResultAction(s), but when looking at setResult(Result r) from the Run 
> class, it seems to include a check to see if the value you're trying to set 
> is worse than the current startus, meaning you can't really change a build 
> from FAILURE --> UNSTABLE for example. 
>
> Is there another way in which to 'intercept' or change this behaviour. The 
> reason for this is that it would allow me to create a very simple plugin 
> with xUnit as a dependency, but given that feature, i'd have to modify the 
> xUnit plugin to get my feature in place.
>
> Basically, it's because i want to only fail builds on repeat test-failures 
> (n-amount of failures in the last n-builds),
>
> Any help would be much appreciated!
>
> P.S would a method called setResultForce() be feasible in the future for 
> Jenkins?
>
> Best regards,
> Mads
>
> -- 
> *
> * 
> *Mads Nielsen
> Consultant
> Praqma A/S
> *
>
> *Tel: +45 50 98 18 09
> Mail: m...@praqma.net <javascript:>
> web: www.praqma.net*
>  

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

Reply via email to