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

Data merge concurrency #1293

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions index.js
Expand Up @@ -408,11 +408,16 @@ class NYC {

async getCoverageMapFromAllCoverageFiles (baseDirectory) {
const map = libCoverage.createCoverageMap({})
const files = await this.coverageFiles(baseDirectory)

const data = await this.coverageData(baseDirectory)
canonic-epicure marked this conversation as resolved.
Show resolved Hide resolved
data.forEach(report => {
map.merge(report)
})
await pMap(
files,
async f => {
const report = await this.coverageFileLoad(f, baseDirectory)
map.merge(report)
},
{ concurrency: os.cpus().length }
)

map.data = await this.sourceMaps.remapCoverage(map.data)

Expand Down Expand Up @@ -503,6 +508,7 @@ class NYC {
}
}

// TODO: Remove from nyc v16
async coverageData (baseDirectory) {
const files = await this.coverageFiles(baseDirectory)
return pMap(
Expand Down