ramble.test package

Subpackages

Submodules

ramble.test.application module

Perform tests of the Application class

class ramble.test.application.TestApplicationBase(methodName='runTest')[source]

Bases: TestCase

test_non_reserved_variables()[source]
ramble.test.application.basic_exp_dict()[source]

To set expander consistently with test_wl2 of builtin.mock/applications/basic

ramble.test.application.test_app_features(mutable_mock_apps_repo, app)[source]
ramble.test.application.test_application_copy_is_deep(app_name, wl_name, mutable_mock_apps_repo)[source]
ramble.test.application.test_application_methods_with_default_workspace(mutable_mock_apps_repo, workspace_name)[source]

Verify ApplicationBase methods fallback to self.workspace when workspace=None

ramble.test.application.test_basic_app(mutable_mock_apps_repo)[source]
ramble.test.application.test_class_attributes(mutable_mock_apps_repo)[source]
ramble.test.application.test_define_commands(mutable_mock_apps_repo)[source]

test _define_commands

ramble.test.application.test_define_variables_for_template_path(mutable_mock_apps_repo, workspace_name)[source]

_set_default_variables_for_template_path

ramble.test.application.test_get_executable_graph_custom_executables(mutable_mock_apps_repo)[source]

_get_executable_graph, test3, custom executables

ramble.test.application.test_get_executable_graph_initial(mutable_mock_apps_repo)[source]

_get_executable_graph, test1, workload executables

ramble.test.application.test_get_executable_graph_yaml_defined(mutable_mock_apps_repo)[source]

_get_executable_graph, test2, yaml-defined order

ramble.test.application.test_register_builtin_app(mutable_mock_apps_repo)[source]
ramble.test.application.test_required_builtins(mutable_mock_apps_repo, app)[source]
ramble.test.application.test_set_input_path(mutable_mock_apps_repo)[source]

_set_input_path

ramble.test.application.test_set_input_path_multi_input(mutable_mock_apps_repo)[source]

Tests set_input_path with multiple inputs in a given workload

ramble.test.application.test_set_variables_and_variants(mutable_mock_apps_repo)[source]

Test that set_variables defines workload variables

ramble.test.application.test_short_print(mutable_mock_apps_repo, app)[source]
ramble.test.application.test_undefined_executable_dies(mutable_mock_apps_repo, capsys)[source]

Test that an undefined executable causes a fatal error.

ramble.test.application.test_workload_groups(mutable_mock_apps_repo)[source]
ramble.test.application.test_workload_groups_inherited(mutable_mock_apps_repo)[source]

ramble.test.application_inheritance module

ramble.test.application_inheritance.test_basic_inheritance(mutable_mock_apps_repo)[source]

ramble.test.application_language module

Perform tests of the Application class

ramble.test.application_language.add_compiler(app_inst, spec_num=1)[source]
ramble.test.application_language.add_executable(app_inst, exe_num=1)[source]
ramble.test.application_language.add_figure_of_merit(app_inst, fom_num=1)[source]
ramble.test.application_language.add_input_file(app_inst, input_num=1)[source]
ramble.test.application_language.add_software_spec(app_inst, spec_num=1)[source]
ramble.test.application_language.add_workload(app_inst, wl_num=1)[source]
ramble.test.application_language.test_application_type_features(app_class)[source]
ramble.test.application_language.test_define_compiler_directive(app_class)[source]
ramble.test.application_language.test_executable_directive(app_class)[source]
ramble.test.application_language.test_figure_of_merit_directive(app_class)[source]
ramble.test.application_language.test_figure_of_merit_directive_required_args()[source]
ramble.test.application_language.test_input_file_directive(app_class)[source]
ramble.test.application_language.test_license_name_directive(app_class)[source]
ramble.test.application_language.test_non_reserved_variables(app_class)[source]
ramble.test.application_language.test_software_spec_directive(app_class)[source]
ramble.test.application_language.test_stage_files_directive_invalid_method()[source]
ramble.test.application_language.test_stage_files_directive_method(stage_method, template_contents)[source]
ramble.test.application_language.test_stage_files_directive_no_dst()[source]
ramble.test.application_language.test_stage_files_directive_overwrite()[source]
ramble.test.application_language.test_stage_files_directive_stages()[source]
ramble.test.application_language.test_stage_files_directive_user_defined()[source]
ramble.test.application_language.test_workload_directive(app_class)[source]
ramble.test.application_language.test_workload_variable_workload_defaults_error()[source]
ramble.test.application_language.test_workload_variable_workload_defaults_works()[source]

ramble.test.cache_fetch module

ramble.test.cache_fetch.test_fetch(tmpdir, _fetch_method)[source]

Ensure a fetch after expanding is effectively a no-op.

ramble.test.cache_fetch.test_fetch_missing_cache(tmpdir, _fetch_method)[source]

Ensure raise a missing cache file.

ramble.test.commands module

