-
Notifications
You must be signed in to change notification settings - Fork 61
Revise the Windows skip logic of UT #2383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,21 +27,26 @@ def should_skip_entire_file(skip_list): | |||||
| """Check if the skip list contains any entire file skip pattern (*.py::)""" | ||||||
| if not skip_list: | ||||||
| return False | ||||||
| return any(item.endswith(".py::") for item in skip_list) | ||||||
| return any(item.endswith(".py") for item in skip_list) | ||||||
|
|
||||||
|
|
||||||
| # Import window skip dictionary if skip-cases is True | ||||||
| if args.skip_cases: | ||||||
| try: | ||||||
| # Import the window skip dictionary module | ||||||
| from window_skip_dict import skip_dict as window_skip_dict | ||||||
| from windows_skip_cases import skip_dict as window_skip_dict | ||||||
|
|
||||||
| # Merge the window skip dictionary with the default one using intelligent strategy | ||||||
| merged_skip_dict = {} | ||||||
|
|
||||||
| # First, copy all keys from default skip_dict | ||||||
| for key in skip_dict: | ||||||
| merged_skip_dict[key] = skip_dict[key].copy() if skip_dict[key] else [] | ||||||
| if skip_dict[key] is None: | ||||||
| merged_skip_dict[key] = [] | ||||||
| elif isinstance(skip_dict[key], tuple): | ||||||
| merged_skip_dict[key] = list(skip_dict[key]) | ||||||
| else: | ||||||
| merged_skip_dict[key] = skip_dict[key].copy() if skip_dict[key] else [] | ||||||
|
|
||||||
| # Then merge with window_skip_dict using intelligent strategy | ||||||
| for key in window_skip_dict: | ||||||
|
|
@@ -104,6 +109,10 @@ def should_skip_entire_file(skip_list): | |||||
| skip_list = None | ||||||
| # For "selected" case, use the skip_list as is | ||||||
|
|
||||||
| # If skip_list is empty, set it to None | ||||||
| if skip_list is not None and len(skip_list) == 0: | ||||||
|
||||||
| if skip_list is not None and len(skip_list) == 0: | |
| if skip_list is not None and not skip_list: |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1092,7 +1092,7 @@ def copy_tests( | |||||
|
|
||||||
| def launch_test(test_case, skip_list=None, exe_list=None): | ||||||
| os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" | ||||||
| if skip_list is not None: | ||||||
| if skip_list and len(skip_list) > 0: | ||||||
|
||||||
| skip_options = ' -k "not ' + skip_list[0] | ||||||
| for skip_case in skip_list[1:]: | ||||||
| skip_option = " and not " + skip_case | ||||||
|
|
@@ -1103,7 +1103,7 @@ def launch_test(test_case, skip_list=None, exe_list=None): | |||||
| + test_case | ||||||
| ) | ||||||
| test_command += skip_options | ||||||
| elif exe_list is not None: | ||||||
| elif exe_list and len(exe_list) > 0: | ||||||
|
||||||
| elif exe_list and len(exe_list) > 0: | |
| elif exe_list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The nested if-elif-else logic can be simplified. When
skip_dict[key]is None or falsy, all branches result in an empty list. Consider consolidating:merged_skip_dict[key] = list(skip_dict[key]) if isinstance(skip_dict[key], tuple) else (skip_dict[key].copy() if skip_dict[key] else [])