From ebad309264574c071b0b4cd21331e1ddd8324d65 Mon Sep 17 00:00:00 2001 From: JoseSantosAMD Date: Thu, 30 May 2024 15:22:11 -0500 Subject: [PATCH] Updated test_analyze_commands to include mi300 directories Signed-off-by: JoseSantosAMD [ROCm/rocprofiler-compute commit: 91f635e3e690a943ff71c78924511e3d106a1901] --- .../tests/test_analyze_commands.py | 2217 ++++++----------- 1 file changed, 786 insertions(+), 1431 deletions(-) diff --git a/projects/rocprofiler-compute/tests/test_analyze_commands.py b/projects/rocprofiler-compute/tests/test_analyze_commands.py index 04d91201b6..3c66dfa500 100644 --- a/projects/rocprofiler-compute/tests/test_analyze_commands.py +++ b/projects/rocprofiler-compute/tests/test_analyze_commands.py @@ -12,65 +12,50 @@ omniperf = SourceFileLoader("omniperf", "src/omniperf").load_module() baseline_opts = ["omniperf", "analyze"] config = {} -config["cleanup"] = True +config["cleanup"] = True if "PYTEST_XDIST_WORKER_COUNT" in os.environ else False indir1 = "tests/workloads/vcopy/MI100" indir2 = "tests/workloads/vcopy/MI200" +indirs=[ + "tests/workloads/vcopy/MI100", + "tests/workloads/vcopy/MI200", + "tests/workloads/vcopy/MI300A_A1", + "tests/workloads/vcopy/MI300X_A1" +] @pytest.mark.misc def test_valid_path(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - ["omniperf", "analyze", "--path", workload_dir], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + ["omniperf", "analyze", "--path", workload_dir], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - ["omniperf", "analyze", "--path", workload_dir], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.misc def test_list_kernels(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-stats", - ], - ): - omniperf.main() - assert e.value.code == 0 - - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-stats", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--list-stats", + ], + ): + omniperf.main() + assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @@ -81,37 +66,23 @@ def test_list_metrics_gfx90a(): omniperf.main() assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx90a", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--list-metrics", + "gfx90a", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx90a", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @@ -122,37 +93,24 @@ def test_list_metrics_gfx906(): omniperf.main() assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx906", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--list-metrics", + "gfx906", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx906", - ], - ): - omniperf.main() - assert e.value.code == 0 + test_utils.clean_output_dir(config["cleanup"], workload_dir) @@ -163,1178 +121,727 @@ def test_list_metrics_gfx908(): omniperf.main() assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx908", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--list-metrics", + "gfx908", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--list-metrics", - "gfx908", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "1", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "5", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "5.2.2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "5.2.2", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "5.2.2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_4(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "6.1", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "6.1", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "6.1", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_5(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "10", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "10", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "10", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.filter_block def test_filter_block_6(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "100", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--block", + "100", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--block", - "100", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_filter_kernel_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_filter_kernel_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "1", - ], - ): - omniperf.main() - assert e.value.code == 1 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel", + "1", + ], + ): + omniperf.main() + assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "1", - ], - ): - omniperf.main() - assert e.value.code == 1 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_filter_kernel_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "0", - "1", - ], - ): - omniperf.main() - assert e.value.code == 1 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel", + "0", + "1", + ], + ): + omniperf.main() + assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel", - "0", - "1", - ], - ): - omniperf.main() - assert e.value.code == 1 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_dispatch_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dispatch", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_dispatch_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dispatch", + "1", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_dispatch_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dispatch", + "2", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_dispatch_4(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "1", - "4", - ], - ): - omniperf.main() - assert e.value.code == 1 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dispatch", + "1", + "4", + ], + ): + omniperf.main() + assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "1", - "4", - ], - ): - omniperf.main() - assert e.value.code == 1 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.serial def test_dispatch_5(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "5", - "6", - ], - ): - omniperf.main() - assert e.value.code == 1 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dispatch", + "5", + "6", + ], + ): + omniperf.main() + assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dispatch", - "5", - "6", - ], - ): - omniperf.main() - assert e.value.code == 1 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.misc def test_gpu_ids(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--gpu-id", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--gpu-id", + "2", + ], + ): + omniperf.main() + assert e.value.code == 1 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--gpu-id", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.normal_unit def test_normal_unit_per_wave(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_wave", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--normal-unit", + "per_wave", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_wave", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.normal_unit def test_normal_unit_per_cycle(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_cycle", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--normal-unit", + "per_cycle", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_cycle", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.normal_unit def test_normal_unit_per_second(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_second", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--normal-unit", + "per_second", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_second", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.normal_unit def test_normal_unit_per_kernel(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_kernel", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--normal-unit", + "per_kernel", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--normal-unit", - "per_kernel", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.max_stat def test_max_stat_num_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--max-stat-num", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.max_stat def test_max_stat_num_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--max-stat-num", + "5", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.max_stat def test_max_stat_num_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "10", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--max-stat-num", + "10", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "10", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.max_stat def test_max_stat_num_4(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "15", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--max-stat-num", + "15", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--max-stat-num", - "15", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.time_unit def test_time_unit_s(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "s", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--time-unit", + "s", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "s", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.time_unit def test_time_unit_ms(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "ms", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--time-unit", + "ms", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "ms", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.time_unit def test_time_unit_us(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "us", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--time-unit", + "us", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "us", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.time_unit def test_time_unit_ns(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "ns", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--time-unit", + "ns", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--time-unit", - "ns", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.decimal def test_decimal_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--decimal", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--decimal", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--decimal", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.decimal def test_decimal_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - indir1, - "--decimal", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + indir1, + "--decimal", + "1", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--decimal", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.decimal def test_decimal_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--decimal", - "4", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--decimal", + "4", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--decimal", - "4", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.misc def test_save_dfs(): output_path = "tests/workloads/vcopy/saved_analysis" - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--save-dfs", - output_path, - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--save-dfs", + output_path, + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--save-dfs", - output_path, - ], - ): - omniperf.main() - assert e.value.code == 0 + files_in_workload = os.listdir(output_path) + single_row_tables = [ + "0.1_Top_Kernels.csv", + "13.3_Instruction_Cache_-_L2_Interface.csv", + "18.1_Aggregate_Stats_(All_channels).csv", + ] + for file_name in files_in_workload: + df = pd.read_csv(output_path + "/" + file_name) + if file_name in single_row_tables: + assert len(df.index) == 1 + else: + assert len(df.index) >= 3 - files_in_workload = os.listdir(output_path) - single_row_tables = [ - "0.1_Top_Kernels.csv", - "13.3_Instruction_Cache_-_L2_Interface.csv", - "18.1_Aggregate_Stats_(All_channels).csv", - ] - for file_name in files_in_workload: - df = pd.read_csv(output_path + "/" + file_name) - if file_name in single_row_tables: - assert len(df.index) == 1 - else: - assert len(df.index) >= 3 - - shutil.rmtree(output_path) + shutil.rmtree(output_path) test_utils.clean_output_dir(config["cleanup"], workload_dir) - workload_dir = test_utils.setup_workload_dir(indir1) + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) with pytest.raises(SystemExit) as e: with patch( "sys.argv", @@ -1362,396 +869,243 @@ def test_save_dfs(): @pytest.mark.col def test_col_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--cols", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.col def test_col_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--cols", + "2", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.col def test_col_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "0", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--cols", + "0", + "2", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--cols", - "0", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.misc def test_g(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "-g", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "-g", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "-g", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_0(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "0", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "0", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_1(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "1", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "1", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_2(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "2", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "2", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_3(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "3", - ], - ): - omniperf.main() - assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "3", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "3", + ], + ): + omniperf.main() + assert e.value.code == 0 + test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_4(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "4", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "4", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "4", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_5(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "5", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "5", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @pytest.mark.kernel_verbose def test_kernel_verbose_6(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "6", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--kernel-verbose", + "6", + ], + ): + omniperf.main() + assert e.value.code == 0 - workload_dir = test_utils.setup_workload_dir(indir2) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--kernel-verbose", - "6", - ], - ): - omniperf.main() - assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir) @@ -1805,18 +1159,19 @@ def test_baseline(): @pytest.mark.misc def test_dependency_MI100(): - workload_dir = test_utils.setup_workload_dir(indir1) - with pytest.raises(SystemExit) as e: - with patch( - "sys.argv", - [ - "omniperf", - "analyze", - "--path", - workload_dir, - "--dependency", - ], - ): - omniperf.main() - assert e.value.code == 0 + for dir in indirs: + workload_dir = test_utils.setup_workload_dir(dir) + with pytest.raises(SystemExit) as e: + with patch( + "sys.argv", + [ + "omniperf", + "analyze", + "--path", + workload_dir, + "--dependency", + ], + ): + omniperf.main() + assert e.value.code == 0 test_utils.clean_output_dir(config["cleanup"], workload_dir)