Show all test metadata in results

This commit is contained in:
Daniel Patterson 2018-02-06 21:35:12 -08:00
parent f532912e62
commit 5d0dcbbc21
No known key found for this signature in database
GPG Key ID: 19C12BE1725A028B
2 changed files with 26 additions and 18 deletions

View File

@ -81,20 +81,6 @@ module.exports = function () {
approaches = this.approachList(route);
var resultdata = {
feature: this.feature.getName(),
scenario: this.scenario.getName(),
row: rowIndex,
expected: {
route: table.hashes()[rowIndex]["route"],
turns: table.hashes()[rowIndex]["turns"],
},
got: {
route: instructions,
turns: turns
}
}
fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_results.json`,JSON.stringify(resultdata));
fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_response.json`,body);
var geojson = {
@ -268,6 +254,16 @@ module.exports = function () {
putValue('driving_side', driving_sides);
}
var resultdata = {
feature: this.feature.getName(),
scenario: this.scenario.getName(),
row: rowIndex,
expected: table.hashes()[rowIndex],
got: got
}
console.log(resultdata);
fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_results.json`,JSON.stringify(resultdata));
for (var key in row) {
if (this.FuzzyMatch.match(got[key], row[key])) {
got[key] = row[key];

View File

@ -179,7 +179,7 @@ find('test/cache').filter((f) => f.match(/[0-9]+_results.json$/)).forEach((f) =>
results.got.turns = results.got.turns.replace(/slight /g,'').replace(/sharp /g, '');
report += `<div class='scenario ${results.got.turns == results.expected.turns ? 'ok' : 'error'}'>
<h2><a name="${imagefile}">${results.feature} - ${results.scenario}</a></h2>
<h2><a href="${imagefile}">[link]</a> <a name="${imagefile}">${results.feature} - ${results.scenario}</a></h2>
<a href="${osmfile}">Download OSM XML file for this test</a><br/>
<a href="${pbffile}">Download OSM PBF file for this test</a><br/>
<a href="${requestfile}">Download request used for this test</a><br/>
@ -192,9 +192,21 @@ find('test/cache').filter((f) => f.match(/[0-9]+_results.json$/)).forEach((f) =>
</td>
<td>
<table class="results">
<tr><th/><th style='text-align: left'>Route</th><th style='text-align: left'>Turns</th></tr>
<tr><th style='text-align: right'>OSRM</th><td>${results.expected.route}</td><td>${results.expected.turns}</td></tr>
<tr><th style='text-align: right'>Valhalla</th><td>${results.got.route}</td><td class='${results.got.turns == results.expected.turns ? 'ok' : 'error'}'>${results.got.turns}</td></tr>
<tr><th/>`;
Object.keys(results.expected).forEach((k) => {
report += `<th style="text-align: left">${k}</th>`;
});
report += `</tr>`;
report += `<tr><th style='text-align: right'>OSRM</th>`;
Object.keys(results.expected).forEach((k) => {
report += `<td style="text-align: left">${results.expected[k]}</td>`;
});
report += `</tr>`;
report += `<tr><th style='text-align: right'>Valhalla</th>`;
Object.keys(results.expected).forEach((k) => {
report += `<td style="text-align: left" class="${results.expected[k] === results.got[k] ? "ok" :"error" }">${results.got[k]}</td>`;
});
report += `</tr>
</table>
</td></tr></table>
</div>