Jenkins should report test results to Gitlab MR
When Jenkins runs the test suite for a branch for which there is an open MR, it should, ideally:
- find the appropriate MR. Using the gitlab API, it shouldn't be hard to find that:
GET /merge_requests?source_branch=123-fix-this-and-that
- find if the Jenkins user itself has already reported a comment (Discussion, in gitlab API) on that MR. If so, edit it. Otherwise, add a new one
- Write useful information to it:
- a link to the right Jenkins page
- results of the last suite run: how many failures?
- some aggregated analysis. For example "no test run was all-green, but every scenario has been all-green at least once".
- Flag the thread as resolved/unresolved appropriately, so that the reviewer can't just ignore this data
This seems to be actually better than using Gitlab CI Pipelines, even if that is counter-intuitive. In fact:
- a pipeline doesn't seem to be fit for including new test runs. In fact, we re-test a branch once a day, plus any other run that the developer might trigger
- reaching the data from gitlab pipeline requires many more clicks, and lookig at a complex report from there is not great
- we expect the API for editing a note to be much easier
Edited by boyska