ramble.test.commands.test_available_command()[source]
ramble.test.commands.test_command_alias_output(mutable_config)[source]
ramble.test.commands.test_command_output(tmpdir)[source]
ramble.test.commands.test_missing_command()[source]

ramble.test.concretize_builtin module

ramble.test.concretize_builtin.test_concretize_allows_invalid_experiment(mutable_config, mutable_mock_workspace_path, workspace_name)[source]
ramble.test.concretize_builtin.test_concretize_does_not_set_required(mutable_config, mutable_mock_workspace_path, workspace_name)[source]

Verify that concretizing an application with required set to True does not insert a required statement into software dict.

ramble.test.config module

ramble.test.config.test_default_configs_no_conflict(default_config)[source]

Ensure the hard-coded config_defaults do not conflict with etc/defaults/config.yaml

ramble.test.config.test_duplicate_key_warning(capsys)[source]
ramble.test.config.test_process_config_path_error(config, expected_error)[source]
ramble.test.config.test_unhashable_yaml_keys_coverage()[source]

ramble.test.context module

class ramble.test.context.TestContext(methodName='runTest')[source]

Bases: TestCase

test_to_workspace_config()[source]
test_to_workspace_config_all_attributes()[source]

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.dry_run_helpers.search_files_for_string(file_list, string)[source]

ramble.test.expander module

ramble.test.expander.build_variant_set()[source]
ramble.test.expander.exp_dict()[source]
ramble.test.expander.test_expand_var_name(input, output)[source]
ramble.test.expander.test_expansion_namespaces()[source]
ramble.test.expander.test_expansions(input, output, no_expand_vars, passes)[source]
ramble.test.expander.test_extra_vars_propagation()[source]

Test that extra_vars are propagated properly

ramble.test.expander.test_satisfies_works(input_list, output)[source]
ramble.test.expander.test_typed_expansions(input, output, no_expand_vars, passes)[source]
ramble.test.expander.test_variable_mutation()[source]

Test that variable changes are reflected in expansions

ramble.test.experiment_result module

Tests on the ExperimentResult class

ramble.test.experiment_result.experiment_result()[source]

Returns a basic experiment result

ramble.test.experiment_result.test_analyze_experiments_skips_none_fom(mutable_mock_apps_repo, monkeypatch, tmpdir)[source]

Test that _analyze_experiments skips FOMs when value group is None

ramble.test.experiment_result.test_experiment_result_cache_invalidation_hash_change(tmpdir, experiment_result)[source]

Test that the cache is invalidated if the experiment hash changes

ramble.test.experiment_result.test_experiment_result_cache_invalidation_new_file(tmpdir, experiment_result)[source]

Test that the cache is invalidated if a file is newer than the cache

ramble.test.experiment_result.test_experiment_result_get_newest_experiment_file(tmpdir)[source]

Test that the newest experiment file is found correctly

ramble.test.experiment_result.test_experiment_result_read_write_cache(tmpdir, experiment_result)[source]

Test that the cache is written and read correctly

ramble.test.experiment_result.test_experiment_result_to_dict(mutable_mock_apps_repo)[source]
ramble.test.experiment_result.test_extract_inmem_foms_skips_none(mutable_mock_apps_repo)[source]

Test that extract_inmem_foms skips FOMs with None value

ramble.test.experiment_result.test_get_newest_experiment_file_inner_file_not_found(tmpdir, monkeypatch)[source]

Test that FileNotFoundError is handled in inner loop of get_newest_experiment_file

ramble.test.experiment_result.test_get_newest_experiment_file_outer_file_not_found(tmpdir, monkeypatch)[source]

Test that FileNotFoundError is handled in outer loop of get_newest_experiment_file

ramble.test.experiment_set module

ramble.test.experiment_set.test_chained_cycle_errors(workspace_name)[source]
ramble.test.experiment_set.test_chained_experiment_has_correct_directory(workspace_name)[source]
ramble.test.experiment_set.test_chained_experiments(workspace_name)[source]

Test that chained experiments are rendered correctly.

