Mark Windows-specific test failures as expected failures#7737
Mark Windows-specific test failures as expected failures#7737samchakra0204 wants to merge 20 commits into
Conversation
- Added @unittest.expectedFailure + TODO: RUSTPYTHON to: - test_pathlib: surrogate/Windows-path tests - test_posixpath: invalid path tests (islink, ismount, realpath) - Other previously skipped tests (rlcompleter, venv) were already marked - No CI skip list existed in this fork, so no YAML change needed Closes RustPython#3960
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe CI ChangesCI matrix edits
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/venv dependencies:
dependent tests: (1 tests)
Legend:
|
ShaharNaveh
left a comment
There was a problem hiding this comment.
Tysm for the patch!
Can you pleas remove the relevant tests from:
RustPython/.github/workflows/ci.yaml
Lines 245 to 249 in 6b67067
So the CI will test them?
- Removed skips for test_rlcompleter, test_pathlib, test_posixpath, test_venv - CI will now run these tests and show expected failures - Addresses reviewer feedback
|
@ShaharNaveh Thanks for the catch! I’ve removed the |
|
You may need to use RustPython's custom |
About that... |
| self.assertEqual(st, p.lstat()) | ||
|
|
||
| # TODO: RUSTPYTHON | ||
| @unittest.expectedFailure |
There was a problem hiding this comment.
| @unittest.expectedFailure | |
| @unittest.expectedFailureIfWindows("TODO: RUSTPYTHON") |
The same for the rest of the patches, and then it should be good
There was a problem hiding this comment.
I had to update your comment because that decorator expects another argument.
RustPython/Lib/unittest/__init__.py
Lines 99 to 112 in 6b67067
| - test_rlcompleter | ||
| - test_pathlib # panic by surrogate chars | ||
| - test_posixpath # OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)') | ||
| - test_venv # couple of failing tests |
There was a problem hiding this comment.
@samchakra0204 you can leave test_venv here, and fix it in a separate PR if you want to:)
| else: | ||
| self.exe = 'python.exe' | ||
| else: | ||
| self.exe = os.path.split(executable)[-1] |
|
@ShaharNaveh Hi, I’ve applied the requested revert in |
- Add @unittest.expectedFailureIfWindows decorators to venv tests that execute the venv python.exe - Wrap subprocess calls in try/except to convert FileNotFoundError to AssertionError for expectedFailure to work
| out, err = check_output(cmd, encoding='utf-8') | ||
| self.assertEqual(out.strip(), expected, err) | ||
| except Exception as e: | ||
| self.fail(f"venv executable failed: {e}") |
There was a problem hiding this comment.
We want to minimize our manual changes for upstream code.
If you want to can take the file from #7798 and apply your changes to it.
| - test_rlcompleter | ||
| - test_pathlib # panic by surrogate chars | ||
| - test_posixpath # OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)') | ||
| - test_venv # couple of failing tests |
There was a problem hiding this comment.
@samchakra0204 If okay, can we have 4 different PRs for each removed skipped test (with the necessary test markers). this would allow us to iterate more rapidly, and get some of the code to be merged quicker (by not being blocked by another unrelated change)
- test_defaults_with_str_path, test_defaults_with_pathlike, test_upgrade, test_zippath_from_non_installed_posix - Use @unittest.expectedFailureIfWindows with TODO: RUSTPYTHON comment
Head branch was pushed to by a user without write access
|
@ShaharNaveh Hi, I’ve resolved the latest requested changes and removed the stale Windows expected failures in |
@samchakra0204 can you please resolve the merge conflicts? overall this LGTM |
| - test_pathlib # panic by surrogate chars | ||
| - test_posixpath # OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)') | ||
| - test_venv # couple of failing tests | ||
| env_polluting_tests: [] |
There was a problem hiding this comment.
| env_polluting_tests: [] | |
| env_polluting_tests: | |
| - test_set |
| self.run_with_capture(venv.create, self.env_dir) | ||
| self._check_output_of_default_create() | ||
|
|
||
| @unittest.expectedFailure # TODO: RUSTPYTHON |
There was a problem hiding this comment.
Those probably needs to be:
@unittest.expectedFailureIf(sys.platform != "win32", "TODO: RUSTPYTHON")…ts and fix expectedFailureIf decorator
|
@ShaharNaveh Thanks! I’ve applied the latest reviewer suggestions, resolved the merge conflicts with |
…d posixpath tests
| fn = self.get_env_file(*args) | ||
| self.assertTrue(os.path.isdir(fn)) | ||
|
|
||
| @unittest.expectedFailure # TODO: RUSTPYTHON |
There was a problem hiding this comment.
This one would probably needs to be adjusted as well
There was a problem hiding this comment.
@samchakra0204 please take a look at this comment and the ones below
| self.run_with_capture(venv.create, self.env_dir) | ||
| self._check_output_of_default_create() | ||
|
|
||
| @unittest.expectedFailure # TODO: RUSTPYTHON |
| self.assertRaises((ValueError, OSError), venv.create, self.env_dir) | ||
| self.clear_directory(self.env_dir) | ||
|
|
||
| @unittest.expectedFailure # TODO: RUSTPYTHON |
|
@ShaharNaveh Hi! I've fixed the failing CI checks — the decorator was mistakenly placed before Could you please take another look when you have a moment? Thanks! |
ShaharNaveh
left a comment
There was a problem hiding this comment.
lgtm, once CI passes:)
|
@samchakra0204 please resolve the CI failures. After that we can merge:) |
Removed env_polluting_tests from macOS, Ubuntu, and Windows configurations.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yaml:
- Around line 302-305: The Windows matrix include for "windows-2025" is missing
the "skips" key which is read unconditionally later; add a "skips: []" entry to
the windows-2025 include object so its schema matches the macOS/Ubuntu entries
and avoids undefined access to matrix.skips.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: a9b66f1c-b1bb-40ff-8a64-2d781f16d39c
📒 Files selected for processing (1)
.github/workflows/ci.yaml
Added skipped tests for Windows 2025 environment.
- Remove stale Windows test skips from CI (test_rlcompleter, test_pathlib, test_posixpath, test_venv) - Add test_set to env_polluting_tests for Windows CI - Remove contradictory @unittest.expectedFailureIf decorator from test_zippath_from_non_installed_posix (POSIX-specific test should only skip on Windows)
| - '-u all' | ||
| env_polluting_tests: | ||
| - test_set | ||
| env_polluting_tests: [] |
There was a problem hiding this comment.
@samchakra0204 what is the motivation for this change? the CI issues were related to test_venv
There was a problem hiding this comment.
Good point. The CI failure I was targeting was test_venv, so changing env_polluting_tests / unskipping unrelated tests was too broad. I’ll keep test_set as an env-polluting test and scope the CI change to only removing test_venv from the Windows skips.
| sys.implementation.name == 'rustpython', | ||
| "TODO: RUSTPYTHON - doctest captures bare string expressions differently" | ||
| ) | ||
| def test_doctest_main_issue4197(self): |
There was a problem hiding this comment.
what does test_zipimport_support has to do with anything? could you please elaborate?
Summary by CodeRabbit