Move .test-cost.json

Also include parameter name in test output so that people will know what
to do to change the percent chance of failure.
This commit is contained in:
Nathan Shively-Sanders
2019-06-19 08:40:06 -07:00
parent 41b117eda7
commit fce7f9f87b
3 changed files with 4 additions and 5 deletions

View File

@@ -25,7 +25,6 @@ async function main() {
const percentTime = perf[k] / totalTime
const percentHits = (1 + (edits[otherk] || 0)) / totalEdits
const cost = 5 + Math.log(percentTime / percentHits)
// TODO: Write counts instead of numbers to make JSON file smaller
data.push({ name: otherk, time: perf[k], edits: 1 + (edits[otherk] || 0), cost})
if (edits[otherk])
i++
@@ -36,7 +35,7 @@ async function main() {
data: data.sort((x,y) => y.cost - x.cost).map(x => ({ ...x, cost: x.cost.toFixed(2) }))
}
fs.writeFileSync('.test-cost.json', JSON.stringify(output), 'utf8')
fs.writeFileSync('tests/.test-cost.json', JSON.stringify(output), 'utf8')
}
main().catch(e => {