Skip to content

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

Merged
merged 8 commits into from
Mar 29, 2025
Merged

Conversation

fisker
Copy link
Contributor

@fisker fisker commented Mar 11, 2025

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.

@fisker fisker requested a review from a team as a code owner March 11, 2025 17:04
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 11, 2025
@eslint-github-bot eslint-github-bot bot added the chore This change is not user-facing label Mar 11, 2025
Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit c50c9bd
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/67e6fb2b8e8cb400087e3e9d


})();

(shouldSkipSymlinkTest ? describe.skip : describe)("if contains symbolic links", () => {
Copy link
Member

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:

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");

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@nzakas nzakas moved this from Needs Triage to Implementing in Triage Mar 14, 2025
@fisker fisker changed the title test: allow skip symlink test on Windows test: skip symlink test on Windows Mar 18, 2025
nzakas
nzakas previously approved these changes Mar 18, 2025
Copy link
Member

@nzakas nzakas left a 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.

@nzakas nzakas moved this from Implementing to Second Review Needed in Triage Mar 18, 2025
@JoshuaKGoldberg
Copy link
Contributor

👋 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!
(context: #19355 (comment))

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@JoshuaKGoldberg
Copy link
Contributor

We're clear! main is now formatted with Prettier via trunk fmt.

To get rid of these merge conflicts, you can merge from main and use branch's versions of all the conflicted files. Making a new commit should trigger auto-formatting.

git merge -X ours main

@mdjermanovic
Copy link
Member

@fisker can you fix merge conflicts?

# Conflicts:
#	tests/lib/cli-engine/file-enumerator.js
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit b9a5efa into eslint:main Mar 29, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Mar 29, 2025
@fisker fisker deleted the symlink-test branch March 29, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore This change is not user-facing
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

4 participants