spack.test.cmd package¶
Subpackages¶
Submodules¶
spack.test.cmd.activate module¶
- spack.test.cmd.activate.test_activate(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
spack.test.cmd.analyze module¶
- spack.test.cmd.analyze.test_analyze_output(tmpdir, mock_fetch, install_mockery_mutable_config)[source]¶
Test that an analyzer errors if requested name does not exist.
- spack.test.cmd.analyze.test_analyzer_get_install_dir(mock_fetch, install_mockery_mutable_config)[source]¶
Test that we cannot get an analyzer directory without a spec package.
- spack.test.cmd.analyze.test_configargs_analyzer(tmpdir, mock_fetch, install_mockery_mutable_config)[source]¶
test the config args analyzer.
Since we don’t have any, this should return an empty result.
- spack.test.cmd.analyze.test_environment_analyzer(tmpdir, mock_fetch, install_mockery_mutable_config)[source]¶
test the environment variables analyzer.
- spack.test.cmd.analyze.test_installfiles_analyzer(tmpdir, mock_fetch, install_mockery_mutable_config)[source]¶
test the install files analyzer
- spack.test.cmd.analyze.test_list_analyzers()[source]¶
test that listing analyzers shows all the possible analyzers.
spack.test.cmd.arch module¶
- spack.test.cmd.arch.test_arch_operating_system()[source]¶
Sanity check
spack arch --operating-system
to make sure it works.
- spack.test.cmd.arch.test_arch_platform()[source]¶
Sanity check
spack arch --platform
to make sure it works.
spack.test.cmd.audit module¶
- spack.test.cmd.audit.test_audit_configs(mutable_config, mock_packages)[source]¶
Sanity check
spack audit packages
to make sure it works.
spack.test.cmd.blame module¶
- spack.test.cmd.blame.test_blame_by_git(mock_packages, capfd)[source]¶
Sanity check the blame command to make sure it works.
- spack.test.cmd.blame.test_blame_by_modtime(mock_packages)[source]¶
Sanity check the blame command to make sure it works.
- spack.test.cmd.blame.test_blame_by_percent(mock_packages)[source]¶
Sanity check the blame command to make sure it works.
spack.test.cmd.bootstrap module¶
spack.test.cmd.build_env module¶
spack.test.cmd.buildcache module¶
- spack.test.cmd.buildcache.test_buildcache_create_fail_on_perm_denied(install_mockery, mock_fetch, monkeypatch, tmpdir)[source]¶
Ensure that buildcache create fails on permission denied error.
- spack.test.cmd.buildcache.test_buildcache_create_fails_on_noargs(tmpdir)[source]¶
Ensure that buildcache create fails when given no args or environment.
- spack.test.cmd.buildcache.test_buildcache_create_install(mutable_mock_env_path, install_mockery_mutable_config, mock_packages, mock_fetch, mock_stage, monkeypatch, tmpdir)[source]¶
“Ensure that buildcache create creates output files
- spack.test.cmd.buildcache.test_buildcache_list_allarch(database, mock_get_specs_multiarch, capsys)[source]¶
- spack.test.cmd.buildcache.test_buildcache_sync(mutable_mock_env_path, install_mockery_mutable_config, mock_packages, mock_fetch, mock_stage, tmpdir)[source]¶
Make sure buildcache sync works in an environment-aware manner, ignoring any specs that may be in the mirror but not in the environment.
- spack.test.cmd.buildcache.test_update_key_index(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, mock_fetch, mock_stage, mock_gnupghome)[source]¶
Test the update-index command with the –keys option
spack.test.cmd.cd module¶
spack.test.cmd.checksum module¶
spack.test.cmd.ci module¶
- spack.test.cmd.ci.test_ci_generate_bootstrap_artifacts_buildcache(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env)[source]¶
Test that we can bootstrap a compiler when artifacts buildcache is turned on
- spack.test.cmd.ci.test_ci_generate_bootstrap_gcc(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env)[source]¶
Test that we can bootstrap a compiler and use it as the compiler for a spec in the environment
- spack.test.cmd.ci.test_ci_generate_bootstrap_prune_dag(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir, mutable_mock_env_path, project_dir_env)[source]¶
Test compiler bootstrapping with DAG pruning. Specifically, make sure that if we detect the bootstrapped compiler needs to be rebuilt, we ensure the spec we want to build with that compiler is scheduled for rebuild as well.
- spack.test.cmd.ci.test_ci_generate_for_pr_pipeline(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env)[source]¶
Test that PR pipelines do not include a final stage job for rebuilding the mirror index, even if that job is specifically configured
- spack.test.cmd.ci.test_ci_generate_override_runner_attrs(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env)[source]¶
Test that we get the behavior we want with respect to the provision of runner attributes like tags, variables, and scripts, both when we inherit them from the top level, as well as when we override one or more at the runner level
- spack.test.cmd.ci.test_ci_generate_pkg_with_deps(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env)[source]¶
Test pipeline generation for a package w/ dependencies
- spack.test.cmd.ci.test_ci_generate_read_broken_specs_url(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env)[source]¶
Verify that broken-specs-url works as intended
- spack.test.cmd.ci.test_ci_generate_temp_storage_url(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env, mock_binary_index)[source]¶
Verify correct behavior when using temporary-storage-url-prefix
- spack.test.cmd.ci.test_ci_generate_with_cdash_token(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env, mock_binary_index)[source]¶
Make sure we it doesn’t break if we configure cdash
- spack.test.cmd.ci.test_ci_generate_with_custom_scripts(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env, mock_binary_index)[source]¶
Test use of user-provided scripts
- spack.test.cmd.ci.test_ci_generate_with_env(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env, mock_binary_index)[source]¶
Make sure we can get a .gitlab-ci.yml from an environment file which has the gitlab-ci, cdash, and mirrors sections.
- spack.test.cmd.ci.test_ci_generate_with_env_missing_section(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, project_dir_env, mock_binary_index)[source]¶
Make sure we get a reasonable message if we omit gitlab-ci section
- spack.test.cmd.ci.test_ci_generate_with_external_pkg(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env)[source]¶
Make sure we do not generate jobs for external pkgs
- spack.test.cmd.ci.test_ci_generate_with_workarounds(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, project_dir_env)[source]¶
Make sure the post-processing cli workarounds do what they should
- spack.test.cmd.ci.test_ci_nothing_to_rebuild(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, mock_fetch, project_dir_env, mock_binary_index)[source]¶
- spack.test.cmd.ci.test_ci_rebuild(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, mock_gnupghome, mock_fetch, project_dir_env, mock_binary_index)[source]¶
- spack.test.cmd.ci.test_ci_rebuild_index(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, mock_fetch, mock_stage)[source]¶
- spack.test.cmd.ci.test_ci_reproduce(tmpdir, mutable_mock_env_path, install_mockery, mock_packages, monkeypatch, last_two_git_commits, project_dir_env, mock_binary_index)[source]¶
- spack.test.cmd.ci.test_ci_subcommands_without_mirror(tmpdir, mutable_mock_env_path, mock_packages, install_mockery, project_dir_env, mock_binary_index)[source]¶
Make sure we catch if there is not a mirror and report an error
- spack.test.cmd.ci.test_ensure_only_one_temporary_storage()[source]¶
Make sure ‘gitlab-ci’ section of env does not allow specification of both ‘enable-artifacts-buildcache’ and ‘temporary-storage-url-prefix’.
- spack.test.cmd.ci.test_push_mirror_contents(tmpdir, mutable_mock_env_path, install_mockery_mutable_config, mock_packages, mock_fetch, mock_stage, mock_gnupghome, project_dir_env)[source]¶
- spack.test.cmd.ci.test_specs_staging(config)[source]¶
Make sure we achieve the best possible staging for the following spec DAG:
a /| c b | e d | f g
In this case, we would expect ‘c’, ‘e’, ‘f’, and ‘g’ to be in the first stage, and then ‘d’, ‘b’, and ‘a’ to be put in the next three stages, respectively.
spack.test.cmd.clean module¶
spack.test.cmd.commands module¶
spack.test.cmd.compiler module¶
- spack.test.cmd.compiler.clangdir(tmpdir)[source]¶
Create a directory with some dummy compiler scripts in it.
- Scripts are:
clang
clang++
gcc
g++
gfortran-8
- spack.test.cmd.compiler.mock_compiler_dir(tmpdir, mock_compiler_version)[source]¶
Return a directory containing a fake, but detectable compiler.
- spack.test.cmd.compiler.test_compiler_add(mutable_config, mock_packages, mock_compiler_dir, mock_compiler_version)[source]¶
- spack.test.cmd.compiler.test_compiler_find_mixed_suffixes(no_compilers_yaml, working_env, clangdir)[source]¶
Ensure that we’ll mix compilers with different suffixes when necessary.
- spack.test.cmd.compiler.test_compiler_find_no_apple_gcc(no_compilers_yaml, working_env, tmpdir)[source]¶
- spack.test.cmd.compiler.test_compiler_find_path_order(no_compilers_yaml, working_env, clangdir)[source]¶
Ensure that we find compilers that come first in the PATH first
- spack.test.cmd.compiler.test_compiler_find_prefer_no_suffix(no_compilers_yaml, working_env, clangdir)[source]¶
Ensure that we’ll pick ‘clang’ over ‘clang-gpu’ when there is a choice.
spack.test.cmd.concretize module¶
- spack.test.cmd.concretize.test_concretize_all_test_dependencies(concretization)[source]¶
Check all test dependencies are concretized.
spack.test.cmd.config module¶
- spack.test.cmd.config.check_packages_updated(data)[source]¶
Check that the data from the packages_yaml_v015 has been updated.
- spack.test.cmd.config.config_yaml_v015(mutable_config)[source]¶
Create a packages.yaml in the old format
- spack.test.cmd.config.packages_yaml_v015(mutable_config)[source]¶
Create a packages.yaml in the old format
- spack.test.cmd.config.test_config_add_override_leaf_from_file(mutable_empty_config, tmpdir)[source]¶
- spack.test.cmd.config.test_config_add_to_env_preserve_comments(mutable_empty_config, mutable_mock_env_path, tmpdir)[source]¶
- spack.test.cmd.config.test_config_prefer_upstream(tmpdir_factory, install_mockery, mock_fetch, mutable_config, gen_mock_layout, monkeypatch)[source]¶
Check that when a dependency package is recorded as installed in an upstream database that it is not reinstalled.
- spack.test.cmd.config.test_config_remove_from_env(mutable_empty_config, mutable_mock_env_path)[source]¶
- spack.test.cmd.config.test_config_revert_raise_if_cant_write(packages_yaml_v015, monkeypatch)[source]¶
- spack.test.cmd.config.test_config_update_fail_on_permission_issue(packages_yaml_v015, monkeypatch)[source]¶
spack.test.cmd.create module¶
- spack.test.cmd.create.test_build_system_guesser_no_stage(parser)[source]¶
Test build system guesser when stage not provided.
- spack.test.cmd.create.test_build_system_guesser_octave(parser)[source]¶
Test build system guesser for the special case, where the same base URL identifies the build system rather than guessing the build system from files contained in the archive.
- spack.test.cmd.create.test_create_template(parser, mock_test_repo, args, name, expected)[source]¶
Test template creation.
- spack.test.cmd.create.test_create_template_bad_name(parser, mock_test_repo, name, expected, capsys)[source]¶
Test template creation with bad name options.
spack.test.cmd.debug module¶
spack.test.cmd.dependencies module¶
spack.test.cmd.dependents module¶
spack.test.cmd.deprecate module¶
- spack.test.cmd.deprecate.test_concretize_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Tests that the concretizer throws an error if we concretize to a deprecated spec
- spack.test.cmd.deprecate.test_deprecate(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.deprecate.test_deprecate_already_deprecated(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Tests that we can re-deprecate a spec to change its deprecator.
- spack.test.cmd.deprecate.test_deprecate_deprecator(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Tests that when a deprecator spec is deprecated, its deprecatee specs are updated to point to the new deprecator.
- spack.test.cmd.deprecate.test_deprecate_deps(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Test that the deprecate command deprecates all dependencies properly.
- spack.test.cmd.deprecate.test_deprecate_fails_active_extensions(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Tests that active extensions and their extendees cannot be deprecated.
- spack.test.cmd.deprecate.test_deprecate_fails_no_such_package(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
Tests that deprecating a spec that is not installed fails.
Tests that deprecating without the
-i
option in favor of a spec that is not installed fails.
spack.test.cmd.dev_build module¶
- spack.test.cmd.dev_build.test_dev_build_before_until(tmpdir, mock_packages, install_mockery, capsys)[source]¶
- spack.test.cmd.dev_build.test_dev_build_drop_in(tmpdir, mock_packages, monkeypatch, install_mockery)[source]¶
- spack.test.cmd.dev_build.test_dev_build_env(tmpdir, mock_packages, install_mockery, mutable_mock_env_path)[source]¶
Test Spack does dev builds for packages in develop section of env.
- spack.test.cmd.dev_build.test_dev_build_env_dependency(tmpdir, mock_packages, install_mockery, mock_fetch, mutable_mock_env_path)[source]¶
Test non-root specs in an environment are properly marked for dev builds.
- spack.test.cmd.dev_build.test_dev_build_env_version_mismatch(tmpdir, mock_packages, install_mockery, mutable_mock_env_path)[source]¶
Test Spack constraints concretization by develop specs.
- spack.test.cmd.dev_build.test_dev_build_fails_already_installed(tmpdir, mock_packages, install_mockery)[source]¶
- spack.test.cmd.dev_build.test_dev_build_multiple(tmpdir, mock_packages, install_mockery, mutable_mock_env_path, mock_fetch)[source]¶
Test spack install with multiple developer builds
- spack.test.cmd.dev_build.test_dev_build_rebuild_on_source_changes(test_spec, tmpdir, mock_packages, install_mockery, mutable_mock_env_path, mock_fetch)[source]¶
Test dev builds rebuild on changes to source code.
test_spec = dev-build-test-install
tests rebuild for changes to packagetest_spec = dependent-of-dev-build
tests rebuild for changes to dep
spack.test.cmd.develop module¶
spack.test.cmd.diff module¶
spack.test.cmd.env module¶
- spack.test.cmd.env.check_mpileaks_and_deps_in_view(viewdir)[source]¶
Check that the expected install directories exist.
- spack.test.cmd.env.packages_yaml_v015(tmpdir)[source]¶
Return the path to an existing manifest in the v0.15.x format and the path to a non yet existing backup file.
- spack.test.cmd.env.test_activate_adds_transitive_run_deps_to_path(install_mockery, mock_fetch, monkeypatch)[source]¶
- spack.test.cmd.env.test_activate_temp(monkeypatch, tmpdir)[source]¶
Tests whether spack env activate –temp creates an environment in a temporary directory
- spack.test.cmd.env.test_activation_and_deactiviation_ambiguities(method, env, no_env, env_dir, capsys)[source]¶
spack [-e x | -E | -D x/] env [activate | deactivate] y are ambiguous
- spack.test.cmd.env.test_does_not_rewrite_rel_dev_path_when_keep_relative_is_set(tmpdir)[source]¶
Relative develop paths should not be rewritten when –keep-relative is passed to create
- spack.test.cmd.env.test_env_activate_broken_view(mutable_mock_env_path, mock_archive, mock_fetch, mock_packages, install_mockery)[source]¶
- spack.test.cmd.env.test_env_activate_csh_prints_shell_output(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
Check the shell commands output by
spack env activate --csh
.
- spack.test.cmd.env.test_env_activate_default_view_root_unconditional(mutable_mock_env_path)[source]¶
Check that the root of the default view in the environment is added to the shell unconditionally.
- spack.test.cmd.env.test_env_activate_sh_prints_shell_output(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
Check the shell commands output by
spack env activate --sh
.This is a cursory check;
share/spack/qa/setup-env-test.sh
checks for correctness.
- spack.test.cmd.env.test_env_activate_view_fails(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
Sanity check on env activate to make sure it requires shell support
- spack.test.cmd.env.test_env_config_view_default(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_install_two_specs_same_dep(install_mockery, mock_fetch, tmpdir, capsys)[source]¶
Test installation of two packages that share a dependency with no connection and the second specifying the dependency as a ‘build’ dependency.
- spack.test.cmd.env.test_env_modifications_error_on_activate(install_mockery, mock_fetch, monkeypatch, capfd)[source]¶
- spack.test.cmd.env.test_env_status_broken_view(mutable_mock_env_path, mock_archive, mock_fetch, mock_packages, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_add_concretize(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_force_remove(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_install(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_install_package(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_remove_concretize(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_uninstall(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_updates_view_uninstall_referenced_elsewhere(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_view_external_prefix(tmpdir_factory, mutable_database, mock_packages)[source]¶
- spack.test.cmd.env.test_env_view_fails(tmpdir, mock_packages, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_env_without_view_install(tmpdir, mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_indirect_build_dep()[source]¶
Simple case of X->Y->Z where Y is a build/link dep and Z is a build-only dep. Make sure this concrete DAG is preserved when writing the environment out and reading it back.
- spack.test.cmd.env.test_init_from_lockfile(tmpdir)[source]¶
Test that an environment can be instantiated from a lockfile.
- spack.test.cmd.env.test_init_from_yaml(tmpdir)[source]¶
Test that an environment can be instantiated from a lockfile.
- spack.test.cmd.env.test_init_with_file_and_remove(tmpdir)[source]¶
Ensure a user can remove from any position in the spack.yaml file.
- spack.test.cmd.env.test_multiple_modules_post_env_hook(tmpdir, install_mockery, mock_fetch)[source]¶
- spack.test.cmd.env.test_read_old_lock_creates_backup(tmpdir)[source]¶
When reading a version-1 lockfile, make sure that a backup of that file is created.
- spack.test.cmd.env.test_rewrite_rel_dev_path_create_original_dir(tmpdir)[source]¶
Relative develop paths should not be rewritten when creating an environment in the original directory
- spack.test.cmd.env.test_rewrite_rel_dev_path_named_env(tmpdir)[source]¶
Relative develop paths should by default be rewritten for new named environment
- spack.test.cmd.env.test_rewrite_rel_dev_path_new_dir(tmpdir)[source]¶
Relative develop paths should be rewritten for new environments in a different directory from the original manifest file
- spack.test.cmd.env.test_rewrite_rel_dev_path_original_dir(tmpdir)[source]¶
Relative devevelop paths should not be rewritten when initializing an environment with root path set to the same directory
- spack.test.cmd.env.test_stack_combinatorial_view(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_concretize_extraneous_variants(tmpdir, config, mock_packages)[source]¶
- spack.test.cmd.env.test_stack_concretize_extraneous_variants_with_dash(tmpdir, config, mock_packages)[source]¶
- spack.test.cmd.env.test_stack_view_activate_from_default(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_view_exclude(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_view_multiple_views(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_view_no_activate_without_default(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_view_select(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_stack_view_select_and_exclude(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_store_different_build_deps()[source]¶
Ensure that an environment can store two instances of a build-only dependency:
x y /| (l) | (b) (b) | y z2 \| (b) z1
- spack.test.cmd.env.test_uninstall_removes_from_env(mock_stage, mock_fetch, install_mockery)[source]¶
- spack.test.cmd.env.test_user_removed_spec()[source]¶
Ensure a user can remove from any position in the spack.yaml file.
- spack.test.cmd.env.test_view_link_all(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
- spack.test.cmd.env.test_view_link_roots(tmpdir, mock_fetch, mock_packages, mock_archive, install_mockery)[source]¶
spack.test.cmd.extensions module¶
spack.test.cmd.external module¶
- spack.test.cmd.external.test_find_external_cmd(mutable_config, working_env, mock_executable)[source]¶
Test invoking ‘spack external find’ with additional package arguments, which restricts the set of packages that Spack looks for.
- spack.test.cmd.external.test_find_external_cmd_full_repo(mutable_config, working_env, mock_executable, mutable_mock_repo)[source]¶
Test invoking ‘spack external find’ with no additional arguments, which iterates through each package in the repository.
- spack.test.cmd.external.test_find_external_cmd_not_buildable(mutable_config, working_env, mock_executable)[source]¶
When the user invokes ‘spack external find –not-buildable’, the config for any package where Spack finds an external version should be marked as not buildable.
- spack.test.cmd.external.test_find_external_merge(mutable_config, mutable_mock_repo)[source]¶
Check that ‘spack find external’ doesn’t overwrite an existing spec entry in packages.yaml.
- spack.test.cmd.external.test_find_external_single_package(mock_executable, executables_found)[source]¶
- spack.test.cmd.external.test_find_external_two_instances_same_package(mock_executable, executables_found)[source]¶
- spack.test.cmd.external.test_new_entries_are_reported_correctly(mock_executable, mutable_config, monkeypatch)[source]¶
- spack.test.cmd.external.test_overriding_prefix(mock_executable, mutable_config, monkeypatch)[source]¶
spack.test.cmd.fetch module¶
- spack.test.cmd.fetch.test_fetch_in_env(tmpdir, mock_archive, mock_stage, mock_fetch, install_mockery)[source]¶
spack.test.cmd.find module¶
- spack.test.cmd.find.mock_display(monkeypatch, specs)[source]¶
Monkeypatches the display function to return its first argument
spack.test.cmd.gc module¶
spack.test.cmd.gpg module¶
- spack.test.cmd.gpg.gpg = <spack.main.SpackCommand object>¶
spack command used by tests below
spack.test.cmd.graph module¶
spack.test.cmd.help module¶
spack.test.cmd.info module¶
spack.test.cmd.init_py_functions module¶
spack.test.cmd.install module¶
- spack.test.cmd.install.test_build_warning_output(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_cache_install_full_hash_match(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir)[source]¶
Make sure installing from cache respects full hash argument
- spack.test.cmd.install.test_cdash_buildstamp_param(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_cdash_configure_warning(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_cdash_install_from_spec_yaml(tmpdir, mock_fetch, install_mockery, capfd, mock_packages, mock_archive, config)[source]¶
- spack.test.cmd.install.test_cdash_report_concretization_error(tmpdir, mock_fetch, install_mockery, capfd, conflict_spec)[source]¶
- spack.test.cmd.install.test_cdash_upload_build_error(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_cdash_upload_clean_build(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_cdash_upload_extra_params(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_compiler_bootstrap(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch)[source]¶
- spack.test.cmd.install.test_compiler_bootstrap_already_installed(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch)[source]¶
- spack.test.cmd.install.test_compiler_bootstrap_from_binary_mirror(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir)[source]¶
Make sure installing compiler from buildcache registers compiler
- spack.test.cmd.install.test_extra_files_are_archived(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_commit(mock_git_version_info, install_mockery, mock_packages, monkeypatch)[source]¶
Test installing a git package from a commit.
This ensures Spack appropriately associates commit versions with their packages in time to do version lookups. Details of version lookup tested elsewhere
- spack.test.cmd.install.test_install_env_variables(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_env_with_tests_all(tmpdir, mock_packages, mock_fetch, install_mockery, mutable_mock_env_path)[source]¶
- spack.test.cmd.install.test_install_env_with_tests_root(tmpdir, mock_packages, mock_fetch, install_mockery, mutable_mock_env_path)[source]¶
- spack.test.cmd.install.test_install_help_cdash(capsys)[source]¶
Make sure spack install –help-cdash describes CDash arguments
- spack.test.cmd.install.test_install_help_does_not_show_cdash_options(capsys)[source]¶
Make sure spack install –help does not describe CDash arguments
- spack.test.cmd.install.test_install_no_add_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path)[source]¶
- spack.test.cmd.install.test_install_only_dependencies_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path)[source]¶
- spack.test.cmd.install.test_install_only_dependencies_of_all_in_env(tmpdir, mock_fetch, install_mockery, mutable_mock_env_path)[source]¶
- spack.test.cmd.install.test_install_only_package(tmpdir, mock_fetch, install_mockery, capfd)[source]¶
- spack.test.cmd.install.test_install_output_on_build_error(mock_packages, mock_archive, mock_fetch, config, install_mockery, capfd)[source]¶
This test used to assume receiving full output, but since we’ve updated spack to generate logs on the level of phases, it will only return the last phase, install.
- spack.test.cmd.install.test_install_output_on_python_error(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_overwrite(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_overwrite_multiple(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_overwrite_not_installed(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_package_already_installed(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_package_and_dependency(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.install.test_install_runtests_all(monkeypatch, mock_packages, install_mockery)[source]¶
- spack.test.cmd.install.test_install_runtests_notests(monkeypatch, mock_packages, install_mockery)[source]¶
- spack.test.cmd.install.test_install_runtests_root(monkeypatch, mock_packages, install_mockery)[source]¶
- spack.test.cmd.install.test_install_with_source(mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
Verify that source has been copied into place.
- spack.test.cmd.install.test_junit_output_with_errors(exc_typename, msg, mock_packages, mock_archive, mock_fetch, install_mockery, config, tmpdir, monkeypatch)[source]¶
spack.test.cmd.is_git_repo module¶
- spack.test.cmd.is_git_repo.check_git_version()[source]¶
Check if git version is new enough for worktree functionality. Return True if requirements are met.
The latest required functionality is worktree remove which was only added in 2.17.0.
Refer: https://github.com/git/git/commit/cc73385cf6c5c229458775bc92e7dbbe24d11611
- spack.test.cmd.is_git_repo.git_tmp_worktree(tmpdir)[source]¶
Create new worktree in a temporary folder and monkeypatch spack.paths.prefix to point to it.
spack.test.cmd.license module¶
spack.test.cmd.list module¶
spack.test.cmd.load module¶
- spack.test.cmd.load.test_load(install_mockery, mock_fetch, mock_archive, mock_packages)[source]¶
Test that the commands generated by load add the specified prefix inspections. Also test that Spack records loaded specs by hash in the user environment.
CMAKE_PREFIX_PATH is the only prefix inspection guaranteed for fake packages, since it keys on the prefix instead of a subdir.
- spack.test.cmd.load.test_load_fails_no_shell(install_mockery, mock_fetch, mock_archive, mock_packages)[source]¶
Test that spack load prints an error message without a shell.
- spack.test.cmd.load.test_load_first(install_mockery, mock_fetch, mock_archive, mock_packages)[source]¶
Test with and without the –first option
- spack.test.cmd.load.test_load_includes_run_env(install_mockery, mock_fetch, mock_archive, mock_packages)[source]¶
Tests that environment changes from the package’s setup_run_environment method are added to the user environment in addition to the prefix inspections
- spack.test.cmd.load.test_load_recursive(install_mockery, mock_fetch, mock_archive, mock_packages)[source]¶
Test that the ‘-r’ option to the load command prepends dependency prefix inspections in post-order
spack.test.cmd.location module¶
- spack.test.cmd.location.test_location_build_dir(mock_spec)[source]¶
Tests spack location –build-dir.
- spack.test.cmd.location.test_location_cmd_error(options)[source]¶
Ensure the proper error is raised with problematic location options.
- spack.test.cmd.location.test_location_env_exists(mutable_mock_env_path)[source]¶
Tests spack location –env <name> for an existing environment.
- spack.test.cmd.location.test_location_env_flag_interference(mutable_mock_env_path, tmpdir)[source]¶
Tests that specifying an active environment using spack -e x location … does not interfere with the location command flags.
- spack.test.cmd.location.test_location_install_dir(mock_spec)[source]¶
Tests spack location –install-dir.
- spack.test.cmd.location.test_location_package_dir(mock_spec)[source]¶
Tests spack location –package-dir.
- spack.test.cmd.location.test_location_paths_options(option, expected)[source]¶
Tests basic spack.paths location command options.
- spack.test.cmd.location.test_location_source_dir(mock_spec)[source]¶
Tests spack location –source-dir.
- spack.test.cmd.location.test_location_source_dir_missing()[source]¶
Tests spack location –source-dir with a missing source directory.
- spack.test.cmd.location.test_location_spec_errors(specs, expected)[source]¶
Tests spack location with bad spec options.
spack.test.cmd.maintainers module¶
spack.test.cmd.mark module¶
spack.test.cmd.mirror module¶
- class spack.test.cmd.mirror.MockMirrorArgs(specs=None, all=False, file=None, versions_per_spec=None, dependencies=False, exclude_file=None, exclude_specs=None)[source]¶
Bases:
object
- spack.test.cmd.mirror.test_mirror_destroy(install_mockery_mutable_config, mock_packages, mock_fetch, mock_archive, mutable_config, monkeypatch, tmpdir)[source]¶
- spack.test.cmd.mirror.test_mirror_from_env(tmpdir, mock_packages, mock_fetch, config, mutable_mock_env_path)[source]¶
- spack.test.cmd.mirror.test_mirror_skip_unstable(tmpdir_factory, mock_packages, config, source_for_pkg_with_hash)[source]¶
spack.test.cmd.module module¶
- spack.test.cmd.module.ensure_module_files_are_there(mock_repo_path, mock_store, mock_configuration_scopes)[source]¶
Generate module files for module tests.
spack.test.cmd.pkg module¶
- spack.test.cmd.pkg.mock_pkg_git_repo(tmpdir_factory)[source]¶
Copy the builtin.mock repo and make a mutable git repo inside it.
- spack.test.cmd.pkg.pkg_template = 'from spack import *\n\nclass {name}(Package):\n homepage = "http://www.example.com"\n url = "http://www.example.com/test-1.0.tar.gz"\n\n version(\'1.0\', \'0123456789abcdef0123456789abcdef\')\n\n def install(self, spec, prefix):\n pass\n'¶
new fake package template
spack.test.cmd.print_shell_vars module¶
spack.test.cmd.providers module¶
spack.test.cmd.python module¶
spack.test.cmd.reindex module¶
- spack.test.cmd.reindex.test_reindex_basic(mock_packages, mock_archive, mock_fetch, install_mockery)[source]¶
spack.test.cmd.repo module¶
spack.test.cmd.resource module¶
- spack.test.cmd.resource.mock_hashes = ['abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234', '1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd', 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c', 'c45c1564f70def3fc1a6e22139f62cb21cd190cc3a7dbe6f4120fa59ce33dcb8', '24eceabef5fe8f575ff4b438313dc3e7b30f6a2d1c78841fbbe3b9293a589277', '689b8f9b32cb1d2f9271d29ea3fca2e1de5df665e121fca14e1364b711450deb', 'ebe27f9930b99ebd8761ed2db3ea365142d0bafd78317efb4baadf62c7bf94d0', '208fcfb50e5a965d5757d151b675ca4af4ce2dfd56401721b6168fae60ab798f', 'bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c', '7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730']¶
these are hashes used in mock packages
spack.test.cmd.spec module¶
spack.test.cmd.stage module¶
- spack.test.cmd.stage.test_stage_full_env(mutable_mock_env_path, monkeypatch)[source]¶
Verify that stage filters specs in environment.
- spack.test.cmd.stage.test_stage_path(check_stage_path)[source]¶
Verify that –path only works with single specs.
- spack.test.cmd.stage.test_stage_path_errors_multiple_specs(check_stage_path)[source]¶
Verify that –path only works with single specs.
spack.test.cmd.style module¶
- spack.test.cmd.style.external_style_root(flake8_package_with_errors, tmpdir)[source]¶
Create a mock git repository for running spack style.
- spack.test.cmd.style.flake8_package()[source]¶
Style only checks files that have been modified. This fixture makes a small change to the
flake8
mock package, yields the filename, then undoes the change on cleanup.
- spack.test.cmd.style.flake8_package_with_errors(scope='function')[source]¶
A flake8 package with errors.
- spack.test.cmd.style.style_data = '/home/docs/checkouts/readthedocs.org/user_builds/spack/checkouts/v0.17.0/lib/spack/docs/_spack_root/lib/spack/spack/test/data/style'¶
directory with sample style files
- spack.test.cmd.style.test_bad_bootstrap(monkeypatch)[source]¶
Ensure we fail gracefully when we can’t bootstrap spack style.
- spack.test.cmd.style.test_bad_root(tmpdir)[source]¶
Ensure that spack style doesn’t run on non-spack directories.
- spack.test.cmd.style.test_changed_no_base(tmpdir, capfd)[source]¶
Ensure that we fail gracefully with no base branch.
- spack.test.cmd.style.test_external_root(external_style_root)[source]¶
Ensure we can run in a separate root directory w/o configuration files.
spack.test.cmd.tags module¶
spack.test.cmd.test module¶
- spack.test.cmd.test.test_cdash_output_test_error(tmpdir, mock_fetch, install_mockery_mutable_config, mock_packages, mock_archive, mock_test_stage, capfd)[source]¶
- spack.test.cmd.test.test_cdash_upload_clean_test(tmpdir, mock_fetch, install_mockery_mutable_config, mock_packages, mock_archive, mock_test_stage)[source]¶
- spack.test.cmd.test.test_junit_output_with_failures(tmpdir, mock_test_stage, pkg_name, msgs)[source]¶
- spack.test.cmd.test.test_show_log_on_error(mock_packages, mock_archive, mock_fetch, install_mockery_mutable_config, capfd, mock_test_stage)[source]¶
Make sure spack prints location of test log on failure.
- spack.test.cmd.test.test_test_dup_alias(mock_test_stage, mock_packages, mock_archive, mock_fetch, install_mockery_mutable_config, capfd)[source]¶
Ensure re-using an alias fails with suggestion to change.
- spack.test.cmd.test.test_test_help_cdash(mock_test_stage)[source]¶
Make sure spack test –help-cdash describes CDash arguments
- spack.test.cmd.test.test_test_help_does_not_show_cdash_options(mock_test_stage, capsys)[source]¶
Make sure spack test –help does not describe CDash arguments
- spack.test.cmd.test.test_test_list(mock_packages, mock_archive, mock_fetch, install_mockery_mutable_config)[source]¶
- spack.test.cmd.test.test_test_list_all(mock_packages)[source]¶
make sure spack test list –all returns all packages with tests
- spack.test.cmd.test.test_test_output(mock_test_stage, mock_packages, mock_archive, mock_fetch, install_mockery_mutable_config)[source]¶
Ensure output printed from pkgs is captured by output redirection.
- spack.test.cmd.test.test_test_output_on_error(mock_packages, mock_archive, mock_fetch, install_mockery_mutable_config, capfd, mock_test_stage)[source]¶
spack.test.cmd.undevelop module¶
spack.test.cmd.uninstall module¶
- class spack.test.cmd.uninstall.MockArgs(packages, all=False, force=False, dependents=False)[source]¶
Bases:
object
- spack.test.cmd.uninstall.test_force_uninstall_and_reinstall_by_hash(mutable_database)[source]¶
Test forced uninstall and reinstall of old specs.
- spack.test.cmd.uninstall.test_force_uninstall_spec_with_ref_count_not_zero(constraint, expected_number_of_specs, mutable_database)[source]¶
- spack.test.cmd.uninstall.test_in_memory_consistency_when_uninstalling(mutable_database, monkeypatch)[source]¶
Test that uninstalling doesn’t raise warnings
- spack.test.cmd.uninstall.test_installed_dependents(mutable_database)[source]¶
Test can’t uninstall when there are installed dependents.
- spack.test.cmd.uninstall.test_multiple_matches(mutable_database)[source]¶
Test unable to uninstall when multiple matches.
spack.test.cmd.unit_test module¶
spack.test.cmd.url module¶
spack.test.cmd.verify module¶
Tests for the spack verify command
spack.test.cmd.versions module¶
- spack.test.cmd.versions.test_new_versions_only(monkeypatch)[source]¶
Test a package for which new versions should be available.
- spack.test.cmd.versions.test_no_unchecksummed_versions()[source]¶
Test a package for which no unchecksummed versions are available.
- spack.test.cmd.versions.test_no_versions()[source]¶
Test a package for which no remote versions are available.
- spack.test.cmd.versions.test_no_versions_no_url()[source]¶
Test a package without versions or a
url
attribute.
- spack.test.cmd.versions.test_remote_versions()[source]¶
Test a package for which remote versions should be available.
- spack.test.cmd.versions.test_remote_versions_only()[source]¶
Test a package for which remote versions should be available.
spack.test.cmd.view module¶
- spack.test.cmd.view.test_view_extendee_with_global_activations(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension_conflict(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension_conflict_ignored(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension_global_activation(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension_projection(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_extension_remove(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_external(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶
- spack.test.cmd.view.test_view_link_type(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery, cmd)[source]¶
- spack.test.cmd.view.test_view_link_type_remove(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery, add_cmd)[source]¶
- spack.test.cmd.view.test_view_multiple_projections(tmpdir, mock_packages, mock_archive, mock_fetch, config, install_mockery)[source]¶