-
Notifications
You must be signed in to change notification settings - Fork 61
[CI] 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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,35 +13,35 @@ | |||||||||||||||
| default="selected", | ||||||||||||||||
| help="Test cases scope", | ||||||||||||||||
| ) | ||||||||||||||||
| # Add skip-cases parameter to import window skip dictionary | ||||||||||||||||
| parser.add_argument( | ||||||||||||||||
| "--skip-cases", | ||||||||||||||||
| action="store_true", | ||||||||||||||||
| default=False, | ||||||||||||||||
| help="Use window skip dictionary for test cases", | ||||||||||||||||
| ) | ||||||||||||||||
| args = parser.parse_args() | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| 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: | ||||||||||||||||
| platform = sys.platform | ||||||||||||||||
| print(f"Running test on the platform: {platform}") | ||||||||||||||||
| # Import window skip dictionary if Platform is Windows | ||||||||||||||||
| if platform.startswith("win"): | ||||||||||||||||
| 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 | ||||||||||||||||
libohao1201 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
|
|
||||||||||||||||
| # 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 [] | ||||||||||||||||
|
Comment on lines
+39
to
+44
|
||||||||||||||||
| 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 [] | |
| merged_skip_dict[key] = list(skip_dict[key]) if isinstance(skip_dict[key], tuple) else (skip_dict[key].copy() if skip_dict[key] else []) |
libohao1201 marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,8 @@ | |
|
|
||
| skip_dict = { | ||
| # Windows: Skip entire files using *.py:: pattern | ||
| "test_decomp": [ | ||
| "test_decomp.py::", # Skip entire file on Windows | ||
| "test_decomp.py": [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to align with the naming style you could change test_decomp.py to test_decomp_xpu.py. |
||
| "test_decomp.py", # Skip entire file on Windows | ||
| ], | ||
| # Files where Windows only needs to skip specific tests (will merge with Linux defaults) | ||
| # "test_linalg": [ | ||
|
|
||
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.
This update will make all the test files return True, is it correct?