archiver_test.archivers_test_set#
This module lets you run a collection of tests against the data in multiple archiver clusters.
Module Contents#
Classes#
Represents data needed to run a compare test between two archiver clusters. |
|
Result of a test and method to pretty print as tables. |
Functions#
|
Loads a config file in json. Files are created via the [store_test_set] method. |
|
|
|
|
|
|
|
Tests from a list of parameters: |
|
Calculates if the event rates are effectively the same. |
Attributes#
- class archiver_test.archivers_test_set.ArchiversTestSet[source]#
Represents data needed to run a compare test between two archiver clusters.
- Returns:
Storage of the configuration of a test.
- Return type:
- async export(output_folder: pathlib.Path) pathlib.Path[source]#
Stores the configuration for a test run, with the result.
- Parameters:
output_folder – Path to store the config.
- async store(datasets: dict[str, dict[str, archiver_test.pv_archive_events.PVArchiveEvents]], output_folder: pathlib.Path) None[source]#
Store data from running a test for use in future tests, without redownloading the data.
- Parameters:
datasets – Data from running test_set
output_folder – Path of folder to store the output data.
- async load_old_data() dict[str, archiver_test.pv_archive_events.PVArchiveEvents][source]#
Loads old data
- async check(output_folder: pathlib.Path | None) TestResult[source]#
Tests a single ArchiverTestSet
- Parameters:
output_folder – Path where to store the data from the run.
- archiver_test.archivers_test_set.import_test_sets(config: pathlib.Path) list[ArchiversTestSet][source]#
Loads a config file in json. Files are created via the [store_test_set] method.
- Parameters:
config – The file path of the config file.
- class archiver_test.archivers_test_set.TestResult[source]#
Bases:
NamedTupleResult of a test and method to pretty print as tables.
- test_set: ArchiversTestSet[source]#
- old_data_set: dict[str, archiver_test.pv_archive_events.PVArchiveEvents][source]#
- new_data_set: dict[str, archiver_test.pv_archive_events.PVArchiveEvents][source]#
- comparisons: dict[str, archiver_test.pv_archive_events.DataSetDiff][source]#
- get_reason(pv: str) archiver_test.fail_reasons.Reason[source]#
Calculates a possible Reason why two archivers have different data.
- Parameters:
pv – The pv with test failure.
- check_protocol_difference(pv: str, old_details: dict[archiver_test.details.Detail, str], new_details: dict[archiver_test.details.Detail, str]) bool[source]#
Checks if the reason for the test failure is inherent to the protocols being different. In this case, if the only thing different in the differences is the alarm status.
- check_capacity_full(pv: str, old_details: dict[archiver_test.details.Detail, str]) bool[source]#
- If there are many lost events in the old
And the difference in number of events is not larger than 10% of number of the old archiver test period events.
- Parameters:
pv (str) – pv name
old_details (dict[Detail, str]) – details from old archiver
- Returns:
if true
- Return type:
bool
- check_not_archiving(old_details: dict[archiver_test.details.Detail, str], new_details: dict[archiver_test.details.Detail, str]) bool[source]#
- result_message(pv: str) str[source]#
Returns a message saying pass or failure with a reason.
- Parameters:
pv – PV to check.
- print_pv_result(console: rich.console.Console, pv: str) None[source]#
Prints a summary of a test to console for a single PV.
- Parameters:
console – Where to print the summary.
pv – Which PV for the summary.
- archiver_test.archivers_test_set.truncate_repr(event: epicsarchiver.ArchiveEvent, amount: int = MAX_LEN_DISPLAY_ARCHIVE_EVENT_STR) str[source]#
- archiver_test.archivers_test_set.check_equal(pair: tuple[epicsarchiver.ArchiveEvent, epicsarchiver.ArchiveEvent]) bool[source]#
- archiver_test.archivers_test_set.human_readable(delta: dateutil.relativedelta.relativedelta) list[str][source]#
- async archiver_test.archivers_test_set.sets_check(sets: list[ArchiversTestSet], output_folder: pathlib.Path | None) list[TestResult][source]#
Tests from a list of parameters:
- Parameters:
sets – list of test sets
output_folder – Where to store any data.
- Return dictionary of results keys of test_set.msg:
- archiver_test.archivers_test_set.event_rate_same(old: dict[archiver_test.details.Detail, str], new: dict[archiver_test.details.Detail, str]) bool[source]#
Calculates if the event rates are effectively the same.
- Parameters:
old – Old Archiver details.
new – New Archvier details
- Returns:
Returns true or false if the same.