This repository was archived by the owner on Jun 18, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Add command line to nodereport. #34
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d5673b8
This patch adds the command line used to start the process to noderep…
hhellyer 412efb4
Correct white space. Shouldn't indent when starting a #ifdef.
hhellyer 1294c2a
Fix the spelling of separator
hhellyer dd20187
Add command line support on Windows
rnchamberlain 5872102
Fix code review and formatting nits
rnchamberlain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,16 +36,16 @@ exports.validate = (t, report, options) => { | |
| const expectedVersions = options ? | ||
| options.expectedVersions || nodeComponents : | ||
| nodeComponents; | ||
| const plan = REPORT_SECTIONS.length + nodeComponents.length + 2; | ||
| var plan = REPORT_SECTIONS.length + nodeComponents.length + 2; | ||
| if (options.commandline) plan++; | ||
| t.plan(plan); | ||
|
|
||
| // Check all sections are present | ||
| REPORT_SECTIONS.forEach((section) => { | ||
| t.match(reportContents, new RegExp('==== ' + section), | ||
| 'Checking report contains ' + section + ' section'); | ||
| }); | ||
|
|
||
| // Check NodeReport section | ||
| // Check NodeReport header section | ||
| const nodeReportSection = getSection(reportContents, 'NodeReport'); | ||
| t.match(nodeReportSection, new RegExp('Process ID: ' + pid), | ||
| 'NodeReport section contains expected process ID'); | ||
|
|
@@ -57,6 +57,20 @@ exports.validate = (t, report, options) => { | |
| new RegExp('Node.js version: ' + process.version), | ||
| 'NodeReport section contains expected Node.js version'); | ||
| } | ||
| if (options && options.commandline) { | ||
| if (this.isWindows()) { | ||
| // On Windows we need to strip double quotes from the command line in | ||
| // the report, and escape backslashes in the regex comparison string. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. n.b. I'm not seeing any double quotes in the reported command line in the reports generated from the tests on Windows.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might depend on the shell or the executable path. This is what I am seeing on Windows:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I think it might be spaces in the paths -- I get the same if I use Node.js installed under |
||
| t.match(nodeReportSection.replace(/"/g,''), | ||
| new RegExp('Command line: ' | ||
| + (options.commandline).replace(/\\/g,'\\\\')), | ||
| 'Checking report contains expected command line'); | ||
| } else { | ||
| t.match(nodeReportSection, | ||
| new RegExp('Command line: ' + options.commandline), | ||
| 'Checking report contains expected command line'); | ||
| } | ||
| } | ||
| nodeComponents.forEach((c) => { | ||
| if (c !== 'node') { | ||
| if (expectedVersions.indexOf(c) === -1) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The indentation for this
#elifblock is different from the rest of this function, please can you make it consistent?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.
The rest of the function was wrong and didn't match the file. I'd indented when starting #ifdef sections. I've adjusted the rest of the function to be correct.