validate: Pipe debug output to a file when discovering scenarios
authorThibault Saunier <tsaunier@igalia.com>
Fri, 3 Jul 2020 22:00:39 +0000 (18:00 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Thu, 30 Jul 2020 22:44:13 +0000 (18:44 -0400)
Otherwise `gst-validate-launcher` can get veeery noisy

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/198>

tests/validate/geslaunch.py

index c081922..289e0d0 100644 (file)
@@ -21,6 +21,7 @@
 
 import os
 import sys
+import tempfile
 import urllib.parse
 import subprocess
 from launcher import utils
@@ -263,12 +264,12 @@ class GESTestsManager(TestsManager):
 
     def init(self):
         try:
-            if "--set-scenario=" in subprocess.check_output([GES_LAUNCH_COMMAND, "--help"]).decode():
-
-                return True
-            else:
-                self.warning("Can not use ges-launch, it seems not to be compiled against"
-                             " gst-validate")
+            with tempfile.NamedTemporaryFile() as f:
+                if "--set-scenario=" in subprocess.check_output([GES_LAUNCH_COMMAND, "--help"], stderr=f).decode():
+                    return True
+                else:
+                    self.warning("Can not use ges-launch, it seems not to be compiled against"
+                                " gst-validate")
         except subprocess.CalledProcessError as e:
             self.warning("Can not use ges-launch: %s" % e)
         except OSError as e: