summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-08-16 13:14:58 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-09-01 11:29:32 -0700
commitbee5c055682cfcbac294c19890cdcdd0b20cc03d (patch)
treef34dfa4c42a5ec94e8a58d92e911ce1591682a9a /lib
parent235a045d080dfe06e1738a23c1907f4221b66733 (diff)
downloadspack-bee5c055682cfcbac294c19890cdcdd0b20cc03d.tar.gz
spack-bee5c055682cfcbac294c19890cdcdd0b20cc03d.tar.bz2
spack-bee5c055682cfcbac294c19890cdcdd0b20cc03d.tar.xz
spack-bee5c055682cfcbac294c19890cdcdd0b20cc03d.zip
Update tests to reflect new in-memory hashing vs. coarser dag_hash.
- Spack currently not hashing build deps (to allow more reuse of packages and less frequent re-installing) - Fast in-memory hash should still hash *all* deptypes, and installed specs will only reflect link and run deps. - We'll revert this when we can concretize more liberally based on what is already installed.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/directory_layout.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/spack/spack/test/directory_layout.py b/lib/spack/spack/test/directory_layout.py
index 2d0565acae..fdaa43464b 100644
--- a/lib/spack/spack/test/directory_layout.py
+++ b/lib/spack/spack/test/directory_layout.py
@@ -91,22 +91,33 @@ class DirectoryLayoutTest(MockPackagesTest):
# Make sure spec file can be read back in to get the original spec
spec_from_file = self.layout.read_spec(spec_path)
- self.assertEqual(spec, spec_from_file)
- self.assertTrue(spec.eq_dag, spec_from_file)
+
+ # currently we don't store build dependency information when
+ # we write out specs to the filesystem.
+
+ # TODO: fix this when we can concretize more loosely based on
+ # TODO: what is installed. We currently omit these to
+ # TODO: increase reuse of build dependencies.
+ stored_deptypes = ('link', 'run')
+ expected = spec.copy(deps=stored_deptypes)
+ self.assertEqual(expected, spec_from_file)
+ self.assertTrue(expected.eq_dag, spec_from_file)
self.assertTrue(spec_from_file.concrete)
# Ensure that specs that come out "normal" are really normal.
with open(spec_path) as spec_file:
read_separately = Spec.from_yaml(spec_file.read())
- read_separately.normalize()
- self.assertEqual(read_separately, spec_from_file)
+ # TODO: revise this when build deps are in dag_hash
+ norm = read_separately.normalized().copy(deps=stored_deptypes)
+ self.assertEqual(norm, spec_from_file)
- read_separately.concretize()
- self.assertEqual(read_separately, spec_from_file)
+ # TODO: revise this when build deps are in dag_hash
+ conc = read_separately.concretized().copy(deps=stored_deptypes)
+ self.assertEqual(conc, spec_from_file)
# Make sure the hash of the read-in spec is the same
- self.assertEqual(spec.dag_hash(), spec_from_file.dag_hash())
+ self.assertEqual(expected.dag_hash(), spec_from_file.dag_hash())
# Ensure directories are properly removed
self.layout.remove_install_directory(spec)