-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
tools: add eslint check for skipIfEslintMissing #20372
Conversation
tools/eslint-rules/eslint-check.js
Outdated
// Rule Definition | ||
//------------------------------------------------------------------------------ | ||
const msg = 'Please add a skipIfEslintMissing() call to allow this test to ' + | ||
'be skippped when Node.js is built from a source tarball.'; |
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.
typo: skippped?
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 based this on the equivalent inspector-check and didn't notice it was wrong there. I'll correct both.
This comment has been minimized.
This comment has been minimized.
Fun. So we have a failing eslint rule test, e.g., https://ci.nodejs.org/job/node-test-commit-plinux/nodes=ppcle-ubuntu1404/17266/console
This PR doesn't touch that test, nor the eslint check that it exercises but it does fix |
#19701 changed the message but not the corresponding test. |
Fixed up the |
We have a chicken-egg problem. The CI machines don't install eslint, so these tests are never run. On the other hand this is meta-meta-meta-testing (writing a test to verify a test to the linter is properly skipped 😵) and might be overkill? Why not just move the |
The CI machines don't need to install eslint as it's already in the source tree from a git checkout. It's only when building from the source tarball that eslint is missing. The tests weren't being run because the |
I'm not opposed to this idea (if someone else does the work* 😛) since these tests are testing our custom eslint rules and not testing Node.js itself. * It's now 10pm here -- I started working on this three hours ago thinking this would be a quick fix (inserting the missing |
Ohh right. So it makes me think about wrong assumptions... the |
I'll see what I can come up with... |
It checks for the presence of the Lines 495 to 501 in a4b4854
(Note that at the moment it's looking in a relative directory and hence incorrect (fixed as part of this PR)). |
The rule is Line 496 in a4b4854
So it's error prone — if path calculation is wrong, skip. If we tree-factor and moved the dir (again), skip. If we finish rolling-up eslint into a single file, skip 🤷♂️ . |
cc @nodejs/linting |
arm CI rerun passes: https://ci.nodejs.org/job/node-test-commit-arm-fanned/829/ |
I didn't label this I'm on a tablet at the moment so can't land this right now, but unless there are actual objections I'll land early next week (unless someone else lands first). |
Add a custom eslint rule to check for `common.skipIfEslintMissing()` to allow tests to run from source tarballs that do not include eslint. Fix up rule tests that were failing the new check. Refs: nodejs#20336 PR-URL: nodejs#20372 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 870ae72 |
Add a custom eslint rule to check for `common.skipIfEslintMissing()` to allow tests to run from source tarballs that do not include eslint. Fix up rule tests that were failing the new check. Refs: #20336 PR-URL: #20372 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a custom eslint rule to check for `common.skipIfEslintMissing()` to allow tests to run from source tarballs that do not include eslint. Fix up rule tests that were failing the new check. Refs: #20336 PR-URL: #20372 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a custom eslint rule to check for `common.skipIfEslintMissing()` to allow tests to run from source tarballs that do not include eslint. Fix up rule tests that were failing the new check. Refs: #20336 PR-URL: #20372 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add a custom eslint rule to check for
common.skipIfEslintMissing()
toallow tests to run from source tarballs that do not include eslint.
Fix up tests that were failing the new check.
Refs: #20336 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes