pcvs.backend.run module

pcvs.backend.run.anonymize_archive()[source]

Erase from results any undesired output from the generated archive.

This process is disabled by default as it may increase significantly the validation process on large test bases. .. note:

It does not alter results in-place, only the generated archive. To
preserve the anonymization, only the archive must be exported/shared,
not the actual build directory.
pcvs.backend.run.build_env_from_configuration(current_node, parent_prefix='pcvs')[source]

create a flat dict of variables mapping to the actual configuration.

In order to “pcvs.setup” to read current configuration, the whole config is serialized into shell variables. Purpose of this function is to flatten the configuration tree into env vars, each tree level being divided with an underscore.

This function is called recursively to walk through the whole tree.

Example:

The compiler.cc config node become $compiler_cc_program=<…>

Parameters:
  • current_node (dict) – current node to flatten

  • parent_prefix (str, optional) – prefix used to name vars at this depth, defaults to “pcvs”

Returns:

a flat dict of the whole configuration, keys are shell variables.

Return type:

dict

pcvs.backend.run.display_summary(the_session)[source]

Display a summary for this run, based on profile & CLI arguments.

pcvs.backend.run.dup_another_build(build_dir, outdir)[source]

Clone another build directory to start this validation upon it.

It allows to save test-generation time if the validation is re-run under the exact same terms (identical configuration & tests).

Parameters:
  • build_dir (str) – the build directory to copy resource from

  • outdir (str) – where data will be copied to.

Returns:

the whole configuration loaded from the dup’d build directory

Return type:

dict

pcvs.backend.run.find_files_to_process(path_dict)[source]

Lookup for test files to process, from the list of paths provided as parameter.

The given path_dict is a dict, where keys are path labels given by the user, while values are the actual path. This function then returns a two-list tuple, one being files needing preprocessing (setup), the other being static configuration files (pcvs.yml)

Each list element is a tuple:
  • origin label

  • subtree from this label leading to the actual file

  • file basename (either “pcvs.setup” or “pcvs.yml”)

Parameters:

path_dict (dict) – tree of paths to look for

Returns:

a tuple with two lists

Return type:

tuple

pcvs.backend.run.prepare()[source]

Prepare the environment for a validation run.

This function prepares the build dir, create trees…

pcvs.backend.run.print_progbar_walker(elt)[source]

Walker used to pretty-print progress bar element within Click.

Parameters:

elt (tuple) – the element to pretty-print, containing the label & subprefix

Returns:

the formatted string

Return type:

str

pcvs.backend.run.process_dyn_setup_scripts(setup_files)[source]

Process dynamic test files and generate associated tests.

This function executes pcvs.setup files after deploying the environment (to let these scripts access it). It leads to generate “pcvs.yml” files, then processed to construct tests.

Parameters:

setup_files (tuple) – list of tuples, each mapping a single pcvs.setup file

Returns:

list of errors encountered while processing.

Return type:

list

pcvs.backend.run.process_files()[source]

Process the test-suite generation.

It includes walking through user directories to find definitions AND generating the associated tests.

Raises:

TestUnfoldError – An error occured while processing files

pcvs.backend.run.process_main_workflow(the_session=None)[source]

Main run.py entry point, triggering a PCVS validation run.

This function is called by session management and may be run within an active terminal or as a detached process.

Parameters:

the_session (Session, optional) – the session handler this run is connected to, defaults to None

pcvs.backend.run.process_spack()[source]
pcvs.backend.run.process_static_yaml_files(yaml_files)[source]

Process ‘pcvs.yml’ files to contruct the test base.

Parameters:

yaml_files (list) – list of tuples, each describing a single input file.

Returns:

list of encountered errors while processing

Return type:

list

pcvs.backend.run.stop_pending_jobs(exc=None)[source]
pcvs.backend.run.terminate()[source]

Finalize a validation run.

This include generating & anonymizing (if needed) the archive.

Raises:

ProgramError – Problem occured while invoking the archive tool.