coverage-ext icon indicating copy to clipboard operation
coverage-ext copied to clipboard

Getting "Error: ENAMETOOLONG: name too long" when processing captured json, also 404 for some report html

Open plermant opened this issue 9 years ago • 4 comments

Hi Sam, a couple of thing i wanted to report:

  1. I am getting this Error when processing the report html (I attach the info in ZIP): jsCoveragePierre.zip
plermant@ubuntu:/mnt/hgfs/desktopBin/coverage-ext-master/reporter$ nodejs gen_report.js jsCoverage.txt
Write asset: /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/base.css
Write asset: /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/sort-arrow-sprite.png
Write asset: /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/sorter.js
Write asset: /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/prettify.css
Write asset: /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/prettify.js
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/index.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/index.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---ajax-googleapis-com-ajax-libs-jquery-1-8-2-jquery-min-js---0.1150.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---api-atg-kohls-com-update-ede-assets-js-ede-wrapper-js---0.5320.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---b-scorecardresearch-com-beacon-js---0.8683.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---cdn-brcdn-com-v1-br-trk-5117-js---0.4244.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---d3t1dw6evd1rv7-cloudfront-net-385-s_code-js---0.2737.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---d3t1dw6evd1rv7-cloudfront-net-v3-foresee-foresee-surveydef-js-build=3---0.9485.html
Writing /mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---d87niwgcilqaw-cloudfront-net-social-entry-getSimplePoolEntries-campaignId=3&channelId=1&poolName=loyalty&offset=0&limit=500&callback=SK-MR-cmsService-getCMSEntries---0.8577.html
fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENAMETOOLONG: name too long, open '/mnt/hgfs/desktopBin/coverage-ext-master/reporter/html-report/__root__/http---d87niwgcilqaw-cloudfront-net-social-entry-getSimplePoolEntries-campaignId=3&channelId=1&poolName=loyalty&offset=0&limit=500&callback=SK-MR-cmsService-getCMSEntries---0.8577.html'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.writeFileSync (fs.js:1156:15)
    at SyncFileWriter.extend.writeFile (/mnt/hgfs/desktopBin/coverage-ext-master/reporter/node_modules/istanbul/lib/util/file-writer.js:58:12)
    at FileWriter.extend.writeFile (/mnt/hgfs/desktopBin/coverage-ext-master/reporter/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /mnt/hgfs/desktopBin/coverage-ext-master/reporter/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)
    at HtmlReport.Report.mix.writeFiles (/mnt/hgfs/desktopBin/coverage-ext-master/reporter/node_modules/istanbul/lib/report/html.js:482:23)
    at /mnt/hgfs/desktopBin/coverage-ext-master/reporter/node_modules/istanbul/lib/report/html.js:484:22
    at Array.forEach (native)

Would you know of a workaround for this? Some js name can be dynamically generated so the URLs tend to be quite long ...?

  1. Also, and it may or may not be related to the issue above, the final html produces many links that don't resolve. For instance the report list this however I get a 404 (see report in zip) jsCoveragePierre.zip : file:///C:/Users/plermant/Documents/bin/coverage-ext-master/reporter/html-report/root/http---s-btstatic-com-lib-0e11339390158edd976adc7552fd7d9ebc1e36fb-js-v=1---0.4831.html

plermant avatar Sep 26 '16 21:09 plermant

Hi @plermant Thanks for the bug

for point 1 I though that https://github.com/samccone/coverage-ext/pull/7 Should have fixed this, clearly there is still an issue. (unless your clone is out of data)

I think that your second point is related to the issue with writing files.

Let me know if your local copy is up to date with the tip of tree, if so I will look into the issue further. Thanks!

samccone avatar Sep 26 '16 23:09 samccone

Hi Sam,

I do have the latest code since I initially pulled your code last Friday,.

I have a hunch on what's happening though.

If I replace 200 with 150 in

var truncateFileNames = function (data) { return Object.keys(data).reduce(function (n, path) { n[path.slice(0, 200)] = data[path]; n[path.slice(0, 200)].path = path.slice(0, 200)

    return n;
}, {});

}

The program goes thru, so the value of 200 probably does NOT include the path I run the program from. In my example it is:

/mnt/hgfs/desktopBin/PerfAssessScripts/coverage-ext-master/reporter/html-report/root

I'm not a programmer by trade so I'm not sure exactly what would need to change, however my hunch is that if you include the entire path when you calculate where to slice then we should be good. BTW, this also fixes issue #2 ...

thanks

Pierre


From: Sam Saccone [email protected] Sent: Monday, September 26, 2016 4:39 PM To: samccone/coverage-ext Cc: Pierre Lermant; Mention Subject: Re: [samccone/coverage-ext] Getting "Error: ENAMETOOLONG: name too long" when processing captured json, also 404 for some report html (#11)

Hi @plermanthttps://github.com/plermant Thanks for the bug

for point 1 I though that #7https://github.com/samccone/coverage-ext/pull/7 Should have fixed this, clearly there is still an issue. (unless your clone is out of data)

I think that your second point is related to the issue with writing files.

Let me know if your local copy is up to date with the tip of tree, if so I will look into the issue further. Thanks!

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/samccone/coverage-ext/issues/11#issuecomment-249728648, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AN6n04Iqz3pe2DfvD32JL1Ko3tQURVLWks5quFevgaJpZM4KHAX-.

plermant avatar Sep 27 '16 16:09 plermant

ah interesting that very well could be the root issue! great call @plermant this should be a simple fix on my side. Thanks for the A+ debugging on your side. I will land a patch for this tonight

samccone avatar Sep 27 '16 17:09 samccone

I have a feeling this is fixed by encodeURIComponent?

I found before when the file name included some characters that disrupted.

On Tue, 27 Sep 2016 at 18:45, Sam Saccone [email protected] wrote:

ah interesting that very well could be the root issue! great call @plermant https://github.com/plermant this should be a simple fix on my side. Thanks for the A+ debugging on your side. I will land a patch for this tonight

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/samccone/coverage-ext/issues/11#issuecomment-249941746, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKsrvGp_yYiFZguPeEF967lY6zh0qFnks5quVY3gaJpZM4KHAX- .

wmonk avatar Sep 27 '16 17:09 wmonk