validate:launcher: Add a way to define test timeout from dicts
authorThibault Saunier <tsaunier@igalia.com>
Tue, 17 Mar 2020 15:19:46 +0000 (12:19 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 23 Oct 2020 15:18:21 +0000 (12:18 -0300)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/172>

validate/launcher/apps/gstvalidate.py

index aa11b16..f8f0513 100644 (file)
@@ -265,6 +265,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
 
             config_files = {}
             config = defs.pop('config', None)
+            timeout = defs.pop('timeout', DEFAULT_TIMEOUT)
             scenario_defs = defs.pop('scenarios', [])
             if not scenario_defs and config:
                 config_files[None] = cls.get_config_file(config, test_private_dir, test_name, extra_data)
@@ -302,6 +303,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
                 'config_files': config_files,
                 'plays-reverse': True,
                 'extra_env_vars': envvars,
+                'timeout': timeout,
             })
 
             expand_vars_in_dict_recurse(local_extra_data, extra_data)
@@ -360,6 +362,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
                 scenarios_to_iterate = scenarios
 
             config_files = extra_data.get('config_files')
+            timeout = extra_data.get('timeout', DEFAULT_TIMEOUT)
             mediainfo = extra_data.get(
                 'media_info', FakeMediaDescriptor(extra_data, pipeline))
             for scenario in scenarios_to_iterate:
@@ -395,6 +398,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
                                              self.test_manager.reporter,
                                              pipeline_desc,
                                              scenario=scenario,
+                                             timeout=timeout,
                                              media_descriptor=mediainfo,
                                              expected_issues=expected_issues,
                                              extra_env_variables=extra_env_vars)