-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move reporting related pv code within test harness to pv folder (#44)
* move reporting related pv code to pv folder * update fixtures and fix linting * Delete test_harness/log_file_store/error_log_d8dce7ed-5684-4937-90b8-9558e8647422.txt * remove commented out code from test harness conftest * fix linting * add debug print to check GitHub actions workflow * update mock_start in test_send_events * add mock_del
- Loading branch information
1 parent
488cce2
commit be1968e
Showing
14 changed files
with
1,315 additions
and
993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
"""__init__ file. Contains methods to create and save report files""" | ||
|
||
from pandas import DataFrame | ||
|
||
from test_harness.protocol_verifier.reporting.log_analyser import ( | ||
logs_validity_df_to_results | ||
) | ||
from test_harness.protocol_verifier.reporting.report_results import ( | ||
get_report_files_mapping_from_dataframe_report, | ||
) | ||
from test_harness.reporting.report_delivery import deliver_test_report_files | ||
|
||
|
||
def create_and_save_report_files( | ||
log_string: str, | ||
validity_df: DataFrame, | ||
test_name: str, | ||
output_directory_path: str, | ||
) -> None: | ||
"""Method to create report files from logs and validity dataframe and save | ||
report files with a prefix in an output directory | ||
:param log_string: String representing the log files | ||
:type log_string: `str` | ||
:param validity_df: :class:`DataFrame` holding the information on the test | ||
files | ||
:type validity_df: :class:`DataFrame` | ||
:param test_name: The test name (or prefix) to give to the report files | ||
:type test_name: `str` | ||
:param output_directory_path: The path of the output directory to store | ||
the results | ||
:type output_directory_path: `str` | ||
""" | ||
report_files_mapping = create_report_files( | ||
log_string=log_string, validity_df=validity_df, test_name=test_name | ||
) | ||
deliver_test_report_files( | ||
report_files_mapping=report_files_mapping, | ||
output_directory=output_directory_path, | ||
) | ||
|
||
|
||
def create_report_files( | ||
log_string: str, | ||
validity_df: DataFrame, | ||
test_name: str, | ||
event_id_job_id_map: dict[str, str] | None = None, | ||
) -> dict[str, str | DataFrame]: | ||
"""Method to create report files from logs and validity dataframe | ||
:param log_string: String representing the log files | ||
:type log_string: `str` | ||
:param validity_df: :class:`DataFrame` holding the information on the test | ||
files | ||
:type validity_df: :class:`DataFrame` | ||
:param test_name: The test name (or prefix) to give to the report files | ||
:type test_name: `str` | ||
""" | ||
results_df = logs_validity_df_to_results( | ||
log_string=log_string, | ||
validity_df=validity_df, | ||
event_id_job_id_map=event_id_job_id_map, | ||
) | ||
report_files_mapping = get_report_files_mapping_from_dataframe_report( | ||
results_df=results_df, results_prefix=test_name | ||
) | ||
return report_files_mapping |
File renamed without changes.
Oops, something went wrong.