Add tests for HolisticTraceAnalysis/hta/utils#345
Closed
sijiaw-meta wants to merge 2 commits into
Closed
Conversation
|
@sijiaw-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104876398. |
sijiaw-meta
added a commit
to sijiaw-meta/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: **Purpose:** Add unit test coverage for HolisticTraceAnalysis/hta/utils to meet the >=90% per-file coverage target. Baseline did not exercise checker.py or validate_trace.py at all; utils.py and test_utils.py had partial coverage from existing tests. **Type:** Test infrastructure **Changes:** - New tests/test_checker.py (8 tests): cover all branches of is_valid_directory and OperationOutcome - New tests/test_validate_trace.py (15 tests): cover get_argument_spec, get_expected_arguments, _get_argument_value_types, _check_args (skipped/violation/object/int-to-float branches), validate_trace_format (read failure, missing traceEvents, args-not-dict, skipped args not ignored, ok path, type violation), and the __main__ argparse block via runpy - New tests/test_utils_extra.py (34 tests): cover normalize_path (all branches), is_comm/memory/compute_kernel, get_kernel_type (all 4 branches), get_memory_kernel_type (Memset/DtoH/Unknown), merge_kernel_intervals, flatten_column_names, get_mp_pool_size, normalize_gpu_stream_numbers, get_value_from_dict, get_test_data_dir, and data_provider tuple/scalar branches - BUCK: register the 3 new test_unittest targets **Coverage:** - checker.py: 0% -> 100% - test_utils.py: 60.7% -> 100% - utils.py: 56.0% -> 100% - validate_trace.py: 0% -> 96.4% - Folder total: 56.5% -> 98.8% Differential Revision: D104876398
dc07029 to
dc54c2f
Compare
sijiaw-meta
added a commit
to sijiaw-meta/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: **Purpose:** Add unit test coverage for HolisticTraceAnalysis/hta/utils to meet the >=90% per-file coverage target. Baseline did not exercise checker.py or validate_trace.py at all; utils.py and test_utils.py had partial coverage from existing tests. **Type:** Test infrastructure **Changes:** - New tests/test_checker.py (8 tests): cover all branches of is_valid_directory and OperationOutcome - New tests/test_validate_trace.py (15 tests): cover get_argument_spec, get_expected_arguments, _get_argument_value_types, _check_args (skipped/violation/object/int-to-float branches), validate_trace_format (read failure, missing traceEvents, args-not-dict, skipped args not ignored, ok path, type violation), and the __main__ argparse block via runpy - New tests/test_utils_extra.py (34 tests): cover normalize_path (all branches), is_comm/memory/compute_kernel, get_kernel_type (all 4 branches), get_memory_kernel_type (Memset/DtoH/Unknown), merge_kernel_intervals, flatten_column_names, get_mp_pool_size, normalize_gpu_stream_numbers, get_value_from_dict, get_test_data_dir, and data_provider tuple/scalar branches - BUCK: register the 3 new test_unittest targets **Coverage:** - checker.py: 0% -> 100% - test_utils.py: 60.7% -> 100% - utils.py: 56.0% -> 100% - validate_trace.py: 0% -> 96.4% - Folder total: 56.5% -> 98.8% Differential Revision: D104876398
dc54c2f to
5157e27
Compare
sijiaw-meta
added a commit
to sijiaw-meta/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: **Purpose:** Add unit test coverage for HolisticTraceAnalysis/hta/utils to meet the >=90% per-file coverage target. Baseline did not exercise checker.py or validate_trace.py at all; utils.py and test_utils.py had partial coverage from existing tests. **Type:** Test infrastructure **Changes:** - New tests/test_checker.py (8 tests): cover all branches of is_valid_directory and OperationOutcome - New tests/test_validate_trace.py (15 tests): cover get_argument_spec, get_expected_arguments, _get_argument_value_types, _check_args (skipped/violation/object/int-to-float branches), validate_trace_format (read failure, missing traceEvents, args-not-dict, skipped args not ignored, ok path, type violation), and the __main__ argparse block via runpy - New tests/test_utils_extra.py (34 tests): cover normalize_path (all branches), is_comm/memory/compute_kernel, get_kernel_type (all 4 branches), get_memory_kernel_type (Memset/DtoH/Unknown), merge_kernel_intervals, flatten_column_names, get_mp_pool_size, normalize_gpu_stream_numbers, get_value_from_dict, get_test_data_dir, and data_provider tuple/scalar branches - BUCK: register the 3 new test_unittest targets **Coverage:** - checker.py: 0% -> 100% - test_utils.py: 60.7% -> 100% - utils.py: 56.0% -> 100% - validate_trace.py: 0% -> 96.4% - Folder total: 56.5% -> 98.8% Differential Revision: D104876398
5157e27 to
6cb4f78
Compare
6cb4f78 to
a386fd8
Compare
Summary: **Purpose:** Add unit test coverage for HolisticTraceAnalysis/hta/configs to meet the >=90% per-file coverage target. Baseline was 95.2% overall but event_args_yaml_parser.py was at 84.2%. **Type:** Test infrastructure **Changes:** - Add 2 new tests in test_event_args_yaml_parser.py: test_parse_event_args_yaml_loads_local_file (covers the os.path.exists True branch that loads YAML from disk via mocked open) and test_main_runs_without_error (covers the main() function via captured stdout) - event_args_yaml_parser.py: 84.2% -> 94.7% (folder total: 96.3%) Differential Revision: D104876231
Summary: **Purpose:** Add unit test coverage for HolisticTraceAnalysis/hta/utils to meet the >=90% per-file coverage target. Baseline did not exercise checker.py or validate_trace.py at all; utils.py and test_utils.py had partial coverage from existing tests. **Type:** Test infrastructure **Changes:** - New tests/test_checker.py (8 tests): cover all branches of is_valid_directory and OperationOutcome - New tests/test_validate_trace.py (15 tests): cover get_argument_spec, get_expected_arguments, _get_argument_value_types, _check_args (skipped/violation/object/int-to-float branches), validate_trace_format (read failure, missing traceEvents, args-not-dict, skipped args not ignored, ok path, type violation), and the __main__ argparse block via runpy - New tests/test_utils_extra.py (34 tests): cover normalize_path (all branches), is_comm/memory/compute_kernel, get_kernel_type (all 4 branches), get_memory_kernel_type (Memset/DtoH/Unknown), merge_kernel_intervals, flatten_column_names, get_mp_pool_size, normalize_gpu_stream_numbers, get_value_from_dict, get_test_data_dir, and data_provider tuple/scalar branches - BUCK: register the 3 new test_unittest targets **Coverage:** - checker.py: 0% -> 100% - test_utils.py: 60.7% -> 100% - utils.py: 56.0% -> 100% - validate_trace.py: 0% -> 96.4% - Folder total: 56.5% -> 98.8% Differential Revision: D104876398
a386fd8 to
e16270b
Compare
|
This pull request has been merged in 131d75c. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Purpose: Add unit test coverage for HolisticTraceAnalysis/hta/utils to meet the >=90% per-file coverage target. Baseline did not exercise checker.py or validate_trace.py at all; utils.py and test_utils.py had partial coverage from existing tests.
Type: Test infrastructure
Changes:
Coverage:
Differential Revision: D104876398