ramble.test.experiment_set.test_chained_experiments_populate_new_experiments(workspace_name)[source]
ramble.test.experiment_set.test_chained_invalid_order_errors(workspace_name)[source]
ramble.test.experiment_set.test_cross_experiment_missing_experiment_errors(workspace_name)[source]
ramble.test.experiment_set.test_cross_experiment_variable_references(workspace_name)[source]
ramble.test.experiment_set.test_custom_executables_track_variables(workspace_name)[source]
ramble.test.experiment_set.test_experiment_names_match(workspace_name)[source]
ramble.test.experiment_set.test_explicit_zips_in_matrix(workspace_name)[source]
ramble.test.experiment_set.test_explicit_zips_unconsumed(workspace_name)[source]
ramble.test.experiment_set.test_explicit_zips_work(workspace_name)[source]
ramble.test.experiment_set.test_full_experiments_from_dict(workspace_name)[source]
ramble.test.experiment_set.test_matrix_experiments(workspace_name)[source]
ramble.test.experiment_set.test_matrix_experiments_explicit_excludes(workspace_name)[source]
ramble.test.experiment_set.test_matrix_multiplication_experiments(workspace_name)[source]
ramble.test.experiment_set.test_matrix_undefined_var_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_matrix_vector_experiments(workspace_name)[source]
ramble.test.experiment_set.test_missing_required_keyword_errors(workspace_name)[source]
ramble.test.experiment_set.test_modifiers_no_version_set_correctly(workspace_name, mock_modifiers)[source]
ramble.test.experiment_set.test_modifiers_set_correctly(workspace_name, mock_modifiers)[source]
ramble.test.experiment_set.test_multi_matrix_experiments(workspace_name)[source]
ramble.test.experiment_set.test_n_nodes_correct_defaults(workspace_name)[source]
ramble.test.experiment_set.test_n_ranks_correct_defaults(workspace_name)[source]
ramble.test.experiment_set.test_nonunique_vector_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_processes_per_node_correct_defaults(workspace_name)[source]
ramble.test.experiment_set.test_repeated_experiments(workspace_name)[source]

Test that repeated experiments are rendered correctly.

ramble.test.experiment_set.test_reserved_keywords_error_in_application(workspace_name, var)[source]
ramble.test.experiment_set.test_reserved_keywords_error_in_experiment(workspace_name, var)[source]
ramble.test.experiment_set.test_reserved_keywords_error_in_workload(workspace_name, var)[source]
ramble.test.experiment_set.test_single_experiment_in_set()[source]
ramble.test.experiment_set.test_single_var_explicit_zip(workspace_name)[source]
ramble.test.experiment_set.test_unused_var_propagates_to_chain(workspace_name)[source]
ramble.test.experiment_set.test_unused_vector_no_error(workspace_name)[source]
ramble.test.experiment_set.test_unused_zip_no_error(workspace_name)[source]
ramble.test.experiment_set.test_validation_in_render_repeat_experiments(workspace_name)[source]

Test that validation is called in _render_repeat_experiments.

ramble.test.experiment_set.test_vector_experiment_in_set()[source]
ramble.test.experiment_set.test_vector_experiment_with_explicit_excludes(workspace_name)[source]
ramble.test.experiment_set.test_vector_experiment_with_late_where_excludes(workspace_name)[source]
ramble.test.experiment_set.test_vector_experiment_with_multi_where_excludes(workspace_name)[source]
ramble.test.experiment_set.test_vector_experiment_with_where_excludes(workspace_name)[source]
ramble.test.experiment_set.test_vector_length_mismatch_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_zip_multi_use_var_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_zip_non_list_var_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_zip_variable_lengths_errors(workspace_name, capsys)[source]
ramble.test.experiment_set.test_zipped_vector_experiments(workspace_name)[source]

ramble.test.fetch_strategy module

Perform tests of the fetch_strategy functions

class ramble.test.fetch_strategy.TestCvsFetchStrategy[source]

Bases: object

fetcher(tmp_path)[source]

Create a CvsFetchStrategy with a mock stage.

mock_vcs_executables(monkeypatch)[source]

Mock vcs executables.

test_archive(fetcher, mock_vcs_executables)[source]
test_cachable()[source]
test_fetch(fetcher, mock_vcs_executables, monkeypatch)[source]
test_init()[source]
test_mirror_id()[source]
test_remove_untracked_files(fetcher, mock_vcs_executables, monkeypatch)[source]
test_reset(fetcher, mock_vcs_executables, monkeypatch)[source]
test_source_id()[source]
test_str()[source]
class ramble.test.fetch_strategy.TestFsCache[source]

Bases: object

test_store_already_cached(tmp_path)[source]

Test that store does nothing for an already cached fetcher.

test_store_cachable_and_destroy(tmp_path)[source]

Test that store caches a cachable fetcher and destroy works.

test_store_uncachable(tmp_path)[source]

Test that store does nothing for an uncachable fetcher.

class ramble.test.fetch_strategy.TestGitFetchStrategy[source]

Bases: object

fetcher(tmp_path, monkeypatch)[source]

Create a GitFetchStrategy with a mock stage.

mock_config(monkeypatch)[source]

Mock ramble.config.

mock_git(monkeypatch)[source]

Mock the git executable and related functions.

test_clone_basic(fetcher, mock_git, mock_config)[source]

Test basic git clone.

test_clone_with_commit(fetcher, mock_git, mock_config)[source]

Test clone with a specific commit.

test_clone_with_submodules(fetcher, mock_git, mock_config)[source]

Test clone with submodules.

class ramble.test.fetch_strategy.TestHgFetchStrategy[source]

Bases: object

fetcher(tmp_path)[source]

Create a HgFetchStrategy with a mock stage.

mock_vcs_executables(monkeypatch)[source]

Mock vcs executables.

