diff options
author | Scott Wittenburg <scott.wittenburg@kitware.com> | 2022-01-20 21:18:16 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2022-05-13 10:45:12 -0700 |
commit | 32a2c22b2b509f7560b9d4a0925511b1b2f3879f (patch) | |
tree | 1bdc7b04a3adb26e12d2f6c975654fe350e50aa9 | |
parent | e02020c80a8749d82c271913df0d0f9d9e4fac0b (diff) | |
download | spack-32a2c22b2b509f7560b9d4a0925511b1b2f3879f.tar.gz spack-32a2c22b2b509f7560b9d4a0925511b1b2f3879f.tar.bz2 spack-32a2c22b2b509f7560b9d4a0925511b1b2f3879f.tar.xz spack-32a2c22b2b509f7560b9d4a0925511b1b2f3879f.zip |
tests: fix failing test_hash_change
The full hash appears twice in the spec dict now, replacing just
the value replaces it under "hash" and "full_hash". Only replace
the one that appears after "full_hash".
I'm actually not sure what purpose this test served, so maybe it
could be removed, as it may be testing some distinction between
full and dag hash which no longer exists.
-rw-r--r-- | lib/spack/spack/test/cmd/test.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/test/cmd/test.py b/lib/spack/spack/test/cmd/test.py index 89831b6cb8..a696424c17 100644 --- a/lib/spack/spack/test/cmd/test.py +++ b/lib/spack/spack/test/cmd/test.py @@ -256,9 +256,11 @@ def test_hash_change(mock_test_stage, mock_packages, mock_archive, mock_fetch, outfile = os.path.join(testdir, 'test_suite.lock') with open(outfile, 'r') as f: output = f.read() + val_replace = '"full_hash": "{0}"'.format( + spack.store.db.query('printing-package')[0].full_hash()) changed_hash = output.replace( - spack.store.db.query('printing-package')[0].full_hash(), - 'fakehash492ucwhwvzhxfbmcc45x49ha') + val_replace, + '"full_hash": "fakehash492ucwhwvzhxfbmcc45x49ha"') with open(outfile, 'w') as f: f.write(changed_hash) |