-
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 | ||||||||||||||||
|
|
||||||||||||||||
| # 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 []) |
Uh oh!
There was an error while loading. Please reload this page.