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.commands.cc config node become $compiler_commands_cc=<…>
- Parameters
- Returns
a flat dict of the whole configuration, keys are shell variables.
- Return type
- 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).
- 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”)
- 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.
- pcvs.backend.run.process()[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_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.
- 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_static_yaml_files(yaml_files)[source]
Process ‘pcvs.yml’ files to contruct the test base.
- pcvs.backend.run.save_for_export(f, dest=None)[source]
Add a resource to the archive to be exported.
Copy a source file to a destination prefix. The root build directory is replaced with $buildir/save_for_export, the relative subtree is preserved.
If ‘dest’ is set, the default target directory may be changed.
- Parameters
- Raises
UnclassifiableError – input file is not a file or a directory
NotFoundError – source or target resource cannot be determined
- pcvs.backend.run.str_dict_as_envvar(d)[source]
Convert a dict to a list of shell-compliant variable strings.
The final result is a regular multiline str, each line being an entry.
- 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.