def __get_summary_files(config: dict) -> List[Path]:
    summary_files = []
    for run in config['runs']:
        file_path = resolve_path(run['fullPath']) / SUMMARY_FILE_NAME
        validate_file_exists(file_path, f"File {file_path} does not exists")
        summary_files.append(resolve_path(run['fullPath']) / SUMMARY_FILE_NAME)
    return summary_files
def make_chart(config: dict, results_dir: Path) -> Path:
    csv_path_str = config["aggregated_csv_path"]
    index_col = config["index_col"]
    title = config["title"]
    image_height_px = config["image_height_px"]
    image_width_px = config["image_width_px"]

    image_height = image_height_px / 100
    image_width = image_width_px / 100

    file_path = __resolve_and_expand_user_path(Path(csv_path_str))
    data_frame = __read_file_as_data_frame(file_path, index_col)
    print(f"Input data file {file_path} successfully read")

    data_frame = data_frame.sort_index()
    data_frame.plot.barh(figsize=(image_width, image_height))
    plt.xlabel('Time, ms')
    plt.title(title)
    plt.tight_layout()

    image_path = results_dir / __generate_image_name(Path(csv_path_str).stem)
    plt.savefig(image_path)
    validate_file_exists(image_path,
                         f"Result file {image_path} is not created")
    print(f"Chart file: {image_path.absolute()} successfully created")

    return image_path
def make_chart(config: dict, results_dir: Path, scenario_status: str) -> Path:
    csv_path_str = config["aggregated_csv_path"]
    index_col = config["index_col"]
    title = config["title"] + f" | Scenario status: {scenario_status}"
    image_height_px = config["image_height_px"]
    image_width_px = config["image_width_px"]

    image_height = image_height_px / 100
    image_width = image_width_px / 100

    file_path = __resolve_and_expand_user_path(Path(csv_path_str))
    data_frame = __read_file_as_data_frame(file_path, index_col)
    print(f"Input data file {file_path} successfully read")

    # Set app-specific mark
    app_specific_actions_list = get_app_specific_actions(file_path)
    for action in app_specific_actions_list:
        data_frame = data_frame.rename(index={action: f"\u2714{action}"})

    data_frame = data_frame.sort_index()
    data_frame.plot.barh(figsize=(image_width, image_height))
    plt.xlabel('Time, ms')
    plt.title(title)
    plt.tight_layout()

    image_path = results_dir / __generate_image_name(Path(csv_path_str).stem)
    plt.savefig(image_path)
    validate_file_exists(image_path,
                         f"Result file {image_path} is not created")
    print(f"Chart file: {image_path.absolute()} successfully created")

    return image_path
def aggregate(config: dict, results_dir: Path) -> Path:
    __validate_config(config)
    output_file_path = __get_output_file_path(config, results_dir)
    summary_files = __get_summary_files(config)
    run_names = __get_run_names(config)
    status_message = 'OK' if __get_overall_status(summary_files) else "FAIL"
    __write_to_summary_report(summary_files, run_names, status_message, output_file_path)
    validate_file_exists(output_file_path, f"Results file {output_file_path} is not created")
    print(f'Results file {output_file_path.absolute()} is created')
    return output_file_path
Beispiel #5
0
def aggregate(config: dict, results_dir: Path) -> Path:
    __validate_config(config)
    output_file_path = __get_output_file_path(config, results_dir)
    header = __create_header(config)
    data = __get_data_to_write(config)
    __write_list_to_csv(header, data, output_file_path)

    validate_file_exists(output_file_path,
                         f"Result file {output_file_path} is not created")
    print(f'Results file {output_file_path.absolute()} is created')
    return output_file_path
Beispiel #6
0
def aggregate(config: dict, results_dir: Path) -> Path:
    validate_config(config)
    tests_results = __get_tests_results(config)
    __validate_count_of_actions(tests_results)
    output_file_path = __get_output_file_path(config, results_dir)
    header = __create_header(config)
    __write_list_to_csv(header, tests_results, output_file_path, config)

    validate_file_exists(output_file_path,
                         f"Result file {output_file_path} is not created")
    print(f'Results file {output_file_path.absolute()} is created')
    return output_file_path