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: add tap output to cpplint #3448

Merged
merged 1 commit into from
Nov 12, 2015

Conversation

jbergstroem
Copy link
Member

Implement a crude TAP13 writer for cpplint. Does its job and not much else. Only supports writing TAP output to file, not vs7 or emacs formats.

@jbergstroem jbergstroem added the tools Issues and PRs related to the tools directory. label Oct 20, 2015
@@ -1,4 +1,4 @@
#!/usr/bin/python2.4
#!/usr/bin/env python
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that I care much, but this wouldn't work on Arch Linux where python is python3.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think python2.4 would work much better :) Just pulled the same convention as what we have in configure and tools/test.py -- would personally have gone with python2 but +1 for consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right. I have a python2 and a python2.7. python2 would also have been my choice, but whatever is consistent is fine.

@bnoordhuis
Copy link
Member

LGTM with a nit and as long as it doesn't make moving to other tools in the future harder.

@jbergstroem
Copy link
Member Author

My magic ball speaks of clang-format, but we'll see when that happens. Will fix the quotes (will I ever learn).

@jbergstroem
Copy link
Member Author

As for moving into other tools forward, having TAP as a required output format (well, I think we can use junit from jenkins as well) seems reasonable.

cc @nodejs/build.

@joaocgreis
Copy link
Member

So this prints one not ok for each problem found, may print more than one per file, but prints nothing if the file is ok. This was not obvious to me at first, maybe add a quick mention to the help output?

It's missing the TAP plan.

LGTM

sys.stderr.write('Category \'%s\' errors found: %d\n' %
(category, count))
sys.stderr.write('Total errors found: %d\n' % self.error_count)
if not _cpplint_state.output_format == 'tap':
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason to use this instead of if _cpplint_state.output_format != 'tap':?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope

@rmg
Copy link
Contributor

rmg commented Oct 26, 2015

So this prints one not ok for each problem found, may print more than one per file, but prints nothing if the file is ok. This was not obvious to me at first, maybe add a quick mention to the help output?

That's not very useful. It makes it very hard to differentiate between a crash and a successful run if an empty file indicates success.

This should be easy enough to address with the same code that will be added to fix the lack of plan.

@bnoordhuis
Copy link
Member

What's the status of this PR? Blocked on @rmg's comment?

@jbergstroem
Copy link
Member Author

Not really. I think we should land and fix as we move forward. This patch will give us visibility (here are the fails) where there currently is pass or fail.

@thefourtheye
Copy link
Contributor

Let's have a CI run and check the result?

@jbergstroem
Copy link
Member Author

@thefourtheye won't be invoked through ci just now.

logger.setLevel(logging.INFO)

if _cpplint_state.output_format == 'tap':
logger.info('TAP Version 13')
Copy link
Contributor

Choose a reason for hiding this comment

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

As per the spec, it should have been version, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think all TAP is case insensitive, but yeah – the spec does use lowercase. I copied above from eslint output. Will update.

@thefourtheye
Copy link
Contributor

this prints one not ok for each problem found, may print more than one per file, but prints nothing if the file is ok

This actually is kind of problematic for the TAP result parser I guess. We don't print the plan and we don't print the current test number as well. So, how will the parser keep track of the current test which failed?

@jbergstroem
Copy link
Member Author

@thefourtheye it won't keep track of tests between runs, but it will report test failures with verbose info each run. lint failures are so rare; my take was that we'd rather get more output than no.

@thefourtheye
Copy link
Contributor

Fair enough. Considering this affects only the cpp linter, LGTM. Do you have plans to extend this to test runner?

@jbergstroem
Copy link
Member Author

@thefourtheye yeah. I've already got a branch i've been running tests on locally (and on my gh) so we can expose this as part of the test runner.

@thefourtheye
Copy link
Contributor

@jbergstroem Awesome!

@jbergstroem jbergstroem force-pushed the feature/cpplint-tap branch 2 times, most recently from f041203 to 6c3d194 Compare November 11, 2015 23:01
Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: nodejs#3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@jbergstroem jbergstroem merged commit 7b45163 into nodejs:master Nov 12, 2015
jbergstroem added a commit that referenced this pull request Nov 13, 2015
Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: #3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@rvagg rvagg mentioned this pull request Dec 17, 2015
jbergstroem added a commit that referenced this pull request Dec 29, 2015
Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: #3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 19, 2016
Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: #3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants