validate:launcher: Allow disabling using the number of failed tests as exitcode
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 6 Sep 2017 19:35:25 +0000 (16:35 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 6 Sep 2017 19:38:39 +0000 (16:38 -0300)
This is usefull on CI servers where the test results will be inspected
and the status of the build built from it.

validate/launcher/main.py

index 6baadff..81004ba 100644 (file)
@@ -494,6 +494,9 @@ Note that all testsuite should be inside python modules, so the directory should
                            help="Number of tests to execute simultaneously"
                            " (Defaults to number of cores of the processor)",
                            type=int)
+    dir_group.add_argument("--ignore-numfailures", dest="ignore_numfailures",
+                           help="Ignore the number of failed test in exit code",
+                           default=False, action='store_true')
 
     http_server_group = parser.add_argument_group(
         "Handle the HTTP server to be created")
@@ -595,6 +598,8 @@ Note that all testsuite should be inside python modules, so the directory should
         pass
     finally:
         res = tests_launcher.final_report()
+        if options.ignore_numfailures:
+            res = 0
         tests_launcher.clean_tests()
         httpsrv.stop()
         vfb_server.stop()