From e8675243442b2fb1044235af47affad11f2ca54c Mon Sep 17 00:00:00 2001 From: vedithal-amd Date: Tue, 5 Aug 2025 10:50:32 -0400 Subject: [PATCH] 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 --- tests/test_autogen_config.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/tests/test_autogen_config.py b/tests/test_autogen_config.py index 1c623544e8..c0a84496be 100644 --- a/tests/test_autogen_config.py +++ b/tests/test_autogen_config.py @@ -7,39 +7,8 @@ import yaml @pytest.mark.autogen_config def test_modification_time(): - # Ensure modification time of utils/unified_config.yaml is older than - # utils/autogen_hash.yaml - # docs/data/metrics_description.yaml and - # src/rocprof_compute_soc/analysis_configs/gfx*/*.yaml - - unified_config_path = Path("utils/unified_config.yaml") - hash_path = Path("utils/autogen_hash.yaml") - docs_config_path = Path("docs/data/metrics_description.yaml") - analysis_config_paths = list( - Path("src/rocprof_compute_soc/analysis_configs").glob("gfx*/*.yaml") - ) - - unified_config_time = unified_config_path.stat().st_mtime - - def is_autogenerated(filepath): - # Autogenerated filepath should be newer than the unified config - # Autogenerated filepath can be older than unified config by at most a second due to file system delays - return unified_config_time - filepath.stat().st_mtime < 1 - - assert is_autogenerated( - hash_path - ), f"{unified_config_path} is not older than {hash_path}" - - assert is_autogenerated( - docs_config_path - ), f"{unified_config_path} is not older than {docs_config_path}" - - for analysis_config_path in analysis_config_paths: - assert is_autogenerated( - analysis_config_path - ), f"{unified_config_path} is not older than {analysis_config_path}" - # 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():