diff options
Diffstat (limited to 'lib/spack/spack/test/database.py')
-rw-r--r-- | lib/spack/spack/test/database.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/lib/spack/spack/test/database.py b/lib/spack/spack/test/database.py index 89359d2a44..0f471c6a8b 100644 --- a/lib/spack/spack/test/database.py +++ b/lib/spack/spack/test/database.py @@ -12,6 +12,7 @@ import functools import json import os import shutil +import sys import pytest @@ -61,6 +62,8 @@ def upstream_and_downstream_db(tmpdir_factory, gen_mock_layout): downstream_db, downstream_layout +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.usefixtures('config') def test_installed_upstream(upstream_and_downstream_db): upstream_write_db, upstream_db, upstream_layout,\ @@ -104,6 +107,8 @@ def test_installed_upstream(upstream_and_downstream_db): downstream_db._check_ref_counts() +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.usefixtures('config') def test_removed_upstream_dep(upstream_and_downstream_db): upstream_write_db, upstream_db, upstream_layout,\ @@ -135,6 +140,8 @@ def test_removed_upstream_dep(upstream_and_downstream_db): new_downstream._read() +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.usefixtures('config') def test_add_to_upstream_after_downstream(upstream_and_downstream_db): """An upstream DB can add a package after it is installed in the downstream @@ -172,6 +179,8 @@ def test_add_to_upstream_after_downstream(upstream_and_downstream_db): spack.store.db = orig_db +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.usefixtures('config', 'temporary_store') def test_cannot_write_upstream(tmpdir_factory, gen_mock_layout): roots = [str(tmpdir_factory.mktemp(x)) for x in ['a', 'b']] @@ -197,6 +206,8 @@ def test_cannot_write_upstream(tmpdir_factory, gen_mock_layout): upstream_dbs[0].add(spec, layouts[1]) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.usefixtures('config', 'temporary_store') def test_recursive_upstream_dbs(tmpdir_factory, gen_mock_layout): roots = [str(tmpdir_factory.mktemp(x)) for x in ['a', 'b', 'c']] @@ -371,6 +382,8 @@ def _mock_remove(spec): spec.package.do_uninstall(spec) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_default_queries(database): # Testing a package whose name *doesn't* start with 'lib' # to ensure the library has 'lib' prepended to the name @@ -411,6 +424,8 @@ def test_default_queries(database): assert os.path.exists(command.path) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_005_db_exists(database): """Make sure db cache file exists after creating.""" index_file = os.path.join(database.root, '.spack-db', 'index.json') @@ -423,6 +438,8 @@ def test_005_db_exists(database): validate(index_object, schema) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_010_all_install_sanity(database): """Ensure that the install layout reflects what we think it does.""" all_specs = spack.store.layout.all_specs() @@ -458,6 +475,8 @@ def test_010_all_install_sanity(database): ) == 1 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_015_write_and_read(mutable_database): # write and read DB with spack.store.db.write_transaction(): @@ -472,6 +491,8 @@ def test_015_write_and_read(mutable_database): assert new_rec.installed == rec.installed +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_017_write_and_read_without_uuid(mutable_database, monkeypatch): monkeypatch.setattr(spack.database, '_use_uuid', False) # write and read DB @@ -487,17 +508,23 @@ def test_017_write_and_read_without_uuid(mutable_database, monkeypatch): assert new_rec.installed == rec.installed +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_020_db_sanity(database): """Make sure query() returns what's actually in the db.""" _check_db_sanity(database) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_025_reindex(mutable_database): """Make sure reindex works and ref counts are valid.""" spack.store.store.reindex() _check_db_sanity(mutable_database) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_026_reindex_after_deprecate(mutable_database): """Make sure reindex works and ref counts are valid after deprecation.""" mpich = mutable_database.query_one('mpich') @@ -519,6 +546,8 @@ class ReadModify(object): _mock_remove('mpileaks ^zmpi') +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_030_db_sanity_from_another_process(mutable_database): spack_process = spack.subprocess_context.SpackTestProcess(ReadModify()) p = spack_process.create() @@ -530,11 +559,15 @@ def test_030_db_sanity_from_another_process(mutable_database): assert len(mutable_database.query('mpileaks ^zmpi')) == 0 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_040_ref_counts(database): """Ensure that we got ref counts right when we read the DB.""" database._check_ref_counts() +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_041_ref_counts_deprecate(mutable_database): """Ensure that we have appropriate ref counts after deprecating""" mpich = mutable_database.query_one('mpich') @@ -544,6 +577,8 @@ def test_041_ref_counts_deprecate(mutable_database): mutable_database._check_ref_counts() +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_050_basic_query(database): """Ensure querying database is consistent with what is installed.""" # query everything @@ -580,14 +615,20 @@ def test_050_basic_query(database): assert len(database.query(end_date=datetime.datetime.max)) == total_specs +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_060_remove_and_add_root_package(mutable_database): _check_remove_and_add_package(mutable_database, 'mpileaks ^mpich') +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_070_remove_and_add_dependency_package(mutable_database): _check_remove_and_add_package(mutable_database, 'dyninst') +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_080_root_ref_counts(mutable_database): rec = mutable_database.get_record('mpileaks ^mpich') @@ -612,6 +653,8 @@ def test_080_root_ref_counts(mutable_database): assert mutable_database.get_record('mpich').ref_count == 2 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_090_non_root_ref_counts(mutable_database): mutable_database.get_record('mpileaks ^mpich') mutable_database.get_record('callpath ^mpich') @@ -641,6 +684,8 @@ def test_090_non_root_ref_counts(mutable_database): assert mpich_rec.ref_count == 0 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_100_no_write_with_exception_on_remove(database): def fail_while_writing(): with database.write_transaction(): @@ -658,6 +703,8 @@ def test_100_no_write_with_exception_on_remove(database): assert len(database.query('mpileaks ^zmpi', installed=any)) == 1 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_110_no_write_with_exception_on_install(database): def fail_while_writing(): with database.write_transaction(): @@ -675,6 +722,8 @@ def test_110_no_write_with_exception_on_install(database): assert database.query('cmake', installed=any) == [] +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_115_reindex_with_packages_not_in_repo(mutable_database): # Dont add any package definitions to this repository, the idea is that # packages should not have to be defined in the repository once they @@ -684,6 +733,8 @@ def test_115_reindex_with_packages_not_in_repo(mutable_database): _check_db_sanity(mutable_database) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_external_entries_in_db(mutable_database): rec = mutable_database.get_record('mpileaks ^zmpi') assert rec.spec.external_path is None @@ -701,6 +752,8 @@ def test_external_entries_in_db(mutable_database): assert rec.explicit is True +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.regression('8036') def test_regression_issue_8036(mutable_database, usr_folder_exists): # The test ensures that the external package prefix is treated as @@ -716,6 +769,8 @@ def test_regression_issue_8036(mutable_database, usr_folder_exists): assert s.package.installed +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.regression('11118') def test_old_external_entries_prefix(mutable_database): with open(spack.store.db._index_path, 'r') as f: @@ -741,6 +796,8 @@ def test_old_external_entries_prefix(mutable_database): assert record.spec.prefix == record.spec.external_path +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_uninstall_by_spec(mutable_database): with mutable_database.write_transaction(): for spec in mutable_database.query(): @@ -751,6 +808,8 @@ def test_uninstall_by_spec(mutable_database): assert len(mutable_database.query()) == 0 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_query_unused_specs(mutable_database): # This spec installs a fake cmake as a build only dependency s = spack.spec.Spec('simple-inheritance') @@ -762,6 +821,8 @@ def test_query_unused_specs(mutable_database): assert unused[0].name == 'cmake' +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.regression('10019') def test_query_spec_with_conditional_dependency(mutable_database): # The issue is triggered by having dependencies that are @@ -774,6 +835,8 @@ def test_query_spec_with_conditional_dependency(mutable_database): assert not results +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.regression('10019') def test_query_spec_with_non_conditional_virtual_dependency(database): # Ensure the same issue doesn't come up for virtual @@ -782,6 +845,8 @@ def test_query_spec_with_non_conditional_virtual_dependency(database): assert len(results) == 1 +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_failed_spec_path_error(database): """Ensure spec not concrete check is covered.""" s = spack.spec.Spec('a') @@ -789,6 +854,8 @@ def test_failed_spec_path_error(database): spack.store.db._failed_spec_path(s) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.db def test_clear_failure_keep(mutable_database, monkeypatch, capfd): """Add test coverage for clear_failure operation when to be retained.""" @@ -804,6 +871,8 @@ def test_clear_failure_keep(mutable_database, monkeypatch, capfd): assert 'Retaining failure marking' in out +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.db def test_clear_failure_forced(mutable_database, monkeypatch, capfd): """Add test coverage for clear_failure operation when force.""" @@ -822,6 +891,8 @@ def test_clear_failure_forced(mutable_database, monkeypatch, capfd): assert 'Unable to remove failure marking' in out +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.db def test_mark_failed(mutable_database, monkeypatch, tmpdir, capsys): """Add coverage to mark_failed.""" @@ -843,6 +914,8 @@ def test_mark_failed(mutable_database, monkeypatch, tmpdir, capsys): del spack.store.db._prefix_failures[s.prefix] +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") @pytest.mark.db def test_prefix_failed(mutable_database, monkeypatch): """Add coverage to prefix_failed operation.""" @@ -867,6 +940,8 @@ def test_prefix_failed(mutable_database, monkeypatch): assert spack.store.db.prefix_failed(s) +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_prefix_read_lock_error(mutable_database, monkeypatch): """Cover the prefix read lock exception.""" def _raise(db, spec): @@ -882,6 +957,8 @@ def test_prefix_read_lock_error(mutable_database, monkeypatch): assert False +@pytest.mark.skipif(sys.platform == 'win32', + reason="Not supported on Windows (yet)") def test_prefix_write_lock_error(mutable_database, monkeypatch): """Cover the prefix write lock exception.""" def _raise(db, spec): |