Skip to content
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: remove lint-js.js #30955

Closed
wants to merge 1 commit into from
Closed

tools: remove lint-js.js #30955

wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 13, 2019

lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

  • It results in occasional (and puzzling) yellow CI runs for
    node-test-linter because the tap file is corrupted somehow.
    Interleaved maybe? I don't know, but a simple solution is removing it
    and running ESLint directly.

  • On my local laptop, it reduces the linting from about 75 seconds to
    about 55 seconds. This kind of savings is not worth the added
    complexity and the instability noted above.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Dec 13, 2019
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

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

We will need to check the removed lines from vcbuild.bat are not used anywhere in the CI.

vcbuild.bat Show resolved Hide resolved
@Trott
Copy link
Member Author

Trott commented Dec 13, 2019

We will need to check the removed lines from vcbuild.bat are not used anywhere in the CI.

Yeah, running full CI to check, although obviously that won't necessarily catch things in other jobs. Kinda doubt it would be in other jobs and not in the main one, though.

@nodejs-github-bot
Copy link
Collaborator

@mscdex
Copy link
Contributor

mscdex commented Dec 14, 2019

Before removing, it would be a good idea to see the performance impact on all of the CI machines (especially the ARM-based ones).

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

Before removing, it would be a good idea to see the performance impact on all of the CI machines (especially the ARM-based ones).

We only run lint on one machine these days.

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 14, 2019
@richardlau
Copy link
Member

Looks like the linter job failed to parse the tap file with tap2junit:
https://ci.nodejs.org/job/node-test-linter/31548/console

02:42:08 + tap2junit -i test-eslint.tap -o out/test.xml
02:42:09 Traceback (most recent call last):
02:42:09   File "/usr/local/bin/tap2junit", line 11, in <module>
02:42:09     sys.exit(main())
02:42:09   File "/usr/local/lib/python2.7/dist-packages/tap2junit/__main__.py", line 44, in main
02:42:09     result = parse(os.path.splitext(args.input.name)[0], data)
02:42:09   File "/usr/local/lib/python2.7/dist-packages/tap2junit/__main__.py", line 15, in parse
02:42:09     t = TestCase(test.description, None, test.yaml['duration_ms'])
02:42:09 TypeError: 'NoneType' object has no attribute '__getitem__'
02:42:09 POST BUILD TASK : FAILURE

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

Looks like the linter job failed to parse the tap file with tap2junit:

That's alarming. It parses just fine when I do it locally....

@Trott Trott removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 14, 2019
@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

Looks like the linter job failed to parse the tap file with tap2junit:

That's alarming. It parses just fine when I do it locally....

Argh, the version of tap2junit on the linter machine is different than what I get with pip install tap2junit....

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

tap2junit on the linter box is 0.1.4 but the current release is 0.1.5.

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

Oh, interesting. So I managed to replicate the bug that I mention above where I surmise that its interleaved output or something, but actually it's a bug in tap2junit 0.1.4.

Input file:

TAP version 13
1..1
ok 1 - /Users/trott/io.js/.eslintrc.js

TAP version 13
1..2
ok 1 - /Users/trott/io.js/benchmark/net/tcp-raw-pipe.js
ok 2 - /Users/trott/io.js/benchmark/net/tcp-raw-s2c.js

With tap2junit 0.1.4:

$ tap2junit -i test.tap -o foo
Traceback (most recent call last):
  File "/usr/local/bin/tap2junit", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/tap2junit/__main__.py", line 44, in main
    result = parse(os.path.splitext(args.input.name)[0], data)
  File "/usr/local/lib/python2.7/site-packages/tap2junit/__main__.py", line 11, in parse
    tap_parser.parse(data)
  File "/usr/local/lib/python2.7/site-packages/tap2junit/tap13.py", line 124, in parse
    self._parse(StringIO.StringIO(source))
  File "/usr/local/lib/python2.7/site-packages/tap2junit/tap13.py", line 102, in _parse
    raise ValueError("Descending test id on line: %r" % line)
ValueError: Descending test id on line: 'ok 1 - /Users/trott/io.js/benchmark/net/tcp-raw-pipe.js'
$

0.1.5 processes it normally.

Any chance we want to update to 0.1.5, at least on the linter boxes? It contains the changes for Python 3 compatibility, if that's any encouragement.

/ping @nodejs/python

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

