* Fix formatting
Цей коміт міститься в:
vedithal-amd authored and GitHub committed 2025-07-28 16:19:45 -04:00
1 джерело 03d27c0ba0
коміт 80ea339217
7 files changed
+90 -57

No files matched your search

+13 -5
Переглянути файл
@@ -42,7 +42,7 @@ indirs = [
"tests/workloads/vcopy/MI350",
]
time_units = {"s": 10**9, "ms": 10**6, "us": 10**3, "ns": 1}
time_units = {"s": 10 ** 9, "ms": 10 ** 6, "us": 10 ** 3, "ns": 1}
@pytest.mark.misc
@@ -500,7 +500,15 @@ def test_col_2(binary_handler_analyze_rocprof_compute):
for dir in indirs:
workload_dir = test_utils.setup_workload_dir(dir)
code = binary_handler_analyze_rocprof_compute(
["analyze", "--path", workload_dir, "--cols", "2", "--include-cols", "Description"]
[
"analyze",
"--path",
workload_dir,
"--cols",
"2",
"--include-cols",
"Description",
]
)
assert code == 0
@@ -1300,9 +1308,9 @@ def test_mathematical_correctness_all_units(sample_time_data, original_ns_values
from utils.tty import convert_time_columns
test_cases = [
("s", 10**9), # 1 second = 10^9 nanoseconds
("ms", 10**6), # 1 millisecond = 10^6 nanoseconds
("us", 10**3), # 1 microsecond = 10^3 nanoseconds
("s", 10 ** 9), # 1 second = 10^9 nanoseconds
("ms", 10 ** 6), # 1 millisecond = 10^6 nanoseconds
("us", 10 ** 3), # 1 microsecond = 10^3 nanoseconds
("ns", 1), # 1 nanosecond = 1 nanosecond
]
+13 -7
Переглянути файл
@@ -19,21 +19,27 @@ def test_modification_time():
Path("src/rocprof_compute_soc/analysis_configs").glob("gfx*/*.yaml")
)
assert (
unified_config_path.stat().st_mtime < hash_path.stat().st_mtime
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 (
unified_config_path.stat().st_mtime < docs_config_path.stat().st_mtime
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 (
unified_config_path.stat().st_mtime < analysis_config_path.stat().st_mtime
assert is_autogenerated(
analysis_config_path
), f"{unified_config_path} is not older than {analysis_config_path}"
# Ensure hash map consistency
with open(hash_path, "r") as f:
hash_map = yaml.safe_load(f)
for file, hash in hash_map.items():
+3 -4
Переглянути файл
@@ -53,7 +53,6 @@ The tests use mocks instead of a real MongoDB server for speed and reliability.
class TestDatabaseConnector:
@pytest.fixture
def mock_args_import(self):
"""Mock arguments for import operation"""
@@ -210,9 +209,9 @@ class TestDatabaseConnector:
with patch.object(connector, "prep_import") as mock_prep:
mock_prep.return_value = None
connector.connection_info["db"] = (
"rocprofiler-compute_test_team_test_workload_MI100"
)
connector.connection_info[
"db"
] = "rocprofiler-compute_test_team_test_workload_MI100"
connector.db_import()
-23
Переглянути файл
@@ -742,29 +742,6 @@ def test_roof_rocpd(binary_handler_profile_rocprof_compute):
test_utils.clean_output_dir(config["cleanup"], workload_dir)
@pytest.mark.misc
def test_roofline_kernel_names_validation_error(binary_handler_profile_rocprof_compute):
"""
Test validate_parameters() error: --roof-only is required for --kernel-names
This should trigger console_error("--roof-only is required for --kernel-names")
"""
if soc in ("MI100"):
# roofline is not supported on MI100
pytest.skip("Skipping roofline test for MI100")
return
options = ["--device", "0", "--kernel-names"] # missing --roof-only
workload_dir = test_utils.get_output_dir()
returncode = binary_handler_profile_rocprof_compute(
config, workload_dir, options, check_success=False, roof=True
)
assert returncode != 0
test_utils.clean_output_dir(config["cleanup"], workload_dir)
@pytest.mark.misc
def test_roofline_workload_dir_not_set_error():
"""