test_archive(fetcher, mock_vcs_executables)[source]
test_cachable()[source]
test_fetch(fetcher, mock_vcs_executables, monkeypatch)[source]
test_init()[source]
test_mirror_id()[source]
test_reset(fetcher, mock_vcs_executables, monkeypatch)[source]
test_source_id()[source]
test_str()[source]
class ramble.test.fetch_strategy.TestSvnFetchStrategy[source]

Bases: object

fetcher(tmp_path)[source]

Create a SvnFetchStrategy with a mock stage.

mock_vcs_executables(monkeypatch)[source]

Mock vcs executables.

test_archive(fetcher, mock_vcs_executables)[source]
test_cachable()[source]
test_fetch(fetcher, mock_vcs_executables, monkeypatch)[source]
test_init()[source]
test_mirror_id()[source]
test_reset(fetcher, mock_vcs_executables, monkeypatch)[source]
test_source_id()[source]
test_str()[source]
class ramble.test.fetch_strategy.TestURLFetchStrategy[source]

Bases: object

fetcher(tmp_path)[source]

Create a URLFetchStrategy with a mock stage.

mock_config(monkeypatch)[source]

Mock ramble.config.

mock_curl(monkeypatch)[source]

Mock the curl executable.

mock_tty(monkeypatch)[source]

Mock tty.

test_fetch_curl_404(fetcher, mock_curl, mock_config, mock_tty, tmp_path)[source]

Test fetch with curl when a 404 error occurs.

test_fetch_curl_cert_error(fetcher, mock_curl, mock_config, mock_tty)[source]

Test fetch with curl when a certificate error occurs.

test_fetch_curl_content_mismatch(fetcher, mock_curl, mock_config, mock_tty, monkeypatch)[source]

Test fetch with curl when content type is HTML.

test_fetch_curl_no_verify_ssl(fetcher, mock_curl, mock_config, mock_tty)[source]

Test that -k is passed to curl when verify_ssl is false.

test_fetch_curl_success(fetcher, mock_curl, mock_config, mock_tty, tmp_path)[source]

Test successful fetch with curl.

class ramble.test.fetch_strategy.TestVCSFetchStrategy[source]

Bases: object

class DummyVCS(**kwargs)[source]

Bases: VCSFetchStrategy

optional_attrs: List[str] = ['revision']
url_attr: str | None = 'dummy_url'

The URL attribute must be specified either at the package class level, or as a keyword argument to version(). It is used to distinguish fetchers for different versions in the package DSL.

mock_tar(monkeypatch)[source]

Mock the tar executable.

test_archive(tmp_path, mock_tar)[source]

Test the archive method.

test_archive_with_exclude(tmp_path, mock_tar)[source]

Test the archive method with exclude patterns.

test_archive_with_srcdir(tmp_path, mock_tar, monkeypatch)[source]

Test the archive method with stage.srcdir set.

test_check_and_expand()[source]

Test that check() and expand() run without error.

test_init()[source]

Test initialization of VCSFetchStrategy.

test_init_no_url()[source]

Test that __init__ raises ValueError if url_attr is missing.

test_str()[source]

Test __str__ method.

ramble.test.fetch_strategy.test_bad_from_url_scheme()[source]
ramble.test.fetch_strategy.test_from_url_scheme(url, expected_fetcher_type)[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, monkeypatch)[source]

Ensure fetch of fie.

ramble.test.gcs_fetch.test_gcsfetchstrategy_downloaded(tmpdir, _fetch_method)[source]

Ensure fetch with archive file already downloaded is a noop.

ramble.test.gcs_fetch.test_gcsfetchstrategy_without_url(_fetch_method)[source]

Ensure constructor with no URL fails.

ramble.test.get_file_path module

ramble.test.get_file_path.test_get_file_path(mock_applications, mock_file_auto_create, workspace_name)[source]

ramble.test.impossible_when module

ramble.test.impossible_when.test_info_impossible_when(mock_applications)[source]
ramble.test.impossible_when.test_info_truly_impossible(mock_applications)[source]
ramble.test.impossible_when.test_info_value_conflict_impossible(mock_applications)[source]
ramble.test.impossible_when.test_info_version_impossible(mock_applications)[source]

ramble.test.mirror module

class ramble.test.mirror.MockFetcher[source]

Bases: object

Mock fetcher object which implements the necessary functionality for testing MirrorCache

static archive(dst)[source]
ramble.test.mirror.check_mirror(mirror_path, app_name, app_class)[source]
ramble.test.mirror.create_archive(archive_dir, app_class)[source]

Confirm that the cosmetic symlink created in the mirror cache (which may be relative) targets the storage path correctly.

ramble.test.mirror.test_mirror_create(tmpdir, mutable_mock_workspace_path, app_name, tmpdir_factory)[source]
ramble.test.mirror.test_mirror_str_and_repr()[source]

ramble.test.mock_spack_runner module

class ramble.test.mock_spack_runner.MockPackageInfo(data)[source]

Bases: object

