I've started lately to use Jenkins and i need some help with creating a pipeline.

I want to create the following pipeline:
For each merge request from develop to master in Gitlab, Trigger a Jenkins job that run an end-to-end test, And merge the branches in Gitlab only if the test succeeded.

I have found the following article that gives me an explanation for most of the things that i need:
<https://vetlugin.wordpress.com/2017/01/31/guide-jenkins-pipeline-merge-requests/>

I'm still looking for an answer for one question:
How can Jenkins response to Gitlab with the result of the end-to-end test (Success/Fail), So Gitlab will know whether to merge to branches or not?

Please advise,
Thanks!