One of the most popular tools for tracking code coverage in JavaScript is Istanbul (and its command-line runner: nyc).
Unfortunately, it seems using this on Wikimedia CI leads to a cryptic error.
+ npm run-script test > nyc -r text -r html qunit test/ /src/node_modules/nyc/node_modules/mkdirp/index.js:90 throw err0; ^ Error: EACCES: permission denied, mkdir '/nonexistent' at Error (native) at Object.fs.mkdirSync (fs.js:923:18) at sync (/src/node_modules/nyc/node_modules/mkdirp/index.js:71:13) at Function.sync (/src/node_modules/nyc/node_modules/mkdirp/index.js:77:24) at setup (/src/node_modules/nyc/node_modules/spawn-wrap/index.js:414:10) at wrap (/src/node_modules/nyc/node_modules/spawn-wrap/index.js:60:18) at Object.<anonymous> (/src/node_modules/nyc/bin/nyc.js:57:3)
(Filed upstream at https://github.com/istanbuljs/nyc/issues/951).
It turns out, one of Instanbul's indirect dependencies needs to store a the process ID for something, and does so in a temporary file under the home directory. It would then clean this up afterward.
Arguably such values should be stored in a tmpdir. But, that's an upstream issue. I was able to workaround this problem by finding an undocumented injection path for the PID file, but that won't work for everyone.
Allowing jobs to write to their home directory would make us compatible with a larger eco system of tools in the world, as well for interoperability with other continuous integration environments (Travis CI, Jenkins, AppVeyor, GitLab, etc.).
"Home directory" here is defined as the directory referenced by the HOME environment variable, and is expected to be equally ephemeral as TMPDIR and WORKSPACE, etc.