Fix testnode watching repositories when HEAD is a merge commit

and a few cleanups in test suite

See merge request !1126
5 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Master

00:52:43

failed ERP5.PerformanceTest-Master

00:35:25

failed ERP5.UnitTest-Master

01:44:01

passed SlapOS.Eggs.UnitTest-Master.Python2

01:06:23

passed SlapOS.Eggs.UnitTest-Master.Python3

00:33:05