validate: launcher: Make encoding extra check use common code path

Reusing the reporting infrastructure instead of shurtcuting it
This commit is contained in:
Thibault Saunier 2019-10-04 09:59:57 -03:00
parent 8a6ee4841b
commit 562750213f
2 changed files with 38 additions and 19 deletions

View file

@ -680,13 +680,8 @@ class GstValidateTranscodingTest(GstValidateTest, GstValidateEncodingTestInterfa
return size
def check_results(self):
if self.result in [Result.FAILED, Result.TIMEOUT] or \
self.process.returncode != 0:
self.check_encoded_file()
GstValidateTest.check_results(self)
return
res, msg = self.check_encoded_file()
self.set_result(res, msg)
class GstValidateBaseRTSPTest:

View file

@ -1287,10 +1287,17 @@ class GstValidateEncodingTestInterface(object):
if orig_duration - tolerance >= duration <= orig_duration + tolerance:
os.remove(result_descriptor.get_path())
return (Result.FAILED, "Duration of encoded file is "
" wrong (%s instead of %s)" %
(utils.TIME_ARGS(duration),
utils.TIME_ARGS(orig_duration)))
self.add_report(
{
'type': 'report',
'issue-id': 'transcoded-file-wrong-duration',
'summary': 'The duration of a transcoded file doesn\'t match the duration of the original file',
'level': 'critical',
'detected-on': 'pipeline',
'details': "Duration of encoded file is " " wrong (%s instead of %s)" % (
utils.TIME_ARGS(duration), utils.TIME_ARGS(orig_duration))
}
)
else:
all_tracks_caps = result_descriptor.get_tracks_caps()
container_caps = result_descriptor.get_caps()
@ -1304,21 +1311,38 @@ class GstValidateEncodingTestInterface(object):
if wanted_caps is None:
os.remove(result_descriptor.get_path())
return (Result.FAILED,
"Found a track of type %s in the encoded files"
" but none where wanted in the encoded profile: %s"
% (track_type, self.combination))
self.add_report(
{
'type': 'report',
'issue-id': 'transcoded-file-wrong-stream-type',
'summary': 'Expected stream types during transcoding do not match expectations',
'level': 'critical',
'detected-on': 'pipeline',
'details': "Found a track of type %s in the encoded files"
" but none where wanted in the encoded profile: %s" % (
track_type, self.combination)
}
)
return
for c in cwanted_caps:
if c not in ccaps:
if not self._has_caps_type_variant(c, ccaps):
os.remove(result_descriptor.get_path())
return (Result.FAILED,
"Field: %s (from %s) not in caps of the outputed file %s"
% (wanted_caps, c, ccaps))
self.add_report(
{
'type': 'report',
'issue-id': 'transcoded-file-wrong-caps',
'summary': 'Expected stream caps during transcoding do not match expectations',
'level': 'critical',
'detected-on': 'pipeline',
'details': "Field: %s (from %s) not in caps of the outputed file %s" % (
wanted_caps, c, ccaps)
}
)
return
os.remove(result_descriptor.get_path())
return (Result.PASSED, "")
class TestsManager(Loggable):