to_dict()[source]
to_version_text()[source]
class ramble.test.mock_spack_runner.MockSpackRunner[source]

Bases: object

activate()[source]
add_config(config)[source]
add_config_file(config_file)[source]
add_include_file(path)[source]
add_spec(spec)[source]
added_packages()[source]
apply_configs(stage_path=None)[source]
concretize()[source]
configure_env(env_path)[source]
copy_from_external_env(env)[source]
create_env(env_path)[source]
create_stage_env()[source]
deactivate()[source]
generate_activate_command()[source]
generate_deactivate_command()[source]
generate_env_file()[source]
generate_source_command()[source]
get_package_path(spec)[source]
get_version()[source]
install()[source]
inventory_hash()[source]
migrate_stage_env(stage_env_path: str, ws_env_path: str)[source]
package_definitions()[source]
package_provenance()[source]
set_compiler_config_dir(path)[source]
set_dry_run(dry_run)[source]
set_env(env_path, require_exists=True)[source]

ramble.test.modifier_application module

ramble.test.modifier_application.test_wrfv4_aps_test(mutable_config, mutable_mock_workspace_path, workspace_name)[source]

ramble.test.modifier_language module

Perform tests of the Application class

ramble.test.modifier_language.add_archive_pattern(mod_inst, archive_num=1)[source]
ramble.test.modifier_language.add_compiler(mod_inst, spec_num=1)[source]
ramble.test.modifier_language.add_env_var_modification(mod_inst, env_var_mod_num=1)[source]
ramble.test.modifier_language.add_executable_modifier(mod_inst, exec_mod_num=1)[source]
ramble.test.modifier_language.add_figure_of_merit(mod_inst, context_num=1)[source]
ramble.test.modifier_language.add_figure_of_merit_context(mod_inst, context_num=1)[source]
ramble.test.modifier_language.add_mode(mod_inst, mode_num=1)[source]
ramble.test.modifier_language.add_modifier_variable(mod_inst, mod_var_num=1)[source]
ramble.test.modifier_language.add_required_package(mod_inst, pkg_num=1)[source]
ramble.test.modifier_language.add_software_spec(mod_inst, spec_num=1)[source]
ramble.test.modifier_language.add_variable_modification(mod_inst, var_mod_num=1)[source]
ramble.test.modifier_language.test_archive_pattern_directive(mod_class)[source]
ramble.test.modifier_language.test_define_compiler_directive(mod_class)[source]
ramble.test.modifier_language.test_env_var_modification_directive(mod_class)[source]
ramble.test.modifier_language.test_executable_modifier_directive(mod_class)[source]
ramble.test.modifier_language.test_figure_of_merit_context_directive(mod_class)[source]
ramble.test.modifier_language.test_figure_of_merit_directive(mod_class)[source]
ramble.test.modifier_language.test_merge_conditions_creates_when_list(mod_class)[source]
ramble.test.modifier_language.test_mode_directive(mod_class)[source]
ramble.test.modifier_language.test_modifier_class_attributes(mod_class)[source]
ramble.test.modifier_language.test_modifier_conflict_usage_error()[source]
ramble.test.modifier_language.test_modifier_type_features(mod_class)[source]
ramble.test.modifier_language.test_modifier_variable_directive(mod_class)[source]
ramble.test.modifier_language.test_required_package_directive(mod_class)[source]
ramble.test.modifier_language.test_software_spec_directive(mod_class)[source]
ramble.test.modifier_language.test_variable_modification_directive(mod_class)[source]
ramble.test.modifier_language.test_variable_modification_invalid_method(mod_class)[source]
ramble.test.modifier_language.test_variable_modification_modeless(mod_class)[source]

ramble.test.namespace_trie module

ramble.test.namespace_trie.test_add_multiple(trie)[source]
ramble.test.namespace_trie.test_add_none_multiple(trie)[source]
ramble.test.namespace_trie.test_add_none_single(trie)[source]
ramble.test.namespace_trie.test_add_single(trie)[source]
ramble.test.namespace_trie.test_add_three(trie)[source]
ramble.test.namespace_trie.trie()[source]

ramble.test.package_manager_language module

Perform tests of the package manager class

ramble.test.package_manager_language.add_variable(pm_inst, pm_num=1)[source]
ramble.test.package_manager_language.test_pkg_man_type_features(pm_class)[source]
ramble.test.package_manager_language.test_pkg_man_variables(pm_class)[source]

ramble.test.reports module

ramble.test.reports.create_test_exp_result(ramble_status: str, experiment_name: str, application_name: str, workload_name: str, foms: list, ramble_vars: dict | None, ramble_raw_vars: dict | None, **kwargs)[source]

Creates an experiment results dict in the format of results imported from JSON or YAML.

