ramble.test namespace
Subpackages
- ramble.test.cmd namespace
- Submodules
- ramble.test.cmd.attributes module
- ramble.test.cmd.clean module
- ramble.test.cmd.config module
check_config_updated()config_yaml_v015()mock_editor()section_args()test_config_add()test_config_add_from_file()test_config_add_from_file_multiple()test_config_add_invalid_file_fails()test_config_add_list()test_config_add_ordered_dict()test_config_add_override()test_config_add_override_from_file()test_config_add_override_leaf()test_config_add_override_leaf_from_file()test_config_add_to_workspace()test_config_add_to_workspace_preserve_comments()test_config_add_to_workspace_preserve_multiline_str()test_config_add_update_dict()test_config_edit()test_config_edit_edits_ramble_yaml()test_config_edit_fails_correctly_with_no_workspace()test_config_edit_file()test_config_get_fails_correctly_with_no_workspace()test_config_get_gets_ramble_yaml()test_config_list()test_config_remove_alias_rm()test_config_remove_dict()test_config_remove_from_workspace()test_config_remove_value()test_config_revert()test_config_update_not_needed()test_config_with_c_argument()test_get_config_scope()test_get_config_scope_merged()test_merged_applications_section()test_merged_env_vars_section()test_merged_software_section()test_merged_success_criteria_section()test_merged_variables_section()test_remove_from_list()test_remove_list()
- ramble.test.cmd.debug module
- ramble.test.cmd.info module
- ramble.test.cmd.list module
- ramble.test.cmd.mirror module
- ramble.test.cmd.on module
- ramble.test.cmd.python module
- ramble.test.cmd.repo module
- ramble.test.cmd.results module
- ramble.test.cmd.software_definitions module
- ramble.test.cmd.workspace module
add_basic()check_basic()check_info_basic()check_info_zlib()check_no_basic()check_results()remove_basic()test_analyze_nothing()test_anlyze_command()test_concretize_command()test_concretize_concrete_config()test_concretize_nothing()test_custom_executables_info()test_custom_executables_order_info()test_dryrun_noexpvars_setup()test_dryrun_setup()test_edit_edits_correct_paths()test_edit_fails_without_workspace()test_edit_override_gets_correct_path()test_force_concretize()test_invalid_size_matrices_workspace()test_invalid_template_name_errors()test_invalid_vector_workspace()test_matrix_vector_workspace_full()test_multi_use_vector_var_matrices_workspace()test_no_workspace_flag()test_non_vector_var_matrices_workspace()test_reconcretize_in_configs_dir()test_remove_workspace()test_setup_command()test_setup_command_with_missing_log_dir()test_setup_nothing()test_undefined_var_matrices_workspace()test_workspace_activate_fails()test_workspace_archive()test_workspace_archive_include_secrets()test_workspace_config_precedence()test_workspace_create_links()test_workspace_dir()test_workspace_dirs()test_workspace_flag_anon()test_workspace_flag_named()test_workspace_from_template()test_workspace_include()test_workspace_info()test_workspace_info_prints_all_levels()test_workspace_info_software()test_workspace_info_with_experiment_chain()test_workspace_info_with_where_filter()test_workspace_list()test_workspace_no_empty_workloads()test_workspace_simplify()test_workspace_tar_archive()test_workspace_tar_upload_archive()test_workspace_tar_upload_archive_config_url()workspace_deactivate()write_variables_config_file()
- ramble.test.cmd.workspace_concretize module
- ramble.test.end_to_end namespace
- Submodules
- ramble.test.end_to_end.analyze_fom_output module
- ramble.test.end_to_end.analyze_upload module
- ramble.test.end_to_end.chained_experiment_var_inheritance module
- ramble.test.end_to_end.chained_experiment_variant_propagation module
- ramble.test.end_to_end.concretize_with_different_package_managers module
- ramble.test.end_to_end.config_section_env_vars module
- ramble.test.end_to_end.custom_executables module
- ramble.test.end_to_end.define_package_paths module
- ramble.test.end_to_end.dryrun_chained_experiments module
- ramble.test.end_to_end.dryrun_copies_external_env module
- ramble.test.end_to_end.dryrun_series_contains_package_paths module
- ramble.test.end_to_end.env_var_builtin module
- ramble.test.end_to_end.env_var_leakage module
- ramble.test.end_to_end.exclusive_filtered_vector_workloads module
- ramble.test.end_to_end.expanded_fom_dry_run module
- ramble.test.end_to_end.experiment_excludes module
- ramble.test.end_to_end.experiment_hashes module
- ramble.test.end_to_end.experiment_repeats module
- ramble.test.end_to_end.experiment_templates module
- ramble.test.end_to_end.explicit_zips module
- ramble.test.end_to_end.fom_log_file_path module
- ramble.test.end_to_end.formatted_executables module
- ramble.test.end_to_end.globbing_patterns module
- ramble.test.end_to_end.gromacs_size_expansion module
- ramble.test.end_to_end.included_configuration_files module
- ramble.test.end_to_end.inclusive_filtered_vector_workloads module
- ramble.test.end_to_end.known_applications module
- ramble.test.end_to_end.malformed_config module
- ramble.test.end_to_end.manage_software module
- ramble.test.end_to_end.merge_config_files module
- ramble.test.end_to_end.missing_mpi_cmd module
- ramble.test.end_to_end.missing_required_dry_run module
- ramble.test.end_to_end.nested_compilers_are_installed module
- ramble.test.end_to_end.nested_config_templates module
- ramble.test.end_to_end.object_import module
- ramble.test.end_to_end.object_validation module
- ramble.test.end_to_end.package_manager_config module
- ramble.test.end_to_end.package_manager_provenance module
- ramble.test.end_to_end.package_manager_requirements module
- ramble.test.end_to_end.package_manager_unique_env_dirs module
- ramble.test.end_to_end.passthrough_variables module
- ramble.test.end_to_end.phase_selection module
- ramble.test.end_to_end.phase_selection_with_dependencies module
- ramble.test.end_to_end.pip_test module
- ramble.test.end_to_end.shared_context module
- ramble.test.end_to_end.short_builtin_dep_name module
- ramble.test.end_to_end.spack_env_cache module
- ramble.test.end_to_end.tag_filtering module
- ramble.test.end_to_end.test_configvar_dry_run module
- ramble.test.end_to_end.test_target_shells module
- ramble.test.end_to_end.test_template module
- ramble.test.end_to_end.unused_compilers_are_skipped module
- ramble.test.end_to_end.variant_propagation module
- ramble.test.end_to_end.vector_workloads module
- ramble.test.end_to_end.warn_mirror_support module
- ramble.test.end_to_end.workspace_includes module
- ramble.test.end_to_end.wrfv4_dry_run module
- ramble.test.experimental namespace
- ramble.test.modifier_functionality namespace
- Submodules
- ramble.test.modifier_functionality.experiment_modification module
- ramble.test.modifier_functionality.mock_env_var_modifiers module
- ramble.test.modifier_functionality.mock_layered_modifications module
- ramble.test.modifier_functionality.mock_modifier_dry_run module
- ramble.test.modifier_functionality.mock_modifier_phases module
- ramble.test.modifier_functionality.mock_modifier_spack_configs module
- ramble.test.modifier_functionality.mock_repeated_modifications module
- ramble.test.modifier_functionality.mock_spack_modifier module
- ramble.test.modifier_functionality.modifier_helpers module
check_execute_script()check_software_env()env_var_append_paths_modifier()env_var_append_paths_modifier_answer()env_var_append_vars_modifier()env_var_append_vars_modifier_answer()env_var_prepend_paths_modifier()env_var_prepend_paths_modifier_answer()env_var_set_modifier()env_var_set_modifier_answer()env_var_unset_modifier()env_var_unset_modifier_answer()intel_aps_answer()intel_aps_modifier()lscpu_answer()lscpu_modifier()named_modifier()
- ramble.test.modifier_functionality.modifier_prepare_analysis module
- ramble.test.modifier_functionality.multi_modifier_dry_run module
- ramble.test.modifier_functionality.required_variables module
- ramble.test.modifier_functionality.single_modifier_dry_run module
- ramble.test.package_manager_functionality namespace
- Submodules
- ramble.test.package_manager_functionality.package_manager_general module
- ramble.test.package_manager_functionality.spack_runner module
test_config_compiler_find_attribute()test_config_concretize_attribute()test_config_install_attribute()test_configs_apply_to_external_env()test_default_concretize_flags()test_default_install_flags()test_env_activate()test_env_add()test_env_concretize()test_env_concretize_skips_already_concretized_envs()test_env_configs_apply()test_env_create()test_env_create_no_view()test_env_deactivate()test_env_include()test_env_install()test_env_view_link_types()test_external_env_copies()test_invalid_external_env_errors()test_multiword_args()test_new_compiler_installs()
- ramble.test.success_criteria_functionality namespace
- Submodules
- ramble.test.success_criteria_functionality.always_print_foms module
- ramble.test.success_criteria_functionality.anti_match module
- ramble.test.success_criteria_functionality.repeat_success_strict module
- ramble.test.success_criteria_functionality.success_fom_comparison module
- ramble.test.success_criteria_functionality.success_fom_globbing module
- ramble.test.success_criteria_functionality.success_functions module
- ramble.test.success_criteria_functionality.success_modifiers module
- ramble.test.success_criteria_functionality.success_variable_fom_comparison module
- ramble.test.util namespace
- Submodules
- ramble.test.util.conversions module
- ramble.test.util.editor module
bad_exe()good_exe()nosuch_exe()test_editor_both_bad()test_editor_no_visual()test_editor_no_visual_with_args()test_editor_visual()test_editor_visual_bad()test_find_exe_from_env_var()test_find_exe_from_env_var_bad_path()test_find_exe_from_env_var_no_editor()test_find_exe_from_env_var_with_args()vim_exe()
- ramble.test.util.env module
- ramble.test.util.path module
- ramble.test.util.shell_utils module
- ramble.test.util.stats module
- ramble.test.util.yaml_generation module
- ramble.test.workflow_manager_functionality namespace
- Submodules
- ramble.test.workflow_manager_functionality.gke_mpi_workflow_manager module
- ramble.test.workflow_manager_functionality.google_batch_workflow_manager module
- ramble.test.workflow_manager_functionality.slurm_workflow_manager module
- ramble.test.workflow_manager_functionality.workflow_manager_foms module
- ramble.test.workspace_hashing namespace
Submodules
ramble.test.application_inheritance module
ramble.test.application_language module
Perform tests of the Application class
ramble.test.application_tests module
Perform tests of the Application class
- ramble.test.application_tests.basic_exp_dict()[source]
To set expander consistently with test_wl2 of builtin.mock/applications/basic
- ramble.test.application_tests.test_application_copy_is_deep(mutable_mock_apps_repo, app_name)[source]
- ramble.test.application_tests.test_define_commands(mutable_mock_apps_repo)[source]
test _define_commands
- ramble.test.application_tests.test_derive_variables_for_template_path(mutable_mock_apps_repo)[source]
_set_default_variables_for_template_path
- ramble.test.application_tests.test_get_executable_graph_custom_executables(mutable_mock_apps_repo)[source]
_get_executable_graph, test3, custom executables
- ramble.test.application_tests.test_get_executable_graph_initial(mutable_mock_apps_repo)[source]
_get_executable_graph, test1, workload executables
- ramble.test.application_tests.test_get_executable_graph_yaml_defined(mutable_mock_apps_repo)[source]
_get_executable_graph, test2, yaml-defined order
- ramble.test.application_tests.test_set_default_experiment_variables(mutable_mock_apps_repo)[source]
_set_default_experiment_variables
ramble.test.cache_fetch module
ramble.test.commands module
ramble.test.concretize_builtin module
ramble.test.config_test module
ramble.test.conftest module
- class ramble.test.conftest.ConfigUpdate(root_for_conf, writer_mod, writer_key, monkeypatch)[source]
Bases:
object
- class ramble.test.conftest.MockBundle[source]
Bases:
object- has_code = False
- name = 'mock-bundle'
- versions = {}
- ramble.test.conftest.clear_directive_functions()[source]
Clear all overridden directive functions for subsequent tests.
- ramble.test.conftest.config(mock_configuration_scopes)[source]
This fixture activates/deactivates the mock configuration.
- ramble.test.conftest.configuration_dir(tmpdir_factory, linux_os)[source]
Copies mock configuration files in a temporary directory. Returns the directory path.
- ramble.test.conftest.default_config()[source]
Isolates the default configuration from the user configs.
This ensures we can test the real default configuration without having tests fail when the user overrides the defaults that we test against.
- ramble.test.conftest.install_mockery_mutable_config(mutable_config, mock_applications)[source]
Hooks fake applications and config directory into Ramble.
This is specifically for tests which want to use ‘install_mockery’ but also need to modify configuration (and hence would want to use ‘mutable config’): ‘install_mockery’ does not support this.
- ramble.test.conftest.linux_os()[source]
Returns a named tuple with attributes ‘name’ and ‘version’ representing the OS.
- ramble.test.conftest.mock_applications(mock_apps_repo_path)[source]
Use the ‘builtin.mock’ repository for applications instead of ‘builtin’
- ramble.test.conftest.mock_archive(request, tmpdir_factory)[source]
Creates a very simple archive directory with a configure script and a makefile that installs to a prefix. Tars it up into an archive.
- ramble.test.conftest.mock_configuration_scopes(configuration_dir)[source]
Create a persistent Configuration object from the configuration_dir.
- ramble.test.conftest.mock_directive_bundle()[source]
Return a mock bundle package for directive tests.
- ramble.test.conftest.mock_executable(tmpdir)[source]
Factory to create a mock executable in a temporary directory that output a custom string when run.
- ramble.test.conftest.mock_fetch(mock_archive, monkeypatch)[source]
Fake the URL for an input so it downloads from a file.
- ramble.test.conftest.mock_fetch_cache(monkeypatch)[source]
Substitutes ramble.paths.fetch_cache with a mock object that does nothing and raises on fetch.
- ramble.test.conftest.mock_low_high_config(tmpdir)[source]
Mocks two configuration scopes: ‘low’ and ‘high’.
- ramble.test.conftest.mock_modifiers(mock_mods_repo_path)[source]
Use the ‘builtin.mock’ repository for modifiersinstead of ‘builtin’
- ramble.test.conftest.mock_package_managers(mock_pkg_mans_repo_path)[source]
Use the ‘builtin.mock’ repository for package managers of ‘builtin’
- ramble.test.conftest.mock_workflow_managers(mock_wms_repo_path)[source]
Use the ‘builtin.mock’ repository for package managers of ‘builtin’
- ramble.test.conftest.mutable_config(tmpdir_factory, configuration_dir)[source]
Like config, but tests can modify the configuration.
- ramble.test.conftest.mutable_empty_config(tmpdir_factory, configuration_dir)[source]
Empty configuration that can be modified by the tests.
- ramble.test.conftest.mutable_mock_apps_repo(mock_apps_repo_path)[source]
Function-scoped mock applications, for tests that need to modify them.
- ramble.test.conftest.mutable_mock_mods_repo(mock_mods_repo_path)[source]
Function-scoped mock modifiers, for tests that need to modify them.
- ramble.test.conftest.mutable_mock_pkg_mans_repo(mock_pkg_mans_repo_path)[source]
Function-scoped mock package managers, for tests that need to modify them.
- ramble.test.conftest.mutable_mock_wms_repo(mock_wms_repo_path)[source]
Function-scoped mock package managers, for tests that need to modify them.
- ramble.test.conftest.mutable_mock_workspace_path(tmpdir_factory, mutable_config)[source]
Fixture for mocking the internal ramble workspaces directory.
- ramble.test.conftest.no_chdir()[source]
Ensure that no test changes Ramble’s working directory.
This prevents Ramble tests (and therefore Ramble commands) from changing the working directory and causing other tests to fail mysteriously. Tests should use
working_dirorpy.path’s.as_cwd()instead ofos.chdirto avoid failing this check.We assert that the working directory hasn’t changed, unless the original wd somehow ceased to exist.
ramble.test.dry_run_helpers module
- class ramble.test.dry_run_helpers.SCOPES(*values)
Bases:
Enum- application = 2
- experiment = 4
- workload = 3
- workspace = 1
- ramble.test.dry_run_helpers.dry_run_config(section_name, injections, config_path, app_name, wl_name, batch_cmd='batch_submit')[source]
Creates a new configuration with modifiers injected
Input argument injections is a list of tuples. Each tuple has two values, and takes the form:
(scope, injection_dict)
scope is the scope the injection dict should be injected into injection_dict is a dict representing the new injection into the config
config_path is the path to the config file that should be written
ramble.test.expander module
ramble.test.experiment_result module
Tests on the ExperimentResult class
ramble.test.experiment_set module
- ramble.test.experiment_set.test_chained_experiment_has_correct_directory(mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_chained_experiments_populate_new_experiments(mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_cross_experiment_missing_experiment_errors(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_cross_experiment_variable_references(request, mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_custom_executables_track_variables(request, mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_matrix_experiments_explicit_excludes(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_matrix_multiplication_experiments(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_matrix_undefined_var_errors(mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_missing_required_keyword_errors(mutable_mock_workspace_path, var, capsys)[source]
- ramble.test.experiment_set.test_modifiers_set_correctly(mutable_mock_workspace_path, mock_modifiers, capsys)[source]
- ramble.test.experiment_set.test_nonunique_vector_errors(mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_processes_per_node_correct_defaults(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_reserved_keywords_error_in_application(mutable_mock_workspace_path, var)[source]
- ramble.test.experiment_set.test_reserved_keywords_error_in_experiment(mutable_mock_workspace_path, var)[source]
- ramble.test.experiment_set.test_reserved_keywords_error_in_workload(mutable_mock_workspace_path, var)[source]
- ramble.test.experiment_set.test_unused_var_propagates_to_chain(request, mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_unused_vector_no_error(request, mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_vector_experiment_with_explicit_excludes(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_vector_experiment_with_multi_where_excludes(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_vector_experiment_with_where_excludes(mutable_mock_workspace_path)[source]
- ramble.test.experiment_set.test_vector_length_mismatch_errors(request, mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_zip_multi_use_var_errors(mutable_mock_workspace_path, capsys)[source]
- ramble.test.experiment_set.test_zip_non_list_var_errors(mutable_mock_workspace_path, capsys)[source]
ramble.test.gcs_fetch module
- ramble.test.gcs_fetch.test_gcsfetchstrategy_bad_url(tmpdir, _fetch_method)[source]
Ensure fetch with bad URL fails as expected.
- ramble.test.gcs_fetch.test_gcsfetchstrategy_download(tmpdir, _fetch_method)[source]
Ensure fetch of fie.
ramble.test.get_file_path module
ramble.test.mirror_tests module
- class ramble.test.mirror_tests.MockFetcher[source]
Bases:
objectMock fetcher object which implements the necessary functionality for testing MirrorCache
ramble.test.modifier_application module
ramble.test.modifier_language module
Perform tests of the Application class
ramble.test.namespace_trie module
ramble.test.package_manager_language module
Perform tests of the package manager class
ramble.test.reports module
- ramble.test.reports.create_test_exp(success, name, n_nodes, wl_ns, ramble_vars, ramble_raw_vars, context, fom_name, fom_value, units, origin, origin_type, fom_type, better_direction, fv, ifv, normalized=False, repeat_index='0')[source]
- ramble.test.reports.test_multiple_groupby(mutable_mock_workspace_path, tmpdir_factory, capsys)[source]
ramble.test.repository module
ramble.test.software_environment module
- ramble.test.software_environment.test_basic_software_environment(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_compiler_in_environment_warns(request, mutable_mock_workspace_path, capsys)[source]
- ramble.test.software_environment.test_invalid_environment_error(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_invalid_packages_error(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_multi_template_software_environments(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_software_environments_no_packages(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_software_environments_no_rendered_packages(request, mutable_mock_workspace_path)[source]
- ramble.test.software_environment.test_template_software_environments(request, mutable_mock_workspace_path)[source]
ramble.test.spec_basic module
Perform tests of the Spec class
ramble.test.stage module
Test that the Stage class works correctly.
- class ramble.test.stage.TestStage[source]
Bases:
object- stage_name = 'ramble-test-stage'
- test_composite_stage_with_expand_resource_default_placement(composite_stage_with_expanding_resource)[source]
For a resource which refers to a compressed archive which expands to a directory, check that by default the resource is placed in the source_path of the root stage with the name of the decompressed directory.
- test_create_stage_root_bad_uid(tmpdir, monkeypatch)[source]
Test the code path that uses an existing user path – whether $user in $tempdir or not – and triggers the generation of the UID mismatch warning.
This situation can happen with some config:build_stage settings for teams using a common service account for installing software.
- test_expand_archive_extra_expand(mock_stage_archive)[source]
Test expand with an extra expand after expand (i.e., no-op).
- test_input_path_available(mock_stage_archive)[source]
Ensure input path available but does not exist on instantiation.
- test_noexpand_stage_file(mock_noexpand_resource, tmpdir)[source]
When creating a stage with a nonexpanding URL, the ‘archive_file’ property of the stage should refer to the path of that file.
- ramble.test.stage.check_destroy(stage, stage_name)[source]
Figure out whether a stage was destroyed correctly.
- ramble.test.stage.check_expand_archive(stage, stage_name, expected_file_list)[source]
Ensure the expanded archive directory contains the expected structure and files as described in the module-level comments above.
- ramble.test.stage.check_fetch(stage, stage_name)[source]
Ensure the fetch resulted in a properly placed archive file as described in the module-level comments.
- ramble.test.stage.check_setup(stage, stage_name, archive)[source]
Figure out whether a stage was set up correctly.
- ramble.test.stage.check_stage_dir_perms(prefix, path)[source]
Check the stage directory perms to ensure match expectations.
- ramble.test.stage.clear_stage_root(monkeypatch)[source]
Ensure spack.stage._stage_root is not set at test start.
- ramble.test.stage.composite_stage_with_expanding_resource(mock_stage_archive, mock_expand_resource)[source]
Sets up a composite for expanding resources prior to staging.
- ramble.test.stage.mock_expand_resource(tmpdir)[source]
Sets up an expandable resource in tmpdir prior to staging.
- ramble.test.stage.mock_noexpand_resource(tmpdir)[source]
Set up a non-expandable resource in the tmpdir prior to staging.
- ramble.test.stage.mock_stage_archive(tmp_build_stage_dir)[source]
Create the directories and files for the staged mock archive.
- ramble.test.stage.test_cannot_access(capsys)[source]
Ensure can_access dies with the expected error.