(And, naturally, it seems exceedingly likely that the other problem we're seeing now with the tap file from this PR is also a bug in tap2junit 0.1.4. The file is processed without a problem by tap2junit 0.1.5.)

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

Any chance we want to update to 0.1.5, at least on the linter boxes? It contains the changes for Python 3 compatibility, if that's any encouragement.

@nodejs/build ^^^^^^

@cclauss
Copy link
Contributor

cclauss commented Dec 14, 2019

StringIO.StringIO(source) in Python2 would be io.StringIO(source) in Python 3 so I would strongly encourage the use of the latest version of tap2junit.

https://github.com/nodejs/tap2junit/search?q=stringio&unscoped_q=stringio

@mscdex
Copy link
Contributor

mscdex commented Dec 14, 2019

So we should just upgrade tap2junit instead of making the changes in this PR?

@Trott
Copy link
Member Author

Trott commented Dec 14, 2019

So we should just upgrade tap2junit instead of making the changes in this PR?

Perhaps. There's still the issue of cost/benefit ratio where cost is code complexity and extra time spent troubleshooting issues like this. But yeah, this PR suddenly becomes less compelling for sure.

Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

Whether or not this fixes the issue, given the minimal improvements in run time and extra incurred complexity, I think removing this is actually still a good thing.

@rvagg
Copy link
Member

rvagg commented Dec 20, 2019

test-softlayer-ubuntu1604-x64-1 too, it's just offline for now cause it's wonky and needs some of my time

https://ci.nodejs.org/label/jenkins-workspace/ are the machines.

@BridgeAR
Copy link
Member

Ref: eslint/eslint#3565
Ref: eslint/eslint#12191

I suggest to remove this as soon as the feature landed in eslint itself but not before? It should hopefully not take much more time to be implemented.

@Trott
Copy link
Member Author

Trott commented Jan 27, 2020

Ref: eslint/eslint#3565
Ref: eslint/eslint#12191

I suggest to remove this as soon as the feature landed in eslint itself but not before? It should hopefully not take much more time to be implemented.

Going the other way, the CLIEngine class used by lint-js.js will be deprecated in ESLint 7.0.0 (in alpha right now). So that's an argument for doing it sooner. We can always enable the parallel linting when it becomes available in ESLint.

@Trott
Copy link
Member Author

Trott commented Jan 27, 2020

tap2junit updated for Python 2 on test-packetnet-ubuntu1604-x64-2. It was already on the correct version on test-packetnet-ubuntu1604-x64-1. Removing blocked label.

@Trott Trott removed the blocked PRs that are blocked by other issues or PRs. label Jan 27, 2020
@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member Author

Trott commented Jan 27, 2020

tap2junit updated for Python 2 on test-packetnet-ubuntu1604-x64-2.

test-softlayer-ubuntu1604-x64-1 too.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Feb 1, 2020

@BridgeAR BridgeAR force-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72 Compare May 31, 2020 12:19
@jasnell jasnell added the stalled Issues and PRs that are stalled. label Jun 25, 2020
@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

Ping @Trott

lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

* It results in occasional (and puzzling) yellow CI runs for
  node-test-linter because the tap file is corrupted somehow.
  Interleaved maybe? I don't know, but a simple solution is removing it
  and running ESLint directly.

* On my local laptop, it reduces the linting from about 75 seconds to
  about 55 seconds. This kind of savings is not worth the added
  complexity and the instability noted above.
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jun 26, 2020

@Trott Trott removed the stalled Issues and PRs that are stalled. label Jun 26, 2020
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

jasnell pushed a commit that referenced this pull request Jul 3, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

* It results in occasional (and puzzling) yellow CI runs for
  node-test-linter because the tap file is corrupted somehow.
  Interleaved maybe? I don't know, but a simple solution is removing it
  and running ESLint directly.

* On my local laptop, it reduces the linting from about 75 seconds to
  about 55 seconds. This kind of savings is not worth the added
  complexity and the instability noted above.

PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Jul 3, 2020

Landed in 92f8781

@jasnell jasnell closed this Jul 3, 2020
MylesBorins pushed a commit that referenced this pull request Jul 14, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

* It results in occasional (and puzzling) yellow CI runs for
  node-test-linter because the tap file is corrupted somehow.
  Interleaved maybe? I don't know, but a simple solution is removing it
  and running ESLint directly.

* On my local laptop, it reduces the linting from about 75 seconds to
  about 55 seconds. This kind of savings is not worth the added
  complexity and the instability noted above.

PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 14, 2020
MylesBorins pushed a commit that referenced this pull request Jul 16, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

* It results in occasional (and puzzling) yellow CI runs for
  node-test-linter because the tap file is corrupted somehow.
  Interleaved maybe? I don't know, but a simple solution is removing it
  and running ESLint directly.

* On my local laptop, it reduces the linting from about 75 seconds to
  about 55 seconds. This kind of savings is not worth the added
  complexity and the instability noted above.

PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

* It results in occasional (and puzzling) yellow CI runs for
  node-test-linter because the tap file is corrupted somehow.
  Interleaved maybe? I don't know, but a simple solution is removing it
  and running ESLint directly.

* On my local laptop, it reduces the linting from about 75 seconds to
  about 55 seconds. This kind of savings is not worth the added
  complexity and the instability noted above.

PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@codebytere codebytere mentioned this pull request Sep 28, 2020
@Trott Trott deleted the simplify-lint branch April 14, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.