From 32a2c22b2b509f7560b9d4a0925511b1b2f3879f Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Thu, 20 Jan 2022 21:18:16 -0700 Subject: 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. --- lib/spack/spack/test/cmd/test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3-60-g2f50