Parameters:
  • ramble_status – Status (e.g. “SUCCESS”, “FAILED”)

  • experiment_name – name of the experiment

  • application_name – name of the app

  • workload_name – name of the workload

  • foms – List of tuples (context, (fom_name, value, units, origin, origin_type, fom_type))

  • ramble_vars – Dict of any variables to add to RAMBLE_VARIABLES

  • ramble_raw_vars – Dict of any variables to add to RAMBLE_RAW_VARIABLES

  • kwargs – Any kwargs will be added to the experiment dict as k/v pairs, (e.g., “n_nodes=1”)

ramble.test.reports.create_test_fom_result(name, value, units, origin, origin_type, fom_type)[source]
ramble.test.reports.test_compare_plot(mutable_mock_workspace_path, tmpdir_factory)[source]
ramble.test.reports.test_compare_plot_with_simplify_names(mutable_mock_workspace_path, tmpdir_factory)[source]
ramble.test.reports.test_fom_plot(mutable_mock_workspace_path, tmpdir_factory)[source]
ramble.test.reports.test_fom_plot_with_simplify_names(mutable_mock_workspace_path, tmpdir_factory)[source]
ramble.test.reports.test_index_printing(mutable_mock_workspace_path, tmpdir_factory, format)[source]
ramble.test.reports.test_multiline_plot(mutable_mock_workspace_path, mutable_config, tmpdir_factory)[source]
ramble.test.reports.test_multiple_groupby(mutable_mock_workspace_path, tmpdir_factory, capsys)[source]
ramble.test.reports.test_repeat_import(mutable_mock_workspace_path)[source]
ramble.test.reports.test_scaling_plots(mutable_mock_workspace_path, tmpdir_factory, values)[source]
ramble.test.reports.test_simplify_names()[source]
ramble.test.reports.test_where_query(mutable_mock_workspace_path)[source]

ramble.test.repository module

