archiver_test.cli#

Command line interface for archiver test.

Module Contents#

Functions#

_handle_debug(→ bool | int | str)

Turn on DEBUG logs, if asked otherwise INFO default

async_main(→ int)

Async main, runs the tests and prints the outputs.

cli(→ None)

Archiver Test checks the data from two archivers

test(→ None)

Runs a single test given input options

load(→ None)

Loads a file CONFIG of test sets in json.

Attributes#

LOG

archiver_test.cli.LOG: logging.Logger[source]#
archiver_test.cli._handle_debug(_ctx: click.core.Context | None, _param: click.core.Option | click.core.Parameter | None, debug: bool | int | str) bool | int | str[source]#

Turn on DEBUG logs, if asked otherwise INFO default

async archiver_test.cli.async_main(test_sets: list[archiver_test.archivers_test_set.ArchiversTestSet], output_folder: pathlib.Path | None) int[source]#

Async main, runs the tests and prints the outputs.

Parameters:
  • test_sets – ArchiverTestSets to run.

  • output_folder – Optional input to store the data from the tests.

archiver_test.cli.cli(_ctx: click.core.Context) None[source]#

Archiver Test checks the data from two archivers to see the difference when querying for the same data.

Example test the PV DTL-010:EMR-TT-047:Temp for the last 20 seconds.

archiver_test test -p DTL-010:EMR-TT-047:Temp -o archiver-linac-01.tn.esss.lu.se -n skybrewer.cslab.esss.lu.se -s 20 -t "sky archiver vs linac 01"

Importing from a configuration file:

archiver_test load config.json

Outputting to a configuration file and to a json storage:

archiver_test test --output-folder output

A copy of the downloaded data will be stored in output/store/archiver_host_name/pv_name/time_period.test_state.test_run_time.pickle and a copy of the config as output/test_name-test_run_time.test_state.pickle.

Loading existing data from another test run:

archiver_test test --old_data output/store/archiver-linac-01.tn.esss.lu.se/DTL-010:EMR-GT-003:Pos/data.pickle

Output is presented as a list of a tables for each PV for each archiver. Including:

  • Archival parameters

  • Average mean

  • Number of test events

  • PASS or FAIL if the returned events are exactly the same.

  • Possible reason why results could be different.

And a summary table with all with a calculated average mean difference.

archiver_test.cli.test(ctx: click.core.Context, pvs: list[str], archiver_old: str, archiver_new: str, seconds: int, test_name: str, output_folder: pathlib.Path | None, old_data: list[pathlib.Path] | None, debug: bool) None[source]#

Runs a single test given input options

archiver_test.cli.load(ctx: click.core.Context, config: pathlib.Path, output_folder: pathlib.Path, debug: bool) None[source]#

Loads a file CONFIG of test sets in json.

Argument CONFIG is a json file specifying a list of tests to run.