# Path: tests/utils.py
# def run_temci(args: str, settings: dict = None, files: Dict[str, Union[dict, list, str]] = None,
#               expect_success: bool = True, misc_env: Dict[str, str] = None, raise_exc: bool = False) \
#         -> Result:
#     """
#     Run temci with the passed arguments
# 
#     :param args: arguments for temci
#     :param settings: settings dictionary, stored in a file called `settings.yaml` and appended to the arguments
#     :param files: {file name: content as string or dictionary that is converted into YAML first}
#     :param expect_success: expect a zero return code
#     :param misc_env: additional environment variables
#     :return: result of the call
#     """
#     if os.getenv("TEMCI_TEST_CMD", "0") == "1":
#         return run_temci_proc(args, settings, files, expect_success, misc_env=misc_env)
#     return run_temci_click(args, settings, files, expect_success, misc_env=misc_env, raise_exc=raise_exc)
# 
# def run_temci_proc(args: str, settings: dict = None, files: Dict[str, Union[dict, list, str]] = None,
#                    expect_success: bool = True, misc_env: Dict[str, str] = None) \
#         -> Result:
#     """
#     Run temci with the passed arguments
#     :param args: arguments for temci
#     :param settings: settings dictionary, stored in a file called `settings.yaml` and appended to the arguments
#     :param files: {file name: content as string or dictionary that is converted into YAML first}c at
#     :param expect_success: expect a zero return code
# 
#     :return: result of the call
#     """
#     with tempfile.TemporaryDirectory() as d:
#         _store_files(files, str(d))
#         cmd = "python3 {}/temci/scripts/cli.py {}".format(os.path.dirname(os.path.dirname(__file__)), args)
#         if settings is not None:
#             with open(d + "/settings.yaml", "w") as f:
#                 yaml.dump(settings, f)
#             cmd += " --config settings.yaml"
#         env = os.environ.copy()
#         env["LC_ALL"] = "en_US.utf-8"
#         env.update(misc_env or {})
#         proc = subprocess.Popen(["/bin/sh", "-c", cmd],
#                                 stdout=subprocess.PIPE,
#                                 stderr=subprocess.PIPE,
#                                 cwd=str(d),
#                                 env=env,
#                                 universal_newlines=True)
#         out, err = proc.communicate()
#         file_contents, yaml_contents = _load_files(files, d=d)
#         ret = Result(str(out).strip(), str(err).strip(), proc.returncode, file_contents, yaml_contents)
#         if expect_success:
#             assert proc.returncode == 0, repr(ret)
#         return ret


import json
from tests.utils import run_temci, run_temci_proc
    from temci.report.report import ReporterRegistry
            {
                "attributes": {"description": "XYZ"},
                "data": {"p456": [1], "z111": [2]}
            },
            {
                "attributes": {"description": "base"},
                "data": {"p456": [1], "z111": [2]}
            }
        ]
    }).out


def test_all_reporters():
    for name, rep in ReporterRegistry.registry.items():
        print(name)
        run_temci_proc("report --reporter {} in.yaml".format(name), files={
            "in.yaml": [
                {
                    "attributes": {"description": "XYZ"},
                    "data": {"p": [1, 2]}
                }
            ]
        })


def test_codespeed_reporter():
    d = lambda: {
        "attributes": {"description": "XYZ"},
        "data": {"p": [1]}
    }

# Path: tests/utils.py
# def run_temci(args: str, settings: dict = None, files: Dict[str, Union[dict, list, str]] = None,
#               expect_success: bool = True, misc_env: Dict[str, str] = None, raise_exc: bool = False) \
#         -> Result:
#     """
#     Run temci with the passed arguments
# 
#     :param args: arguments for temci
#     :param settings: settings dictionary, stored in a file called `settings.yaml` and appended to the arguments
#     :param files: {file name: content as string or dictionary that is converted into YAML first}
#     :param expect_success: expect a zero return code
#     :param misc_env: additional environment variables
#     :return: result of the call
#     """
#     if os.getenv("TEMCI_TEST_CMD", "0") == "1":
#         return run_temci_proc(args, settings, files, expect_success, misc_env=misc_env)
#     return run_temci_click(args, settings, files, expect_success, misc_env=misc_env, raise_exc=raise_exc)
# 
# def run_temci_proc(args: str, settings: dict = None, files: Dict[str, Union[dict, list, str]] = None,
#                    expect_success: bool = True, misc_env: Dict[str, str] = None) \
#         -> Result:
#     """
#     Run temci with the passed arguments
#     :param args: arguments for temci
#     :param settings: settings dictionary, stored in a file called `settings.yaml` and appended to the arguments
#     :param files: {file name: content as string or dictionary that is converted into YAML first}c at
#     :param expect_success: expect a zero return code
# 
#     :return: result of the call
#     """
#     with tempfile.TemporaryDirectory() as d:
#         _store_files(files, str(d))
#         cmd = "python3 {}/temci/scripts/cli.py {}".format(os.path.dirname(os.path.dirname(__file__)), args)
#         if settings is not None:
#             with open(d + "/settings.yaml", "w") as f:
#                 yaml.dump(settings, f)
#             cmd += " --config settings.yaml"
#         env = os.environ.copy()
#         env["LC_ALL"] = "en_US.utf-8"
#         env.update(misc_env or {})
#         proc = subprocess.Popen(["/bin/sh", "-c", cmd],
#                                 stdout=subprocess.PIPE,
#                                 stderr=subprocess.PIPE,
#                                 cwd=str(d),
#                                 env=env,
#                                 universal_newlines=True)
#         out, err = proc.communicate()
#         file_contents, yaml_contents = _load_files(files, d=d)
#         ret = Result(str(out).strip(), str(err).strip(), proc.returncode, file_contents, yaml_contents)
#         if expect_success:
#             assert proc.returncode == 0, repr(ret)
#         return ret


# Path: tests/test_report.py
import json
from tests.utils import run_temci, run_temci_proc
    from temci.report.report import ReporterRegistry

            {
                "attributes": {"description": "XYZ"},
                "data": {"p456": [1], "z111": [2]}
            },
            {
                "attributes": {"description": "base"},
                "data": {"p456": [1], "z111": [2]}
            }
        ]
    }).out


def test_all_reporters():
    for name, rep in ReporterRegistry.registry.items():
        print(name)
        run_temci_proc("report --reporter {} in.yaml".format(name), files={
            "in.yaml": [
                {
                    "attributes": {"description": "XYZ"},
                    "data": {"p": [1, 2]}
                }
            ]
        })


def test_codespeed_reporter():
    d = lambda: {
        "attributes": {"description": "XYZ"},
        "data": {"p": [1]}
    }

    out = run_temci("report in.yaml",