ramble.test.repository.extra_repo(tmpdir_factory, request)[source]
ramble.test.repository.test_list_object_files(obj_name, obj_type, expected, mutable_apps_repo_path, mutable_mods_repo_path, mutable_pkg_mans_repo_path)[source]
ramble.test.repository.test_repo_app_with_unknown_namespace(mutable_mock_apps_repo)[source]
ramble.test.repository.test_repo_getapp(mutable_mock_apps_repo)[source]
ramble.test.repository.test_repo_multi_getapp(mutable_mock_apps_repo, extra_repo)[source]
ramble.test.repository.test_repo_multi_getappclass(mutable_mock_apps_repo, extra_repo)[source]
ramble.test.repository.test_repo_unknown_app(mutable_mock_apps_repo)[source]

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_is_used_property(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.software_environment.test_undefined_compiler_errors(request, mutable_mock_workspace_path)[source]
ramble.test.software_environment.test_undefined_package_errors(request, mutable_mock_workspace_path)[source]

ramble.test.spec module

class ramble.test.spec.TestSpec[source]

Bases: object

Tests for the Spec class.

test_format()[source]
test_format_errors(format_str)[source]
test_init_empty_and_copy()[source]
test_init_from_string(spec_str, expected_name, expected_namespace, expected_fullname)[source]

ramble.test.spec_basic module

Perform tests of the Spec class

class ramble.test.spec_basic.TestSpec[source]

Bases: object

test_spec_copy()[source]
test_spec_examples()[source]

ramble.test.stage module

Test that the Stage class works correctly.

class ramble.test.stage.StageInclude(*values)[source]

Bases: IntEnum

extra = 3
hidden = 2
readme = 1
class ramble.test.stage.TestStage[source]

Bases: object

stage_name = 'ramble-test-stage'
test_composite_stage_with_expand_resource(composite_stage_with_expanding_resource)[source]
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_composite_stage_with_noexpand_resource(mock_stage_archive, mock_noexpand_resource)[source]
test_ensure_one_stage_entry(mock_stage_archive)[source]
test_expand_archive(expected_file_list, mock_stage_archive)[source]
test_expand_archive_extra_expand(mock_stage_archive)[source]

Test expand with an extra expand after expand (i.e., no-op).

test_fetch(mock_stage_archive, debug)[source]
test_input_path_available(mock_stage_archive)[source]

Ensure input path available but does not exist on instantiation.

test_keep_exceptions(mock_stage_archive)[source]
test_keep_without_exceptions(mock_stage_archive)[source]
test_no_keep_with_exceptions(mock_stage_archive)[source]
test_no_keep_without_exceptions(mock_stage_archive)[source]
test_no_search_if_default_succeeds(mock_stage_archive, failing_search_fn)[source]
test_no_search_mirror_only(failing_fetch_strategy, failing_search_fn, tmpdir)[source]
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.

test_restage(mock_stage_archive)[source]
test_search_if_default_fails(failing_fetch_strategy, search_fn, err_msg, expected, tmpdir)[source]
test_setup_and_destroy_name_with_tmp(mock_stage_archive)[source]
test_setup_and_destroy_name_without_tmp(mock_stage_archive)[source]
test_setup_no_name_fails(mock_stage_archive)[source]
test_stage_constructor_no_fetcher()[source]

Ensure Stage constructor with no URL or fetch strategy fails.

test_stage_constructor_with_path(tmpdir)[source]

Ensure Stage constructor with a path uses it.

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.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.failing_fetch_strategy()[source]

Returns a fetch strategy that fails.

ramble.test.stage.failing_search_fn()[source]

Returns a search function that fails! Always!

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.search_fn()[source]

Returns a search function that always succeeds.

ramble.test.stage.test_cannot_access(capsys)[source]

Ensure can_access dies with the expected error.

ramble.test.stage.test_stage_create_replace_path(tmp_build_stage_dir)[source]

Ensure stage creation replaces a non-directory path.

ramble.test.stage.tmp_build_stage_dir(tmpdir)[source]

Use a temporary test directory for the stage root.

ramble.test.success_criteria module

ramble.test.success_criteria.generate_file(path)[source]
ramble.test.success_criteria.remark_all(crit_list, file_path)[source]
ramble.test.success_criteria.test_criteria_list(tmpdir)[source]
ramble.test.success_criteria.test_single_criteria(tmpdir)[source]
ramble.test.success_criteria.test_success_criteria_globbing()[source]

ramble.test.test_context_columns module

class ramble.test.test_context_columns.TestContextColumns(methodName='runTest')[source]

Bases: TestCase

test_autocolumn_context_name_variable()[source]
test_autocolumn_match_instance_name_regex()[source]
test_autocolumn_null_context()[source]
test_autocolumn_origin_filter()[source]
test_autocolumn_regex_groups()[source]
test_context_column_ambiguous_names()[source]
test_context_column_discovery()[source]
test_context_column_fom_globbing()[source]
test_context_column_manual_conflict()[source]
test_context_column_mixed_sorting()[source]
test_context_column_sorting()[source]
test_context_column_where_clause()[source]
test_table_transpose()[source]

ramble.test.test_deployment module

class ramble.test.test_deployment.TestPushDeploymentPipeline(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_complete_copies_inventory_files()[source]

ramble.test.test_results_tables module

class ramble.test.test_results_tables.TestResultsColumn(methodName='runTest')[source]

Bases: TestCase

test_col_name()[source]
test_extract_value_expression()[source]
test_extract_value_fom()[source]
test_extract_value_where_fails()[source]
test_init()[source]
test_init_both_expression_and_fom(mock_die)[source]
test_init_missing_expression_and_fom(mock_die)[source]
class ramble.test.test_results_tables.TestResultsTable(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_add_where()[source]
test_extract_row()[source]
test_init()[source]
test_to_csv(mock_import_pandas, mock_symlink)[source]
class ramble.test.test_results_tables.TestResultsTables(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_add_table_template()[source]
test_build_tables()[source]
test_output_tables()[source]

ramble.test.uploader module

ramble.test.uploader.mock_results_with_metadata()[source]
ramble.test.uploader.test_create_tables_dataset_does_not_exist(mock_bigquery_client)[source]
ramble.test.uploader.test_create_tables_dataset_exists(mock_bigquery_client)[source]
ramble.test.uploader.test_data_preparation(request, mock_applications)[source]
ramble.test.uploader.test_experiment_metadata_preparation(mock_results_with_metadata, mutable_config)[source]
ramble.test.uploader.test_fom_validation_fails_with_none()[source]

Test that FOM validation fails when value is None

ramble.test.uploader.test_sqlite_uploader_chunked_upload_errors(tmpdir, mock_results_with_metadata, capsys)[source]
ramble.test.uploader.test_sqlite_uploader_create_tables_and_upload(tmpdir, mock_results_with_metadata)[source]
ramble.test.uploader.test_sqlite_uploader_create_tables_with_existing(tmpdir, mock_results_with_metadata, capsys)[source]
ramble.test.uploader.test_sqlite_uploader_perform_upload_no_db(tmpdir, mock_results_with_metadata, capsys)[source]
ramble.test.uploader.test_upload_results_errs(upload_uri, upload_type, results, expected_err_msg)[source]

ramble.test.variant module

ramble.test.variant.test_boolean_variants(request)[source]
ramble.test.variant.test_changed_variant_value_works_with_when(request)[source]
ramble.test.variant.test_default_arg_works(request)[source]
ramble.test.variant.test_default_variant_value_works_with_when(request)[source]
ramble.test.variant.test_invalid_variant_value_errors(request)[source]
ramble.test.variant.test_modifier_variants_works_with_when(test_name, mode, expected_spec, mutable_mock_workspace_path, mutable_mock_apps_repo, mock_modifiers)[source]
ramble.test.variant.test_non_matched_variants_are_ignored(request)[source]
ramble.test.variant.test_variant_expansion(workspace_name, variant_scope, expected_bool, expected_val)[source]
ramble.test.variant.test_variant_info_works(request)[source]
ramble.test.variant.test_variant_nesting_works(workspace_name, test_value)[source]

ramble.test.version module

ramble.test.version.test_application_version_variant_when(workspace_name, version, expected_zlib)[source]
ramble.test.version.test_define_version_variables_errors(workspace_name)[source]
ramble.test.version.test_multi_modifier_versions(workspace_name)[source]
ramble.test.version.test_non_pep440_application_version_variant_when(workspace_name, version, expected_zlib)[source]
ramble.test.version.test_non_pep440_version_number(workspace_name)[source]
ramble.test.version.test_only_one_preferred_version_allowed()[source]
ramble.test.version.test_repeat_modifier_versions_error(workspace_name)[source]
ramble.test.version.test_strict_versions_config(workspace_name, capsys)[source]
ramble.test.version.test_strict_versions_directive(workspace_name)[source]

Test that the strict_versions(False) directive works correctly.

ramble.test.version.test_version_variable_expansion_info(workspace_name)[source]
ramble.test.version.test_versions_inherited_from_base_app(workspace_name)[source]

ramble.test.when module

ramble.test.when.test_conflicts_version_when(workspace_name, version, validation, fails)[source]
ramble.test.when.test_conflicts_when(workspace_name, zlib_type, validation, fails)[source]
ramble.test.when.test_env_var_modification_when(workspace_name, env_var_mod_when, expected_exec)[source]
ramble.test.when.test_executable_errors_when_overlapping_conditions(workspace_name)[source]
ramble.test.when.test_executable_modification_when(workspace_name, exec_mod_when, expected_exec)[source]
ramble.test.when.test_executable_when(workspace_name, exec_variant_on, exec_ver2_found, skipped_exec_found)[source]
ramble.test.when.test_fom_context_enabled_when_true(workspace_name)[source]
ramble.test.when.test_fom_enabled_when_true(workspace_name)[source]
ramble.test.when.test_fom_errors_when_context_not_found(workspace_name)[source]
ramble.test.when.test_fom_overwrites_when_inherited(workspace_name)[source]
ramble.test.when.test_formatted_exec_when(workspace_name, inc_value, type_value)[source]
ramble.test.when.test_input_when(workspace_name, input_when, expected_input_file)[source]
ramble.test.when.test_modifier_variable_when(workspace_name, inc_value, mutable_mock_mods_repo)[source]
ramble.test.when.test_obj_env_var_when(workspace_name, obj, mutable_mock_wms_repo, mutable_mock_pkg_mans_repo)[source]
ramble.test.when.test_obj_required_key_when(workspace_name, obj, mutable_mock_wms_repo, mutable_mock_pkg_mans_repo)[source]
ramble.test.when.test_obj_required_var_when(workspace_name, obj, mutable_mock_wms_repo, mutable_mock_pkg_mans_repo)[source]
ramble.test.when.test_object_conflicts_expander_errors(workspace_name, variant_name)[source]
ramble.test.when.test_object_conflicts_no_msg(workspace_name)[source]
ramble.test.when.test_object_conflicts_warn_only(workspace_name)[source]
ramble.test.when.test_package_manager_requirement_when(workspace_name)[source]
ramble.test.when.test_package_manager_variable_when(workspace_name, inc_value, mutable_mock_pkg_mans_repo)[source]
ramble.test.when.test_register_builtin_when(workspace_name, include_builtin, builtin_found)[source]
ramble.test.when.test_register_phase_when(workspace_name)[source]
ramble.test.when.test_register_template_when(workspace_name)[source]
ramble.test.when.test_register_validator_when(workspace_name, validator_value, fails)[source]
ramble.test.when.test_same_fom_name_different_context(workspace_name)[source]
ramble.test.when.test_success_criteria_when(workspace_name)[source]
ramble.test.when.test_variable_modification_when(workspace_name, var_mod_when, modifier_mode, expected_exec)[source]
ramble.test.when.test_variable_when(workspace_name, inc_value, type_value)[source]
ramble.test.when.test_variable_when_workload_constraint(workspace_name, workload_name)[source]
ramble.test.when.test_workflow_manager_variable_when(workspace_name, inc_value, mutable_mock_wms_repo)[source]
ramble.test.when.test_workload_definition_when(workspace_name, wl_def_when, expected_exec)[source]
ramble.test.when.test_workload_errors_when_not_enabled(workspace_name)[source]
ramble.test.when.test_workload_errors_when_overlapping_conditions(workspace_name)[source]
ramble.test.when.test_workload_group_when(workspace_name, active_variant, active_workload, disabled_variant, disabled_workload)[source]

ramble.test.workspace module

ramble.test.workspace.test_all_config_files()[source]
ramble.test.workspace.test_all_workspace_names_multiple_dirs(tmpdir, monkeypatch)[source]
ramble.test.workspace.test_get_workspace()[source]
ramble.test.workspace.test_re_read(tmpdir)[source]
ramble.test.workspace.test_read_file_content(tmpdir)[source]
ramble.test.workspace.test_template_path()[source]