On 12/01/2015 16:58,
Matthew...@Diamond.ac.uk wrote:
> I've just started experimenting with the Gerrit Trigger Plugin. It's great, but I have one problem:
>
> If the build job is UNSTABLE (i.e. if any tests fail) Jenkins will post this status back to Gerrit, and flag the Gerrit patchset as not passing. That strategy only works if the normal condition is "all tests pass".
Your logic is the wrong way around.
You want to mark a build with the flaky test as stable - so this would
be almost the same for a normal job with the complication that Gerrit
patchsets are not linear...
> In my case, there is a test case, unrelated to the patchset under test, that has been failing for some time. I'd like the Gerrit trigger to only mark the patchset being tested if introduces a NEW test failure. Is there a way to achieve this?
Take a look at
https://github.com/samsta/quarantine this may be the only
way of ignoring your bad test.
Note it forks the junit plugin and is probably missing features fixes in
that junit plugin.
> (Yes I do now that having failing tests that have not been fixed is poor practice, but in a large test suite, that is sometimes the case).
In this case I really would just recommend removing the test and raising
a defect for the team to fix it and tracking it that way - it will
reduce the headache (given you are not currently fixing it) and it gets
the team to accept that they can't push changes to the branch when the
code is broken.
/James