Files
rocm-systems/projects/rocprofiler-compute/tests/test_autogen_config.py
T
vedithal-amd 5084aad00b Fix autogen config test (#856)
* Only check file content hash consistency

* Do not check file modification timestamps since that can be updated by
  git commands

[ROCm/rocprofiler-compute commit: e867524344]
2025-08-05 10:50:32 -04:00

19 lines
514 B
Python

import hashlib
from pathlib import Path
import pytest
import yaml
@pytest.mark.autogen_config
def test_modification_time():
# Ensure hash map consistency
hash_path = Path("utils/autogen_hash.yaml")
with open(hash_path, "r") as f:
hash_map = yaml.safe_load(f)
for file, hash in hash_map.items():
file_hash = hashlib.sha256(Path(file).read_bytes()).hexdigest()
assert (
file_hash == hash
), f"Hash mismatch for {file}: expected {hash}, got {file_hash}"