Add support for multiple reruns on failed runs
We enforce them to be always between 1 and 9 and junit only processes the result from the last ones, although all them are sent to the Amazon bucket for later inspections.
Note that this requires 1 change to moodle-ci-runner providing the ability to perform N reruns, it has been already tested with 5 reruns:
- https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/6393/
- https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/6397/
- https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/6398/
Commit, for reference: https://github.com/moodlehq/moodle-ci-runner/compare/3d1ff1c~1...3d1ff1c?w=1 (excluding whitespace changes because they are misleading)
Once both moodle-ci-runner and this are applied... the jenkins junit plugin will start to process only the last-rerun junit results, ignoring everything else. Note that, still, all the junit files are sent normally to AWS as they were before.
This has been tested (using @Library('ci@multiple_reruns') _
) in a custom job @ jenkins with all the possible combinations:
- No parallel runs, both with and without reruns.
- Parallel runs, both with and without reruns.
Always verifying that the junit results are the correct ones, that files are sent to S3 properly and that artifacts @ Ci are the correct too.