-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
test: skip symlink test on Windows #19503
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
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
|
||
})(); | ||
|
||
(shouldSkipSymlinkTest ? describe.skip : describe)("if contains symbolic links", () => { |
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.
I'm not sure if it's a good idea to just skip the test, as it could silently stop working in CI. Perhaps we could rather wrap this in try-catch, log the help info (or add it to the error message), and rethrow the error:
eslint/tests/lib/cli-engine/file-enumerator.js
Lines 582 to 583 in 9c5c6ee
fs.symlinkSync(path.join(root, "top-level.js"), path.join(dir2, "top.js"), "file"); | |
fs.symlinkSync(path.join(root, "dir1"), path.join(dir2, "nested"), "dir"); |
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.
Couldn't we just check if process.platform === "win32"
and skip if true?
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.
Perhaps we could rather wrap this in try-catch, log the help info (or add it to the error message), and rethrow the error:
I'm not sure everyone can/want make it work on Windows. How about only allow skip if !process.env.CI
?
Couldn't we just check if process.platform === "win32" and skip if true?
AFAIK, not every version of Windows has this problem, what if there are bugs on Windows in this test, and it seems to be working on CI, more tests are always good.
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.
I think symlinks require admin privileges on Windows, which we'll never have when running tests. So I think it's ok to just skip on Windows always.
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.
LGTM. Would like @mdjermanovic to verify before merging.
👋 Temporary notice, I'm about to merge #19355 chore: formatted files with Prettier via trunk fmt. We should hold off on merging other PRs till it's done. I'll post back soon to confirm we're clear. Cheers! |
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
We're clear! To get rid of these merge conflicts, you can merge from git merge -X ours main |
@fisker can you fix merge conflicts? |
# Conflicts: # tests/lib/cli-engine/file-enumerator.js
…test # Conflicts: # tests/lib/cli-engine/file-enumerator.js
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
Another test failure on Windows.
What changes did you make? (Give an overview)
On Windows,
fs.symlinkSync
will fail if not in "Developer Mode", allow skip the test, but print help information on how to fix it.Is there anything you'd like reviewers to focus on?
No.