Commit f683c4f1 authored by Jan Kiene's avatar Jan Kiene
Browse files

some improvements for error reporting in especially sanitizer jobs

parent a53d7b54
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@
# note: per convention, this file is placed in the root directory of the repository
[pytest]
addopts = --tb=short -n auto -v
# Write captured system-out log messages to JUnit report.
junit_logging = system-out
# Write all captured output to JUnit report.
junit_logging = all
# Do not capture log information for passing tests to JUnit report.
junit_log_passing_tests = False
junit_duration_report = call
+31 −31
Original line number Diff line number Diff line
@@ -44,9 +44,9 @@ from pyaudio3dtools.audioarray import getdelay

def compare_audio_arrays(
    left: np.ndarray, left_fs: int, right: np.ndarray, right_fs: int
) -> Tuple[float, float]:
) -> Tuple[float, float, float]:
    if left_fs != right_fs:
        return ValueError(f"Differing samplerates: {left_fs} vs {right_fs}!")
        raise ValueError(f"Differing samplerates: {left_fs} vs {right_fs}!")

    if left.shape[1] != right.shape[1]:
        cmp_ch = min(left.shape[1], right.shape[1])
+14 −8
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ from pyaudio3dtools.audiofile import readfile
from ..cmp_pcm import cmp_pcm
from ..conftest import get_split_idx, parse_properties


def _run_cmd(cmd, test_info=None, env=None):
    """
    Helper function for running some command.
@@ -80,6 +81,8 @@ def _run_cmd(cmd, test_info=None, env=None ):
    # check for USAN error first
    if "UndefinedBehaviorSanitizer" in stdout:
        error = f"USAN error detected in stdout of command: {' '.join(cmd)}\n{stdout}"
        # print for getting the info into the system-out tag in the XML reports
        print(error)
        if test_info is not None:
            test_info.error = error
        raise SystemError(error)
@@ -89,6 +92,8 @@ def _run_cmd(cmd, test_info=None, env=None ):
        proc.check_returncode()
    except sp.CalledProcessError as e:
        error = f"Command returned non-zero exit status ({e.returncode}): {' '.join(e.cmd)}\n{e.stderr}\n{e.stdout}"
        # print for getting the info into the system-out tag in the XML reports
        print(error)
        if test_info is not None:
            test_info.error = error
        raise SystemError(error)
@@ -108,6 +113,7 @@ def run_ivas_isar_enc_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning IVAS ISAR encoder command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, test_info=test_info, env=env)


def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None):
    if BIN_SUFFIX_MERGETARGET in cmd[0]:
        logging.info(f"\nREF decoder command:\n\t{' '.join(cmd)}\n")
@@ -115,6 +121,7 @@ def run_ivas_isar_dec_cmd(cmd, test_info=None, env=None):
        logging.info(f"\nDUT decoder command:\n\t{' '.join(cmd)}\n")
    _run_cmd(cmd, test_info=test_info, env=env)


def run_isar_post_rend_cmd(cmd, test_info=None, env=None):
    logging.info(f"\nRunning ISAR post renderer command\n{' '.join(cmd)}\n")
    _run_cmd(cmd, test_info=test_info, env=env)
@@ -485,9 +492,8 @@ def run_renderer(
            meta_file_cut = out_file + ".met"

            if check_masa_meta_diff(
                    ref=meta_file_ref,
                    dut=meta_file_cut,
                    print_stdout=True):
                ref=meta_file_ref, dut=meta_file_cut, print_stdout=True
            ):
                pytest.fail("Metadata file differs from reference")

    return out_file